Skip to content

fix(workspace-source): make a renamed workflow folder move its key coherently - #10546

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/wac-qa-b2-workflow-folder-rename
Dec 1, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/wac-qa-b2-workflow-folder-rename

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • 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 now plans 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; the finding names 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 (same id, no new version)
  • 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 for one the refusal already names
  • Docs: diagnostics table, workspace primer, workspace-code DESIGN.md

Type of Change

  • Bug fix

Testing

  • New deployments.integration.ts cases (real Postgres/Redis): folder-only move plans update 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 nothing
  • Each case fails on the pre-fix code, and each guard (draft-warning skip, deployment re-keying, key-only draft check, moved-key resolution) was reverted on its own to watch its test go red
  • workspace-source + source-pipeline integration suites (328 tests) and unit suites, workspace-code and sim-cli suites
  • bun 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:strict

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…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
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 7:33am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; the previous findings are addressed and the latest assertion adds no runtime changes.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous findings are addressed and the latest assertion adds no runtime changes.

Summary

Workflow folder renames now move the workflow key and its saved base entry together. Deployments follow the new key without creating a new version.

  • Renaming a workflow folder moves its existing workflow key.
  • Applies stop when deployments or callers still use the old key.

All three previous, unnumbered findings are addressed in the current code. No new issues were found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Workflow folder renamed] --> B[Plan key update]
  B --> C{Old-key references remain?}
  C -->|Yes| D[Refuse apply]
  C -->|No| E[Check access and locks]
  E --> F[Write workflow and claim new key]
  F --> G[Move workflow base entry]
  G --> H[Move unchanged deployment base entry]
Loading

Reviews (3) · Last reviewed commit: "test(workspace-source): pin the fingerpr..." · Reviewed by Greptile

… and move deployment base entries only after the rename lands
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 88daf42 into staging Dec 1, 2026
87 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 38f6a75b Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant