Skip to content

Move wait Out of pr_review.py's main and Check Subcommand Flags From a Table - #3497

Merged
ptr727 merged 3 commits into
developfrom
wait-out-of-main
Oct 26, 2026
Merged

ptr727 merged 3 commits into
developfrom
wait-out-of-main

Conversation

@ptr727

@ptr727 ptr727 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements #3458 (the closing keyword goes on the promotion pull request).

  • The whole wait body moves out of main into run_wait(owner, repo, a), unchanged, so main is parsing and dispatch.
  • Flag ownership is read from FLAG_OWNERS, one row of (flag, owners, late) per flag, checked in two passes around the cleanup and number checks so a command line with several bad flags names the same one first. Listing cleanup among --checkout's owners lets the error text be the owners joined, and the cleanup check right after it still refuses that command.
  • The four negative-value checks are one loop.
  • COMMANDS is the parser's choices, and the owner test reads it.

Verification

  • The first error line and the exit of 1904 bad command lines, every subcommand crossed with pairs of misplaced, negative, and malformed flags, were recorded before and after with every subprocess stubbed out, and are identical.
  • test_a_command_line_with_two_bad_flags_names_the_same_one_first pins six multi-flag orderings, and passes against the pre-change code as well.
  • The full suite passes, python -m unittest discover -s tests, 2965 tests, 7 skipped. Ruff, mypy, and the pre-commit hook are clean.
  • A local strict review ran two rounds on the first push. Round 1 raised three introduced findings, each fixed in d145242d. Round 2 raised one, COMMANDS landing between the FLAG_OWNERS comment and the table, which the second push fixed in 2ca2e75d. Its own pass raised none.

Pre-existing findings, filed

The comments label is applied for the new table and loop comments.

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 25, 2026 18:19
…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>
Copilot AI lite review requested due to automatic review settings October 26, 2026 01:24
@coderabbitai

coderabbitai Bot commented Oct 26, 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.

@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Oct 26, 2026
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>
@ptr727

ptr727 commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 2ca2e75de4fb4b45ba8ad9ead78b627523ae2e6e, the content this pull request carries at that commit against develop, and it recorded 0 findings.

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.

🟡 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 wait implementation into run_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 COMMANDS outside the FLAG_OWNERS comment 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

Comment thread scripts/pr_review.py
@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.07%. Comparing base (fb485f6) to head (2ca2e75).

Files with missing lines Patch % Lines
scripts/pr_review.py 98.66% 1 Missing ⚠️
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     
Flag Coverage Δ
python-3.13 81.07% <98.66%> (-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 162d1aa into develop Oct 26, 2026
13 checks passed
@ptr727
ptr727 deleted the wait-out-of-main branch October 26, 2026 02:11
ptr727 added a commit that referenced this pull request Oct 26, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants