Skip to content

fix(workflows-as-code): cli apply/run reporting and v2 workflow-source contract - #10542

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/wac-qa-b6-cli-apply-run-contract
Dec 1, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/wac-qa-b6-cli-apply-run-contract

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

QA fixes for workflows as code (batch B6): how the CLI's workflows source apply/create and workflows run report outcomes, plus the v2 workflow-source contract. The contract part needs to land before default-on, because changing a public API shape after GA breaks callers.

  • A rate-limited --run was reported as "nothing was written" (exit 9) after a saved apply. The draft dry run now resends a 429. That is safe because the run is refused at admission, before it starts. A run that is still limited after the retries becomes a failed test run of the saved write. It shows in runs and the summary, exits 1 and says "Wait a minute, then run …". The exit-9 help for apply and create no longer claims nothing was written.
  • A --deploy refused because the draft changed (409) suggested the same pinned deploy, which can never succeed. The CLI now points to sim workflows source status --dir <dir> / sim workflows source get <id> --dir <fresh dir>. Other deploy failures keep the pinned deploy command.
  • An apply that changed only block names, order or comments was reported as "not applied" / "Nothing changed", though it was saved. The v2 source response now returns wroteSourceMeta. The CLI reports saved (names, order or comments only), and a failed --run after such an apply says the apply was saved.
  • A SOURCE_STALE refusal had no concrete next command. It now appends Next: sim workflows source get <id> --dir <fresh dir> and carries it as details.next, with exit 5 as before.
  • A source over the limit was uploaded anyway. Before sending, apply/create check the file-count and total-size limits (sourceFileExcesses, split out of sourceLimitExcesses). The CLI refuses an over-limit source with E_LIMIT_EXCEEDED, exit 7 and the measured size, and sends nothing.
  • workflows run --trigger took only a block id. The manual run now takes a trigger's id, display name or reference key, as --from-block and --stop-after already did. A name matching several triggers is refused with their ids. workflows run rewrites run.entry.blockId in trigger refusals as --trigger (but not for a --from-block entry). The multi-trigger message now reads "Choose one with run.entry.blockId, by its id or name: …".
  • Create from source answered 200 on a real create. It now answers 201; a dry run still answers 200. The response declares [200, 201] and OpenAPI documents both.
  • Create from source accepted an allowDelete it ignored. Create now has its own strict query schema: dry, plus the deprecated dryRun. ?allowDelete answers 400.

Regenerated: OpenAPI, CLI API types, MCP operations, CLI docs.

Tests

Each new test was red against the pre-fix file (restored from HEAD) and green after:

  • CLI workflow-source-apply.test.ts: covers a rate-limited later --run, a deploy 409 hint, a meta-only apply summary, a stale next, and the over-limit preflight.
  • CLI workflow-run-follow.test.ts: the trigger refusal names --trigger. A second test checks that a --from-block refusal keeps the wire field.
  • execute-manual-workflow.test.ts: covers a trigger by display name or key, and an unknown name listing the triggers.
  • Route tests: create answers 201, ?allowDelete on create answers 400, and a meta-only apply returns wroteSourceMeta: true.

Local gate: type-check passes for sim-cli, workflow-code and apps/sim; lint passes. check:audits passes except check:unused-exports, which first failed only because the docs .content output had not been generated. It passes once that is generated. The sim-cli suite (1339) and the related apps/sim contract and route suites pass.

Risks

  • Additive response field (wroteSourceMeta). The create status changes from 200 to 201 on a real create, so a client checking === 200 would need to accept 201.
  • ?allowDelete on create is now a 400 instead of being ignored.
  • The multi-trigger error text changed. The CLI still matches "multiple runnable triggers".

@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 6:13am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge, with no outstanding actionable findings.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no outstanding actionable findings.

Summary

This PR improves CLI outcome reporting and updates the v2 workflow-source contract.

  • Workflow-source writes report saved work separately from later failures.
  • The workflow-source API reports metadata saves and clear create outcomes.
  • Manual workflow runs can choose a trigger by id, name, or key.

The earlier, unnumbered finding about the dry-run example is fixed. No new actionable issues or repository-rule violations were found.

Reviews (3) · Last reviewed commit: "test(workflows-as-code): expect 201 from..." · Reviewed by Greptile

@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 21 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/docs/openapi-v2-workflows.json Resolved
…ource contract

- resend a rate-limited --run test run, and report one still limited as a failed run of the saved write (exit 1), not exit 9 'nothing was written'
- after a deploy refused because the draft changed, name source status/get instead of the same pinned deploy
- return wroteSourceMeta, so an apply that saved only names, order or comments is reported as saved
- give a SOURCE_STALE refusal a next step: the fresh get
- refuse a source over the file or size limit before uploading it, naming its size
- resolve the run trigger by id, display name or key; workflows run names --trigger in trigger refusals
- create from source answers 201 and no longer accepts allowDelete
- document the create's 200 dry run and 201 create with their own examples
- name the draft read only for a deploy refused because the draft changed; other 409s keep the pinned deploy
- report a rate-limited workspace --run as one to retry after a wait, not a --run input to fix
@waleedlatif1
waleedlatif1 force-pushed the fix/wac-qa-b6-cli-apply-run-contract branch from 7df4c24 to 3d43611 Compare December 1, 2026 06:03
@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 23 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

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 24 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 3e8456c into staging Dec 1, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/wac-qa-b6-cli-apply-run-contract branch December 1, 2026 07:03

This branch was previously deployed

1 inactive deployment
Preview — c6dbb51b 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