Repository navigation
Give the pr_review Readers One Accessor Each for Commit Oid, Page Info, and Head Reviews - #3624
Conversation
…o, and Head Reviews The readers spelled three payload accessors out at each site. This adds `commit_oid`, `page_flag`, and the `head_nodes` filter to `pr_review_rounds.py` and moves every lenient site onto them, in the rounds, checks, and digest readers and in `pr_review.py`. The strict `pr["reviewThreads"]["nodes"]` reads are unchanged, so a malformed payload still ends the run. `head_commit` collapses onto `commit_oid`, which keeps `pr_review_checks.py` under its ceiling with the new import. Closes #3460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The local strict review found one lenient site the first commit missed, spelled with single quotes in `render`'s round notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟢 Approval recommended
No active issues were identified, and the refactor preserves strict/lenient behavior and explicit pagination while consolidating repeated payload access.
No open issues 🎉
What changed in this PR
This pull request centralizes repeated payload access in the pr_review reader modules while preserving existing strict and lenient behavior.
Changes:
- Adds shared
commit_oid,page_flag, andhead_nodesaccessors. - Migrates repeated commit, pagination, and head-review reads to the shared accessors.
- Reuses the accessors across review, digest, and check processing.
- Preserves strict review-thread reads and explicit pagination behavior.
| File | Description |
|---|---|
scripts/pr_review.py |
Uses commit_oid when reading refusal commit identifiers. |
scripts/pr_review_rounds.py |
Defines and applies the shared payload accessors. |
scripts/pr_review_digest.py |
Uses shared commit and head-review readers during digest rendering. |
scripts/pr_review_checks.py |
Reuses shared commit and pagination readers for check processing. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3624 +/- ##
========================================
Coverage 81.60% 81.61%
========================================
Files 26 26
Lines 9070 9073 +3
========================================
+ Hits 7402 7405 +3
Misses 1668 1668
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:
|
Summary
Implements #3460. The promotion pull request carries the closing line.
The
pr_reviewreaders spelled three payload accessors out at each site. This adds one definition each toscripts/pr_review_rounds.pyand moves every lenient site onto them.commit_oid(node)reads a node's commit oid, or None where the payload names none.page_flag(pr, field, key)reads onepageInfoflag of a connection, false where absent.head_nodes(pr, nodes)filters nodes to those carrying the current head's commit.Each strict
pr["reviewThreads"]["nodes"]read is unchanged, so a malformed payload still ends the run. Two sites stay as they are on purpose.head_review_doneneeds each review's position, so it usescommit_oidrather than the filter.page_filesfollows a cursor only on an explicitTrue, which is stricter thanpage_flag.pr_review_checks.pynow imports the accessors frompr_review_rounds.py, an edgeREADER_IMPORTSalready allows.head_commitcollapses ontocommit_oid, which leaves the file at 444 lines, under its 450 ceiling.Verification
python -m unittest discover -s testsran 3081 tests, OK (skipped=7).mainwas wrapped, and thetest_pr_review*suites ran on the base tree and on this branch. Both runs made 10608 calls. Once wall-clock timestamps and the snapshot directory name are normalized, every return value and printed output is identical.on_headandrenderholds a local of that name. It is nowhead_nodes.frontiertier. Round one found one missed single-quoted site inrender, fixed in the second commit. Round two found nothing.🤖 Generated with Claude Code