Repository navigation
Conversation
…o, and Head Reviews (#3624) ## Summary Implements #3460. The promotion pull request carries the closing line. The `pr_review` readers spelled three payload accessors out at each site. This adds one definition each to `scripts/pr_review_rounds.py` and 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 one `pageInfo` flag 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_done` needs each review's position, so it uses `commit_oid` rather than the filter. `page_files` follows a cursor only on an explicit `True`, which is stricter than `page_flag`. `pr_review_checks.py` now imports the accessors from `pr_review_rounds.py`, an edge `READER_IMPORTS` already allows. `head_commit` collapses onto `commit_oid`, which leaves the file at 444 lines, under its 450 ceiling. ## Verification - The unit suite passes unchanged: `python -m unittest discover -s tests` ran 3081 tests, OK (skipped=7). - The refactor's behavior was recorded rather than inferred. Every touched function plus `main` was wrapped, and the `test_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. - That harness caught a name collision in an earlier draft, where the filter was called `on_head` and `render` holds a local of that name. It is now `head_nodes`. - The local strict review ran two rounds at the `frontier` tier. Round one found one missed single-quoted site in `render`, fixed in the second commit. Round two found nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- 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.
|
There was a problem hiding this comment.
🟢 Approval recommended
The review records no active issues, with the described refactor centralizing payload traversal while retaining strict reads and pagination.
No open issues 🎉
What changed in this PR
This pull request promotes the pr_review accessor refactor from develop to main, reducing duplicated GraphQL payload traversal while preserving existing strict-read and pagination behavior.
Changes:
- Adds shared
commit_oid,page_flag, andhead_nodesaccessors. - Updates review, digest, and check readers to use the shared accessors.
- Preserves strict
reviewThreads["nodes"]handling and cursor pagination.
| File | Description |
|---|---|
scripts/pr_review.py |
Uses commit_oid when examining refusal causes. |
scripts/pr_review_rounds.py |
Defines shared payload accessors and migrates review logic to them. |
scripts/pr_review_digest.py |
Uses shared commit and head-review accessors during digest rendering. |
scripts/pr_review_checks.py |
Reuses shared commit and pagination accessors for check rollups. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3625 +/- ##
=======================================
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:
|
Promotes the #3460 reader accessors from
developtomain.Closes #3460
🤖 Generated with Claude Code