Repository navigation
Refuse the Wait-Only and Check-Threshold Flags on Other pr_review Subcommands - #3626
Conversation
`--timeout`, `--min-rounds`, and `--ignore-quota-signal` are read only by `wait`, and any other subcommand accepted them silently. Each now has a late `FLAG_OWNERS` row owned by `wait`, so the first error printed for an existing bad command line is unchanged. The two valued flags default to None until the ownership check has read them, so an explicit default is refused too, and `wait` still reads 2700 and 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`--check-grace` and `--check-stall` are read by `status` and `wait` and were silently ignored by every other subcommand, the same defect #3496 names for the wait-only flags. Each gets a late row owned by both, with its default filled in after the ownership check, before the threshold validation that reads it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟢 Approval recommended
No active issues remain, with the change focused on flag ownership and supported by regression tests covering invalid combinations, error ordering, and preserved defaults.
No open issues 🎉
What changed in this PR
This pull request closes a command-line validation gap by rejecting wait-only and check-threshold flags on unrelated pr_review subcommands while preserving existing defaults and error ordering.
Changes:
- Adds ownership rules for timeout, round, quota, and check-threshold flags.
- Defers default assignment until after flag ownership validation.
- Adds regression tests for invalid flag combinations, error ordering, and preserved
waitdefaults.
| File | Description |
|---|---|
tests/test_pr_review.py |
Tests foreign-flag rejection, error ordering, and default propagation. |
scripts/pr_review.py |
Enforces flag ownership and restores defaults after validation. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3626 +/- ##
========================================
Coverage 81.61% 81.62%
========================================
Files 26 26
Lines 9073 9077 +4
========================================
+ Hits 7405 7409 +4
Misses 1668 1668
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…her pr_review Subcommands (#3627) Promotes the #3496 flag-ownership rows from `develop` to `main`. - [#3626](#3626) Refuses the wait-only and check-threshold flags on other pr_review subcommands. Closes #3496 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Implements #3496. The promotion pull request carries the closing line.
FLAG_OWNERSrefuses a flag on a subcommand that does not own it, since an ignored flag reads as one that took effect. Five flags read only bywait, or bystatusandwait, were missing from it, so every other subcommand accepted them silently.--timeout,--min-rounds, and--ignore-quota-signalget rows owned bywait.--check-graceand--check-stallget rows owned bystatusandwait. The issue left these two out becausestatusreads them too. The table already takes more than one owner, so they close the same defect onclaims,attest,comment, andreply.Every new row is late, so the first error printed for a command line that was already wrong stays the same.
test_a_command_line_with_two_bad_flags_names_the_same_one_firstpins that, including its--timeout 5 cleanup ...case. The four valued flags no longer carry argparse defaults. They default to None until the ownership check has read them, so an explicit default such asstatus --timeout 2700is refused too. The defaults are filled in right after that check, before the negative-value and grace-versus-stall checks that read them. Sostatusandwaitsee the same values as before.Verification
python -m unittest discover -s testsran 3084 tests, OK (skipped=7).status,reply,comment,claims, andattest. They refuse each threshold onreply,comment,claims, andattest. They also pin whatwaitreads: 2700, 0, and the two threshold constants when the flags are left off. Explicit values pass through unchanged.prose_lint.py --diffare clean.frontiertier. Round one found the threshold flags, fixed in the second commit. It also raised a style note about putting the defaults in module constants, which was declined because nothing reads them wrong today. Round two found nothing.🤖 Generated with Claude Code