Skip to content

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

Merged
ptr727 merged 2 commits into
developfrom
pr-review-accessors
Oct 29, 2026
Merged

ptr727 merged 2 commits into
developfrom
pr-review-accessors

Conversation

@ptr727

@ptr727 ptr727 commented Oct 29, 2026

Copy link
Copy Markdown
Owner

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

ptr727 and others added 2 commits October 29, 2026 12:28
…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>
Copilot AI lite review requested due to automatic review settings October 29, 2026 19:32
@ptr727

ptr727 commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 29c176c545de8fc572db0852a166da1206b18326, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@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

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

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 (29c176c).

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           
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 9b5dbcf into develop Oct 29, 2026
14 checks passed
@ptr727
ptr727 deleted the pr-review-accessors branch October 29, 2026 19:46
ptr727 added a commit that referenced this pull request Oct 29, 2026
…mit Oid, Page Info, and Head Reviews (#3625)

Promotes the #3460 reader accessors from `develop` to `main`.

- [#3624](#3624) Gives the
pr_review readers one accessor each for commit oid, page info, and head
reviews.

Closes #3460

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants