Repository navigation
Conversation
…commands (#3626) ## Summary Implements #3496. The promotion pull request carries the closing line. `FLAG_OWNERS` refuses a flag on a subcommand that does not own it, since an ignored flag reads as one that took effect. Five flags read only by `wait`, or by `status` and `wait`, were missing from it, so every other subcommand accepted them silently. - `--timeout`, `--min-rounds`, and `--ignore-quota-signal` get rows owned by `wait`. - `--check-grace` and `--check-stall` get rows owned by `status` and `wait`. The issue left these two out because `status` reads them too. The table already takes more than one owner, so they close the same defect on `claims`, `attest`, `comment`, and `reply`. 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_first` pins 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 as `status --timeout 2700` is refused too. The defaults are filled in right after that check, before the negative-value and grace-versus-stall checks that read them. So `status` and `wait` see the same values as before. ## Verification - `python -m unittest discover -s tests` ran 3084 tests, OK (skipped=7). - New cases refuse each wait-only flag, at its default value, on `status`, `reply`, `comment`, `claims`, and `attest`. They refuse each threshold on `reply`, `comment`, `claims`, and `attest`. They also pin what `wait` reads: 2700, 0, and the two threshold constants when the flags are left off. Explicit values pass through unchanged. - ruff format, ruff check, mypy, and `prose_lint.py --diff` are clean. - The local strict review ran two rounds at the `frontier` tier. 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](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are present, and the change includes targeted ownership-validation logic with regression coverage for rejection diagnostics and preserved defaults.
No open issues 🎉
What changed in this PR
This pull request promotes stricter flag-ownership validation for pr_review, ensuring wait-only and check-threshold options are rejected when used with unrelated subcommands instead of being silently ignored.
Changes:
- Adds ownership rules for wait-only flags and status/wait check-threshold flags.
- Defers parser defaults until after ownership validation.
- Adds regression coverage for rejected flags, diagnostics, and preserved
waitdefaults.
| File | Description |
|---|---|
tests/test_pr_review.py |
Tests foreign-flag rejection, ownership diagnostics, and preservation of wait defaults. |
scripts/pr_review.py |
Enforces flag ownership and restores deferred defaults after validation. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3627 +/- ##
=======================================
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:
|
Promotes the #3496 flag-ownership rows from
developtomain.Closes #3496
🤖 Generated with Claude Code