Skip to content

Promote Develop: Give the pr_review Readers One Accessor Each for Commit Oid, Page Info, and Head Reviews - #3625

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 29, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Promotes the #3460 reader accessors from develop to main.

  • #3624 Gives the pr_review readers one accessor each for commit oid, page info, and head reviews.

Closes #3460

🤖 Generated with Claude Code

…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>
Copilot AI lite review requested due to automatic review settings October 29, 2026 19:46
@coderabbitai

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

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.

🟢 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, and head_nodes accessors.
  • 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

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.61%. Comparing base (487deaa) to head (9b5dbcf).
⚠️ Report is 442 commits behind head on main.

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           
Flag Coverage Δ
python-3.13 81.61% <100.00%> (+<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 12b14fe into main Oct 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give the pr_review Readers One Accessor Each for Commit Oid, Page Info, and Head Reviews

2 participants