Skip to content

Promote Develop: Refuse the Wait-Only and Check-Threshold Flags on Other pr_review Subcommands - #3627

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 29, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Promotes the #3496 flag-ownership rows from develop to main.

  • #3626 Refuses the wait-only and check-threshold flags on other pr_review subcommands.

Closes #3496

🤖 Generated with Claude Code

…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]>
Copilot AI lite review requested due to automatic review settings October 29, 2026 20:36
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 wait defaults.
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

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.62%. Comparing base (9b5dbcf) to head (3172314).
⚠️ Report is 443 commits behind head on main.

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           
Flag Coverage Δ
python-3.13 81.62% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit d7db051 into main Oct 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refuse the Wait-Only Flags on Other pr_review Subcommands

2 participants