Repository navigation
fix(cli): pick a trigger in workspace apply --run and skip deployment reads of new workflows - #10539
waleedlatif1 wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Medium impact] The PR appears safe to merge. SummaryAdds trigger selection to workspace apply runs and skips deployment reads for newly created, undeployed workflows.
Reviews (4) · Last reviewed commit: "fix(cli): refuse two --run names of one ..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
197e3d3 to
5c5a5fd
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
5c5a5fd to
5632e79
Compare
|
@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 9 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. |
… reads of new workflows - --run <key>.<trigger>=<input> enters a run through a named trigger (const, block key or id); a key may repeat once per trigger - a multi-trigger refusal is rewritten in --run terms and next names a trigger instead of repeating the refused value; no doubled period - created workflows with no deployments/ change report not deployed without a deployment GET - docs, primer and loop help name the trigger form and the untested-draft gate
… trigger, and name every trigger form
a61be67 to
e89dd69
Compare
What
Workflows-as-code QA batch B7:
sim workspaces source apply --runcan test a workflow with several triggers, and the apply no longer reads the deployment of every workflow it just created.A workflow with more than one trigger could never be test-run in a workspace apply.
--run <key>=<input>had no way to name a trigger, and a repeated key was refused. For a workflow with an API and a webhook trigger, the server refused the run with its raw message (naming the wire fieldrun.entry.blockId, ending in..).nextthen repeated the same failing--run, so an agent following it looped, anddeployments/for that workflow could never be applied under--run.--run <key>.<trigger>=<input>names the trigger by its const, block key or id, resolved through the saved lock, the same waysim workflows source apply --run <trigger>=<input>does. A key may repeat once per trigger.runTestsfromworkflow-test-runs.ts. The multi-trigger and not-a-trigger refusals are rewritten in--runterms (--run 'two.apiIn={…}' (or two.hook=<its input>)), andnext.commandnames that trigger instead of repeating the refused value.One deployment GET per written workflow (N+1).
deployments/change for it, cannot be deployed. It is now reported asnot deployedwithout aGET /api/v2/workflows/{id}/deployment.Docs.
workspace.mdx, the workspace primer, loop help and the directoryAGENTS.mdtext now describe the<key>.<trigger>form.deployments/is skipped, and the apply exits non-zero, when it would publish a draft no--runtested.Not in this PR
Tests
In
workspace-source-apply.test.ts. I reverted each guard on its own and watched its test fail before restoring it:tests each trigger named as <key>.<trigger>, then applies deployments/: two runs go throughb-apiandb-hook, thendeployments/is applied.names the triggers and a next that picks one when a --run names none: norun.entry.blockId, no.., andnextis--run 'ingest.apiIn={…}'.maps an input the server refuses…: the server message now ends in., which guards against the doubled period.reads no deployment of a workflow it created without a deployments/ change: 60 created workflows, 0 deployment GETs.refuses the same workflow and trigger twice.The full sim-cli suite passes (1336 tests), along with sim-cli type-check, lint and
check:audits.Risks
--runvalues with a period before the first=now read as<key>.<trigger>. Workflow keys cannot hold a period ([a-z][a-z0-9_-]*), so no valid key changes meaning.runTestsgains an optionalflagformatter. The single-workflow path passes none and is unchanged, and its tests still pass.