Repository navigation
fix(cli): one --workflow flag across commands; deprecate --workflow-id - #10594
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryStandardizes four commands on
No new actionable issues found. Tests were inspected, not run. Reviews (4) · Last reviewed commit: "fix(cli): refuse a flag's two spellings ..." · Reviewed by Greptile |
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 5/5
- In
build.ts,runs get -- -Ab3xcan get misleading guidance that the ID is an option when a required option is missing. Preserve the--/ID handling in this case.
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="packages/sim-cli/src/runtime/build.ts">
<violation number="1" location="packages/sim-cli/src/runtime/build.ts:311">
P3: This treats a dash-prefixed positional as an unknown flag when a required option is also missing. For example, `runs get -- -Ab3x` receives misleading guidance that the ID is not an option; preserve the `--`/ID handling here or distinguish actual unknown options from escaped operands.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6e9d00f to
e73a992
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
e73a992 to
bae2c62
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
…le-workflow commands logs list, logs stats and logs follow answer to --workflow-id; chat-deployments list and workflows source catalog answer to --workflow. Both spellings are hidden from help and the command inventory, and passing both is refused. A required flag missing beside an unknown one now names the unknown flag: commander reports the missing flag first and never reaches its did-you-mean suggestion.
chat-deployments list, workflows source catalog, workflow-mcp-servers tools create and tables groups update named the workflow --workflow-id; they now take --workflow like every other command. --workflow-id still works with the rename warning. Drops the hidden aliases the previous commit added. A former spelling is now copied onto the documented flag as it is parsed, so a required renamed flag stays required in commander and the command inventory (tables rows search --query and workflows move --to were reported optional). A required flag missing beside an unknown one suggests it in commander's words.
…y hook runs Both spellings at once were refused only when the generated action ran, after catalog's preAction had already resolved a workflow name (a listWorkflows request). The parse-time copy now refuses the pair in either order with commander's error, and one helper words the refusal for both checks.
bae2c62 to
74eedad
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
A Mothership agent ran
sim logs list --workflow-id <id>and failed. Every command spells a workflow--workflowexcept four, whose generated flag kept the request field nameworkflowId:chat-deployments listworkflows source catalogworkflow-mcp-servers tools createtables groups updateThis PR gives each one concept one long flag name across the CLI:
--workflow, through the contract's existingrenamedFrom.--workflow-idkeeps working, hidden from help, the docs and the inventory. It warns in the standard rename wording ("flag "--workflow-id" has been renamed to "--workflow". The old name still works."), on stderr for table output or as the result'snotein JSON/YAML. Passing both spellings is refused.renamedFromkeeps required flags required: a renamed or aliased flag used to lose commander's required check, so help said "(required)" while the command inventory reportedrequired: false. A value typed under another spelling is now copied onto the documented flag as it is parsed (sourceimplied). Commander's required check, the inventory and any action all read the documented flag, andfoldOtherSpellingsstill warns and refuses both spellings. This also fixestables rows search --query(renamed from--q) andworkflows move --to(renamed from--folder), which the inventory had marked optional.workflows runs get <id> --workflow-id Xonly saidrequired option '--workflow <workflowId>' not specifiedand never got commander's did-you-mean. It now adds--workflow-id is not an option of sim workflows runs get. (Did you mean --workflow?)and then theExample:line. A plain unknown option already gets commander's own suggestion;showSuggestionAfterErroris on.The CLI reference docs are regenerated.
Mothership: the command inventory changes. Those four commands now list
--workflow/workflowin place of--workflow-id/workflowId, andtables rows search --queryandworkflows move --toare nowrequired: true. A re-sync is needed.Type of Change
Testing
Tests that failed before the fix, in
src/runtime/file-references.test.ts:--workflowwith no warning--workflow-id, with the rename warningtools createstill requires a workflow, checked by commander--workflow--workflowI also reverted each guard and watched its test fail. Ran sim-cli vitest (1374 passed), sim-cli type-check, lint,
bun run generateandcheck:audits. The only audit failure ischeck:unused-exports: knip can't resolve the generatedapps/docs/.contentimport, which isn't present in a local checkout and isn't touched here.Checklist