Repository navigation
fix(workflows-as-code): cli apply/run reporting and v2 workflow-source contract - #10542
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge, with no outstanding actionable findings. SummaryThis PR improves CLI outcome reporting and updates the v2 workflow-source contract.
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 |
There was a problem hiding this comment.
All reported issues were addressed across 21 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…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
7df4c24 to
3d43611
Compare
|
@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 review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
What and why
QA fixes for workflows as code (batch B6): how the CLI's
workflows source apply/createandworkflows runreport 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.--runwas 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 inrunsand 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.--deployrefused because the draft changed (409) suggested the same pinned deploy, which can never succeed. The CLI now points tosim workflows source status --dir <dir>/sim workflows source get <id> --dir <fresh dir>. Other deploy failures keep the pinned deploy command.wroteSourceMeta. The CLI reportssaved (names, order or comments only), and a failed--runafter such an apply says the apply was saved.SOURCE_STALErefusal had no concrete next command. It now appendsNext: sim workflows source get <id> --dir <fresh dir>and carries it asdetails.next, with exit 5 as before.sourceFileExcesses, split out ofsourceLimitExcesses). The CLI refuses an over-limit source withE_LIMIT_EXCEEDED, exit 7 and the measured size, and sends nothing.workflows run --triggertook only a block id. The manual run now takes a trigger's id, display name or reference key, as--from-blockand--stop-afteralready did. A name matching several triggers is refused with their ids.workflows runrewritesrun.entry.blockIdin trigger refusals as--trigger(but not for a--from-blockentry). The multi-trigger message now reads "Choose one with run.entry.blockId, by its id or name: …".201; a dry run still answers200. The response declares[200, 201]and OpenAPI documents both.allowDeleteit ignored. Create now has its own strict query schema:dry, plus the deprecateddryRun.?allowDeleteanswers 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:workflow-source-apply.test.ts: covers a rate-limited later--run, a deploy 409 hint, a meta-only apply summary, a stalenext, and the over-limit preflight.workflow-run-follow.test.ts: the trigger refusal names--trigger. A second test checks that a--from-blockrefusal keeps the wire field.execute-manual-workflow.test.ts: covers a trigger by display name or key, and an unknown name listing the triggers.?allowDeleteon create answers 400, and a meta-only apply returnswroteSourceMeta: true.Local gate: type-check passes for sim-cli, workflow-code and apps/sim; lint passes.
check:auditspasses exceptcheck:unused-exports, which first failed only because the docs.contentoutput 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
wroteSourceMeta). The create status changes from 200 to 201 on a real create, so a client checking=== 200would need to accept 201.?allowDeleteon create is now a 400 instead of being ignored.