Repository navigation
fix(workspace-source): make a renamed workflow folder move its key coherently - #10546
Conversation
…herently
A renamed workflow folder was a silent no-op, then re-keyed the workflow on
its next edit and left its deployment and callers naming no workflow.
- a folder renamed alone plans an update with fields ['key']: the write
claims the new key and the base entry moves with it
- the plan refuses the rename (E_WORKFLOW_RENAMED_IN_USE) while
deployments/<old>.ts or childWorkflow('<old>') still name the old key,
naming the file and the rename to make
- deployments are planned under the renamed keys, so moving
deployments/<old>.ts with the folder keeps the deployment as it is
- an unchanged copy beside its original, or several folders naming one
workflow, move no key
- W_DEPLOYED_DRAFT_CHANGED no longer fires for a key-only move or one the
refusal already names
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
1 issue found across 15 files
Confidence score: 3/5
- In
adapter.ts, a key-only rename can rebind a workflow edited after the directory read with its old source fingerprint, bypassing the stale check. Record the expected workflow fingerprint on the rename and recheck it.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/workspace-source/application/kinds/workflow/adapter.ts">
<violation number="1" location="apps/sim/lib/workspace-source/application/kinds/workflow/adapter.ts:939">
P2: Key-only renames bypass the workflow stale check, so a workflow edited after the directory read can be rebound with the old source fingerprint. Record the expected workflow fingerprint on the rename change and recheck it before `moveKey` returns, so the apply refuses instead of leaving a stale base that causes later source updates to fail unexpectedly.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
[Medium impact] The PR appears safe to merge; the previous findings are addressed and the latest assertion adds no runtime changes. SummaryWorkflow folder renames now move the workflow key and its saved base entry together. Deployments follow the new key without creating a new version.
All three previous, unnumbered findings are addressed in the current code. No new issues were found.
|
… and move deployment base entries only after the rename lands
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
updatewith fields['key']: the write claims the new key and the base entry moves with itE_WORKFLOW_RENAMED_IN_USE) whiledeployments/<old>.tsorchildWorkflow('<old>')still name the old key; the finding names the file and the rename to makedeployments/<old>.tswith the folder keeps the deployment (same id, no new version)W_DEPLOYED_DRAFT_CHANGEDno longer fires for a key-only move, or for one the refusal already namesType of Change
Testing
deployments.integration.tscases (real Postgres/Redis): folder-only move plansupdate workflow:<new> [key]and a follow-up dry run is clean; move leaving the deployment file and a caller is refused with nothing written; move with the references renamed keeps the deployment; an unchanged copy beside its original moves nothingbun run generate,type-check(apps/sim, workspace-code, sim-cli), biome,check:audits(all pass except a local-only knip miss on the docs app's generated.content),check:api-validation:strictChecklist
test-auditauthoring gate)