Repository navigation
fix(cli): refuse a mistyped --root in five more commands (#14548) - #14622
effortlessg41[bot] wants to merge 1 commit into
Conversation
policy readiness, policy waiver-aging, pr-comments plan, reports index and reports ci-summary now call the shared ensure_command_root validator right after option parsing, so a missing or file --root exits 2 instead of being created or written through. Extends mistyped_root_is_refused_and_not_created to all eight commands.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
VERDICT: APPROVE 4f9305d — no blocking findings on this head.
reviewed_head_sha: 4f9305d
base: e9f76b7
Duplicate candidate (non-blocking, for the orchestrator)
This head is the same production change as open #14616 at 517511fa8f31e2ab3665c0a2a095c9251ba74100: both add ensure_command_root to policy readiness, policy waiver-aging, pr-comments plan, reports index and reports ci-summary at the same call sites, and both extend mistyped_root_is_refused_and_not_created to eight commands. The body's "five more commands" and "Proposed replacement of PR: none" are inaccurate; these are the same five commands named in #14548, already covered by #14616. #14616's test is stronger: it runs each command with current_dir = scratch and asserts no target/ was written, while this head uses run_ripr (inherits the harness CWD) and only checks the mistyped root. The orchestrator should pick one vehicle; if this app-authored head is the intended native-approval mirror, the body should say so.
What I inspected
- Diff at
4f9305df: five call sites, each after option parsing and before the first read or write —crates/ripr/src/cli/commands.rs:637(pr-comments plan),crates/ripr/src/cli/commands/ci_summary.rs:30(reports ci-summary),crates/ripr/src/cli/commands/policy/reports.rs:31(policy readiness) and:323(policy waiver-aging),crates/ripr/src/cli/commands/reports.rs:53(reports index). ensure_command_rootincrates/ripr/src/cli/commands_context.rs: the generic refusal is"{command_name} root {path} is not a directory; pass the directory that contains the workspace ...", so the test's"{name} root {path} is not a directory"substring matches and exit 2 is the existingErrpath. The Windows stripped-component branches are unchanged.- The five parsers (
policy/parse.rs,commands_options.rs,commands.rs,reports.rs,ci_summary.rs) only format paths;CiSettings::from_envreads env andGITHUB_EVENT_PATHonly. No write precedes the gate. crates/ripr/tests/cli_smoke.rs: the test now covers eight commands, both a missing nested root and a file root, asserts exit 2 and the exact message, and checks the file content is untouched.- Issue #14548: the five commands and the acceptance match the issue.
- Checks at this head: CodeRabbit, GitGuardian and Graphite only; no hosted Rust gate.
Not checked
No build or test run (read-only beat); the red/green claim is the author's local GNU-toolchain evidence. MSVC/CI parity and the workspace-wide gates are not established on this head. I did not verify whether the duplicate is intentional.
No checkout, no label, no branch change.
|
Closing as a duplicate of #14616. #14616 is the intended landing for #14548. It predates this PR (opened 20:45Z, this one 21:2x), covers the same five call sites with the same #14616 is also the only one of the two that can be admitted: it is authored by a MEMBER account and carries Not armed, no One difference worth carrying over: this PR adds |
|
Closing as a duplicate of #14616. #14616 (head Two corrections to this PR's description, for the record:
Review 5898248749 approved this head and found the production change correct, so the work is not lost; it lands through #14616. Reopen if #14616 is withdrawn. |
Summary
policy readiness,policy waiver-aging,pr-comments plan,reports indexandreports ci-summarynow call the sharedensure_command_rootvalidator immediately after option parsing, before any write.--rootor a file--rootis refused with exit 2 and the shared"<command> root <path> is not a directory"message instead of exiting 0 and creating a directory tree.mistyped_root_is_refused_and_not_createdis extended from 3 to 8 commands; it failed on all five before the fix and passes after.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: n/a — no spec covers the #14222 root-validation contract; SPEC-0188 covers only Windows trailing-component disclosure and its entry-point list is already non-exhaustive
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #14548 (follow-up to #14222, fixed for three commands in #14322)
Acceptance delta (one sentence): the five named commands refuse a missing or file
--rootwith exit 2, a message, and no filesystem change.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
fix/14548-mistyped-root-five-commandsStack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a
Scope
ensure_command_rootto the five commands named in Refuse a mistyped --root in five more commands (policy readiness, policy waiver-aging, pr-comments plan, reports index, reports ci-summary) #14548, at the same position the fix(cli): refuse a mistyped --root in reports ci-packet and feedback (#14222) #14322 fix used: after option parsing, before the first read or write.Scope Classification
This PR is scoped by:
Production delta:
ripr checkand the fix(cli): refuse a mistyped --root in reports ci-packet and feedback (#14222) #14322 commands already use.Evidence/support delta:
crates/ripr/tests/cli_smoke.rs::mistyped_root_is_refused_and_not_createdcovers 8 commands (was 3).changelog.d/14548-mistyped-root-five-commands.md.Single acceptance criterion:
Non-goals:
ensure_command_rootitself, to the other commands that already use it, or to the Windows trailing-component wording.Support-tier Impact
docs/status/SUPPORT_TIERS.mdClaim/proof notes:
Policy Impact
Ledger or exception notes:
Proof
Result, failures, or skipped proof:
1 passed; 0 failed, exit 0, on head4f9305df96fe91a7f278a9649b96f0b4d3dd3890rebased ontoe9f76b76.cargo check -p riprexit 0 with 5 pre-existinglsp/backend.rsdead-code warnings.rustfmt --checkexit 0 on the five changed files.cargo fmt --checkitself fails on this box with OS error 206 (path too long), so rustfmt was run directly.+1.95.0-x86_64-pc-windows-gnu); CI's MSVC lanes are authoritative for anything toolchain-sensitive.Claim Boundary
What may be claimed after this PR? What must not be claimed yet?
--rooton the tested platform, with a regression test.Rollback
How can this PR be reverted safely?
Spec-Test-Code Traceability
crates/ripr/tests/cli_smoke.rs::mistyped_root_is_refused_and_not_createdcrates/ripr/src/cli/commands.rs,commands/reports.rs,commands/ci_summary.rs,commands/policy/reports.rsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
--rootsilently creating a directory tree or writing into the wrong placecli_smokeregression, extended in placeEngineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
Not run locally on this box (GNU stopgap, one heavy build at a time); CI is authoritative.
cargo fmt --checkcargo check --workspace --all-targetscargo test --workspacecargo clippy --workspace --all-targets -- -D warningscargo doc --workspace --no-depscargo package -p ripr --listcargo publish -p ripr --dry-runcargo xtask check-static-languagecargo xtask check-doc-artifactscargo xtask check-support-tierscargo xtask check-no-panic-familycargo xtask check-allow-attributescargo xtask check-local-contextcargo xtask check-file-policycargo xtask check-covered-bycargo xtask check-executable-filescargo xtask check-workflowscargo xtask check-spec-formatcargo xtask check-spec-numberingcargo xtask check-fixture-contractscargo xtask check-generatedcargo xtask check-badge-diff-policycargo xtask check-generated-cleancargo xtask check-dependenciescargo xtask check-process-policycargo xtask check-network-policyExtension changes: n/a
Closes #14548