Repository navigation
Move wait Out of pr_review.py's main and Check Subcommand Flags From a Table - #3497
Conversation
…a Table main is now parsing and dispatch. The wait body moves into run_wait unchanged. Flag ownership is read from FLAG_OWNERS, checked in two passes around the cleanup and number checks, so a command line with several bad flags names the same one first. The four negative-value checks are one loop. Over 1904 bad command lines, the first error printed and the exit are identical before and after, and a new case pins the multi-flag order. Closes #3458 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ents COMMANDS is now the parser's choices and the set the owner test reads, so a renamed subcommand fails the test. The table comment claims only the flags it lists, and the negative-value comment names its four. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
COMMANDS had landed between the table's comment and the table, so the comment read as describing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
The unresolved review comment requests moving COMMANDS outside the FLAG_OWNERS comment block to correct the table documentation.
1 open issue
What changed in this PR
This pull request refactors pr_review.py to separate argument parsing and dispatch from the wait workflow while preserving CLI behavior and validation order.
Changes:
- Moves the
waitimplementation intorun_wait. - Centralizes command and flag ownership validation in tables.
- Consolidates negative-value checks.
- Adds regression tests for flag validation order and ownership metadata.
- Requires moving
COMMANDSoutside theFLAG_OWNERScomment block so the table is accurately documented.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Adds regression coverage for multi-flag error ordering and ownership-table integrity. |
scripts/pr_review.py |
Extracts run_wait and introduces table-driven command and flag validation. |
Review effort: Lite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3497 +/- ##
===========================================
- Coverage 81.07% 81.07% -0.01%
===========================================
Files 26 26
Lines 8934 8928 -6
===========================================
- Hits 7243 7238 -5
+ Misses 1691 1690 -1
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:
|
…3494) ## Summary Promotes the pull requests merged into develop since release 2.0.1189. - [#3493](#3493): the digest's rendering moves out of `scripts/pr_review.py` into a new pure reader module, `scripts/pr_review_digest.py`. `digest` stays as the shell that does the reads. The `status` header is an ordered field list and the window and truncation advisories an ordered table. Output is byte-identical over every existing case, and two new cases pin a crowded and a quiet digest whole. - [#3495](#3495): `scripts/README.md` drops its incidental count of the reader modules and names `pr_review.py` as what imports them, which this promotion's first review found. - [#3497](#3497): `wait`'s body moves out of `main` into `run_wait`, and the per-subcommand flag checks are read from a `FLAG_OWNERS` table in two passes, so a new owned flag is one row. The first error printed over 1904 bad command lines is unchanged, and a case pins the multi-flag order. Closes #3457 Closes #3458 ## Constituent coverage Each change this promotion carries had coverage on its own pull request into develop: | Pull request | Merged head | Coverage | | --- | --- | --- | | [#3493](#3493) | `3eb58d60` | attested local pass at the merged head, base `develop`. A Copilot round on the earlier head `023589f8` opened one finding, fixed in `3eb58d60` and resolved, so no Copilot round covers the merged head | | [#3495](#3495) | `aab59769` | attested local pass at the merged head, base `develop`, and a Copilot table on the merged head naming exactly its 1 changed file, no open findings | | [#3497](#3497) | `2ca2e75d` | attested local pass at the merged head, base `develop`. A Copilot round on the earlier head `d145242d` opened one finding, already fixed in `2ca2e75d` and resolved, so no Copilot round covers the merged head | 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
Implements #3458 (the closing keyword goes on the promotion pull request).
waitbody moves out ofmainintorun_wait(owner, repo, a), unchanged, somainis parsing and dispatch.FLAG_OWNERS, one row of(flag, owners, late)per flag, checked in two passes around thecleanupandnumberchecks so a command line with several bad flags names the same one first. Listingcleanupamong--checkout's owners lets the error text be the owners joined, and thecleanupcheck right after it still refuses that command.COMMANDSis the parser's choices, and the owner test reads it.Verification
test_a_command_line_with_two_bad_flags_names_the_same_one_firstpins six multi-flag orderings, and passes against the pre-change code as well.python -m unittest discover -s tests, 2965 tests, 7 skipped. Ruff, mypy, and the pre-commit hook are clean.introducedfindings, each fixed ind145242d. Round 2 raised one,COMMANDSlanding between theFLAG_OWNERScomment and the table, which the second push fixed in2ca2e75d. Its own pass raised none.Pre-existing findings, filed
--timeout,--min-rounds, and--ignore-quota-signalare still accepted silently on subcommands other thanwait: Refuse the Wait-Only Flags on Other pr_review Subcommands #3496.The
commentslabel is applied for the new table and loop comments.🤖 Generated with Claude Code