mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-15 00:44:56 -05:00
improvement(serializer): canonical subblock, serialization cleanups, schedules/webhooks are deployment version friendly (#2848)
* hide form deployment tab from docs * progress * fix resolution * cleanup code * fix positioning * cleanup dead sockets adv mode ops * address greptile comments * fix tests plus more simplification * fix cleanup * bring back advanced mode with specific definition * revert feature flags * improvement(subblock): ui * resolver change to make all var references optional chaining * fix(webhooks/schedules): deployment version friendly * fix tests * fix credential sets with new lifecycle * prep merge * add back migration * fix display check for adv fields * fix trigger vs block scoping --------- Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
This commit is contained in:
committed by
GitHub
parent
ce3ddb6ba0
commit
78e4ca9d45
@@ -495,6 +495,7 @@ export async function deployWorkflow(params: {
|
||||
}): Promise<{
|
||||
success: boolean
|
||||
version?: number
|
||||
deploymentVersionId?: string
|
||||
deployedAt?: Date
|
||||
currentState?: any
|
||||
error?: string
|
||||
@@ -533,6 +534,7 @@ export async function deployWorkflow(params: {
|
||||
.where(eq(workflowDeploymentVersion.workflowId, workflowId))
|
||||
|
||||
const nextVersion = Number(maxVersion) + 1
|
||||
const deploymentVersionId = uuidv4()
|
||||
|
||||
// Deactivate all existing versions
|
||||
await tx
|
||||
@@ -542,7 +544,7 @@ export async function deployWorkflow(params: {
|
||||
|
||||
// Create new deployment version
|
||||
await tx.insert(workflowDeploymentVersion).values({
|
||||
id: uuidv4(),
|
||||
id: deploymentVersionId,
|
||||
workflowId,
|
||||
version: nextVersion,
|
||||
state: currentState,
|
||||
@@ -562,10 +564,10 @@ export async function deployWorkflow(params: {
|
||||
// Note: Templates are NOT automatically updated on deployment
|
||||
// Template updates must be done explicitly through the "Update Template" button
|
||||
|
||||
return nextVersion
|
||||
return { version: nextVersion, deploymentVersionId }
|
||||
})
|
||||
|
||||
logger.info(`Deployed workflow ${workflowId} as v${deployedVersion}`)
|
||||
logger.info(`Deployed workflow ${workflowId} as v${deployedVersion.version}`)
|
||||
|
||||
if (workflowName) {
|
||||
try {
|
||||
@@ -582,7 +584,7 @@ export async function deployWorkflow(params: {
|
||||
workflowName,
|
||||
blocksCount: Object.keys(currentState.blocks).length,
|
||||
edgesCount: currentState.edges.length,
|
||||
version: deployedVersion,
|
||||
version: deployedVersion.version,
|
||||
loopsCount: Object.keys(currentState.loops).length,
|
||||
parallelsCount: Object.keys(currentState.parallels).length,
|
||||
blockTypes: JSON.stringify(blockTypeCounts),
|
||||
@@ -594,7 +596,8 @@ export async function deployWorkflow(params: {
|
||||
|
||||
return {
|
||||
success: true,
|
||||
version: deployedVersion,
|
||||
version: deployedVersion.version,
|
||||
deploymentVersionId: deployedVersion.deploymentVersionId,
|
||||
deployedAt: now,
|
||||
currentState,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user