Repository navigation
fix(cli): write the workflow for init --workflow without --ci - #155
KrasimirKralev wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: ready, awaiting a maintainer decision. What this changesMakes init --workflow <path> generate a workflow without --ci and documents the flag. Example: Run plugin-inspector init --workflow ci/inspect.yml.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision This PR addresses a current CLI failure with a focused, correct patch; the area owner should decide whether --workflow should imply workflow generation. Priority: P2 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe CLI translates init arguments into the existing initializer, which reads plugin metadata and writes starter config and optional workflow files. flowchart LR
A[Plugin author] --> B[Init CLI arguments]
B --> C[Existing initializer]
D[Plugin metadata] --> C
C --> E[Config and workflow files]
C --> F[Written file summary]
Technical reviewBest possible solution: Let the init owner choose the standalone --workflow contract, retaining this minimal CLI change if implicit generation is approved. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically drops the workflow destination without --ci, and the contributor supplies matching before/after CLI output; no target code was run during this read-only review. Is this the best way to solve the issue? The patch is the smallest complete implementation of implicit generation: it changes argument translation while reusing the existing writer, but the owner should approve that semantic choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 09b4129b8924. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 6, 2026, 7:00 AM ET / 12:00 UTC. |
fdb9f0f to
ae5a2b3
Compare
What Problem This Solves
Fixes:
plugin-inspector init --workflow <path>exits 0 and writes no workflow unless--ciis also passed.runInitreads--workflow, butwritePluginInspectorInitonly honours it whenciis true. The flag is also missing from--helpand the README, so nothing tells the user it depends on--ci.--ciwithout--workflowstill writes.github/workflows/plugin-inspector.yml, plaininitstill writes only the config, andwritePluginInspectorInit'sciandworkflowPathoptions are unchanged. No workflow content, overwrite protection or report output changed.User Impact
A plugin author who runs
init --workflow ci/inspect.ymlgets the workflow at that path, or awould write ci/inspect.ymlline with--dry-run. Before, they saw a clean exit and only learned the file was missing when CI never ran.--workflownow appears in theinitusage line and the README.Behavior note: a command that passed
--workflowwithout--ciused to write only the config and now also writes the workflow. An existing file at that path is protected by the same--forcecheck as--ci.Why This Change Was Made
runInittreats--workflowas also asking for the workflow (ci: commandArgs.includes("--ci") || commandArgs.includes("--workflow")). The usage line, README and CHANGELOG name the flag.src/init.jsresolvesworkflowPathonly whenoptions.ci === true, so a path with nociis dropped without a message.inittests always pass--ci. A newtest/cli.test.jscase runs--workflowwithout--ci, in dry-run and for real, and asserts the file lands at that path and not at the default path. It fails with thesrc/cli.jschange reverted (1 fail, 5 pass in theinit commandgroup) and the full suite is green on the branch (938 of 938).Evidence
init --workflow <path>without--cisilently wrote no workflow.package.jsonandopenclaw.plugin.json.node src/cli.js init --workflow ci/inspect.yml, then with--dry-run, thennode src/cli.js init --help, on base and on this branch.node src/cli.js init --workflow ci/inspect.ymlnow writes the workflow at that path and says so, in both modes;--helplists the flag.CRABPOT_PLUGIN_INSPECTOR_CLI=source CRABPOT_PLUGIN_INSPECTOR_DIR=<checkout> npm run plugin-inspector:smokeat crabpot497e477with every plugin submodule checked out reports statusfailwith 35 breakages on bothupstream/mainand this branch, so this change does not move it. Crabpot's scripts and tests do not callplugin-inspector init.--resources,--retirements, packed package), and running a generated workflow on GitHub Actions; the workflow text is unchanged.