Repository navigation
fix(ci): reject invalid changed-scope arguments - #120913
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:43 AM ET / 09:43 UTC. ClawSweeper reviewWhat this changesThe PR makes the CI changed-scope script treat a missing base or unknown flag as a full-scope fallback instead of silently selecting an empty CI matrix. Merge readinessKeep this PR open: current main still accepts a missing base and ignores unknown flags, while the proposed parser-boundary repair covers both paths. Exact-head CI is still in progress and the available test merge is stale. Priority: P2 Review scores
Verification
How this fits togetherCI workflows pass base and head revisions to the changed-scope script, which turns their diff into a set of test lanes. Invalid input must select conservative full coverage rather than suppressing checks. flowchart LR
A[CI workflow revisions] --> B[Changed-scope command]
B --> C[Argument parser]
C --> D{Base and flags valid?}
D -->|yes| E[Diff and lane selection]
D -->|no| F[Full-scope fallback]
E --> G[CI test jobs]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceTests +13, Other +1. Total +14 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep validation at the parser boundary so malformed calls take the existing conservative fallback, then validate the refreshed merge candidate against current main. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: current main leaves a missing base empty and ignores unknown flags, then converts the empty path result into an empty CI scope. Is this the best way to solve the issue? Yes. Parser-boundary validation funnels both malformed forms through the existing full-scope catch path while leaving valid empty diffs unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7b435825b947. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
9c4f419 to
1dd8074
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
1dd8074 to
f3b7be4
Compare
f3b7be4 to
aca8605
Compare
Punchcard-Session: frost-willow-valley-xh
3c75946 to
e98997e
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Consolidate base/head option handling and preserve full-scope error routing. Retain current main routing and prove malformed inputs plus valid empty diffs through the real zero-install command. Co-authored-by: qingminlong <[email protected]>
|
Reviewed and improved the existing owner-boundary repair at @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head CI is now green for The latest ClawSweeper review has no source findings. Its current-main rank-up is addressed by a clean merge-tree against |
|
Merged via squash.
|
* fix(ci): reject invalid changed-scope arguments Punchcard-Session: frost-willow-valley-xh * test(ci): distinguish full and fast scope fallbacks --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: qingminlong <[email protected]>
What Problem This Solves
Malformed changed-scope CLI calls silently selected an empty CI matrix. Missing
--basebecame an empty changed-path list; unknown options were ignored.Why This Change Was Made
Validate arguments at the existing parser boundary so malformed calls reach the established full-scope error handler. Consolidating the duplicated base/head branches keeps the repair at one owner, with no new validation layer. Valid empty diffs still select no checks, and the PR merge-head first-parent path retains its current behavior.
This intentionally spends full CI capacity when an invocation is malformed instead of reporting success while skipping coverage. All three workflow invocation branches already supply a base and head, so normal CI calls retain their selection behavior. Production delta: +9/-8 (net +1); tests: +79/-66 (net +13, mostly indentation from extending the existing fixture table). The remaining production line supports the required-base/unknown-option contract after merging the duplicate option branches.
User Impact
CI configuration mistakes produce conservative coverage and a diagnostic instead of a successful no-op. Thanks @qingminglong.
Evidence
node scripts/ci-changed-scope.mjsinvocations with--head HEADor--base HEAD --head HEAD --mysteryexited successfully and wroterun_node=falsewithchanged_paths_json=[].run_node=trueandchanged_paths_json=null. Valid--base HEAD --head HEAD, with and without--merge-head-first-parent, still write empty scope.node scripts/check-changed.mjs -- scripts/ci-changed-scope.mjs src/scripts/ci-changed-scope.test.tscompleted successfully, including core test types, script/core lint, all dead-export scans and dependency/boundary guards. The temp-directory report emitted existing-main advisory findings and passed.Provenance: commit
59567a8c5dcbintroduced the permissive script parser, but empty-path execution still selected full scope then. The inspected raw-parent patch forda9700903c72changed that empty path to the no-op scope and made malformed invocations skip coverage. The fix restores argument validation without removing the useful valid-empty-diff optimization.Published head:
0467784ede926f51b9331dc7e7acae507fd4db49. Hosted CI is running; it must pass before landing.