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
Render pr_review.py's Digest From a Pure Leaf and Build Its Header From a Field List #3457
digest in scripts/pr_review.py is the gate's largest function. It builds the status header by chaining conditional string pieces, about eight of them as + (... if x else ""), and each new header field has been added the same way. It also renders its fixed advisory lines (the window, truncation, and blindness notes) as separate if cond: lines.append(...) blocks. The check lines already moved to check_lines in scripts/pr_review_checks.py, keyed by a table.
Suggested Change
Keep digest in pr_review.py as a thin shell. Tests patch it there, and it is where the reads happen: full_read, check_nodes, and confirmed_quota when a refusal is present.
Move the rendering into a pure render in a new leaf module, which takes those results as arguments, makes no call, and never imports the gate.
Build the header from an ordered list of (key, value) pairs joined by one space, so a new field is one entry.
Render the fixed advisory lines from an ordered table of (value, template), in the order they print today.
Done When
The status and wait output is byte-identical over the existing fixtures, a test pins that equality, and adding a header field is a one-line change.
Activity
Split pr_review.py's Check and Round Readers Into Leaf Modules (#3462)
Render pr_review's Digest From a Pure Leaf Module (#3493)
Promote the Digest Render Leaf and the Flag-Ownership Table to Main (#…