fix(cli): allow scan options during interactive bulk discovery - #175
fix(cli): allow scan options during interactive bulk discovery#175dipeshbabu wants to merge 1 commit into
Conversation
a8e97d5 to
0ba7351
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8e97d5014
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (args.input === undefined) { | ||
| let optionIndex = 1; | ||
| while (optionIndex < argv.length) { | ||
| const argument = argv[optionIndex]!; | ||
| if ( | ||
| argument === "--model" || | ||
| argument === "--effort" || | ||
| argument === "--codex" | ||
| ) { | ||
| optionIndex += 2; | ||
| } else if ( | ||
| argument.startsWith("--model=") || | ||
| argument.startsWith("--effort=") || | ||
| argument.startsWith("--codex=") | ||
| ) { | ||
| optionIndex += 1; | ||
| } else { | ||
| break; | ||
| } | ||
| } | ||
| if (argv[0] !== "bulk-scan" || optionIndex !== argv.length) { | ||
| if (options.outputDir !== undefined) { |
There was a problem hiding this comment.
Keep prefixed bulk scans behind the container guard
When the customer image is invoked with a global Incur option before the command, such as docker run -it … --format toon bulk-scan --workers 8, docker/entrypoint.sh:5-10 misses the command because it only checks whether $1 is bulk-scan. This replacement validation only rejects --output-dir, so the invocation now reaches runBulkScanWizard; the removed argv[0] check previously rejected it. With a gh executable/auth made available to the container, this enables the interactive discovery flow that the entrypoint explicitly prohibits. Either locate bulk-scan after supported global options in the entrypoint or retain an equivalent CLI-side container guard.
Useful? React with 👍 / 👎.
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
--workers,--mode,--max-attempts,--plugin-path, and--pythonwhen starting interactive bulk-scan discovery--output-dir, which belongs to CSV-driven bulk scans because the discovery wizard selects its own destination--option=valueformsRoot cause
The command schema parsed all bulk-scan options correctly, and the scan runner consumed them after discovery. A second hand-written argv whitelist admitted only
--model,--effort, and--codex, so other valid options failed before the wizard started.Impact
Interactive discovery can now use the same concurrency, mode, retry, plugin, and Python settings as CSV-driven bulk scans. CSV behavior is unchanged.
Overlap check
Open issues and pull requests were reviewed, followed by repository-wide searches for interactive bulk-scan options, workers, retries, plugin paths, and Python configuration. No active issue or pull request overlaps this fix. Issue #45 concerns Docker option ordering with an explicit CSV, and PR #124 is documentation-only.
Validation
pnpm dlx bun test --timeout 30000 ./tests-ts/cli.test.ts— 85 passedpnpm exec tsc --noEmitpnpm exec prettier --check src/cli.ts tests-ts/cli.test.tsgit diff --check