Repository navigation
fix(sim-cli): consistent source command flags and refusals - #10555
Merged
Merged
Conversation
- workflows source resources and catalog take --dir (the directory's workspace, and for catalog its workflow); catalog --workflow-id takes an exact name like get - --json (same as --output json, errors included) on every workflows/workspaces source subcommand; an unknown --json elsewhere suggests --output json - SOURCE_DIR_KIND_MISMATCH names the command run, says 'would replace its base' only for get, and points at the workflow folder or the matching command - the not-found hint says -w <id>, which the wire-name rewording no longer turns into -w <--workspace> - writing a source answer back skips files whose text on disk is already the answer's, so a no-op apply moves no mtimes
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; both earlier findings are fixed and no new actionable issues were found. SummaryThe PR makes source command flags and error messages consistent and skips rewriting unchanged source files.
Reviews (3) · Last reviewed commit: "fix(sim-cli): resolve resources and cata..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 29 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…other commands do --dir defaults to the working directory, so catalog includes the workflow it holds; a directory naming no workspace clears the working directory's; and a -w or SIM_WORKSPACE naming another workspace than the directory's record is refused (SOURCE_OTHER_WORKSPACE). The docs baseline records the changed resources usage fence.
Collaborator
Author
|
@greptile review |
Collaborator
Author
|
@cubic-dev-ai review |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QA batch B10 (CLI UX consistency) for workflows as code. Each item was re-checked on current staging first.
resourcesandcatalogtake--dir. These were the only twoworkflows sourcecommands without it, and bench agents kept gettingunknown option '--dir'.--dirdefaults to., like the other source commands. The command reads the workspace the directory (or a directory above it) names, and a directory that names none falls back to the profile's workspace, not the working directory's. A-worSIM_WORKSPACEnaming a different workspace from the directory's record is refused withSOURCE_OTHER_WORKSPACE, asget --dirdoes.catalogalso uses the workflow in the directory's.sim/base.json.catalog --workflow-idnow accepts an exact workflow name as well as an id, the same wayget <workflow>does. The flag keeps the--workflow-idspelling: that is how every other query or bodyworkflowIdfield is spelled, and the flag-naming contract test checks this.--jsonworks on everyworkflows sourceandworkspaces sourcesubcommand. It is the same as--output json, and errors use it too. Before, only status and diff accepted it, socheck --jsonfailed and pointed agents at status and diff.--jsonis now read inprofileFrom, which removes the four per-command special cases. An unknown--jsonon any other command now suggests--output jsoninstead of listing source commands.SOURCE_DIR_KIND_MISMATCHgives the right reason and the right command. The refusal now knows which command ran. It says "would replace its base" only forget. Forfind,checkand the other commands it says the command does not read that kind of directory. It points at the workflow folder (--dir <ws>/workflows/<key>). It namessim workspaces source <cmd>only when that command exists, sofindno longer suggests a workspace command that has nofind.-w <id>. The CLI's own<workspaceId>placeholder used to go through the wire-name rewording and come out as-w <--workspace>.Tests (each fails on the pre-fix code)
terminal.test.ts:resourcesandcatalog --dirread the directory's workspace and workflowcataloginside a workflow directory includes its workflow; a--dirthat names nothing reads the profile's workspace; a conflicting-wis refusedcatalog --workflow-id <name>sends the id it resolves-w <id>--jsongives a JSON error when the output setting is text--jsonelsewhere suggests--output jsonworkflow-source-find.test.ts: on a workspace directory,findpoints at the workflow folder and not at a workspace command.workflow-source-roundtrip.test.ts: a no-op apply leaves file mtimes unchanged, and a hand-edited file is still rewritten.Gates
bun run generate(regenerates the CLI reference docs) andcontent:verify-compatibility(the docs baseline records the changedresourcesusage fence)check:cli-docs,check:comment-hygiene,check:file-names,check:utils,check:explicit-any,check:test-patternsNo change to the CLI chat primer text.