You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move wait Out of pr_review.py's main and Check Subcommand Flags From a Table #3458
main in scripts/pr_review.py holds the argparse setup, the per-subcommand flag checks, and the whole wait body. That body is the Copilot poll, the held poll, and the exit sequence, about three hundred lines. Roughly seven flag checks there each test by hand whether a flag belongs to the subcommand it was given with, and four more reject a negative number one at a time.
Suggested Change
Move the wait body into run_wait(owner, repo, a) -> int inside pr_review.py, which leaves main as parsing and dispatch.
Check flag ownership from a table of (flag, attr, owners, owners_text). owners_text is stored as data because one message names more subcommands than the check passes.
Reject negative values in one loop over the numeric flags.
Keep the first error argparse prints the same for a command line carrying several bad flags. Today the cleanup and number checks sit between the flag checks, so the table needs two passes around them.
Done When
Every existing CLI test passes unchanged, a new flag that belongs to one subcommand is one table row, and a case with two bad flags still prints the same first error.
Activity
Split pr_review.py's Check and Round Readers Into Leaf Modules (#3462)
Move wait Out of pr_review.py's main and Check Subcommand Flags From …
Promote the Digest Render Leaf and the Flag-Ownership Table to Main (#…