Repository navigation
Share One GraphQL Transport and Cursor Walker Between pr_review.py and handoff.py - #2914
Conversation
…d handoff.py The transport raises GraphQLError and never exits, and the walker takes the connection path as a parameter. pr_review.py maps a failure to its existing SystemExit message, and handoff.py maps it to Execution, exit 2. Closes #2903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. ⚙️ Run configuration
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. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
Transport failures can still escape the intended error mapping or lose the GraphQL error details.
3 open findings
What changed in this PR
This PR shares GraphQL request and pagination code between the review and handoff scripts while keeping each script's exit codes.
Changes:
- Adds a shared GraphQL transport and cursor walker.
- Moves both scripts onto the shared code and adds failure-path tests.
| File | Description |
|---|---|
tests/test_handoff.py |
Tests handoff GraphQL failures. |
tests/test_gh_graphql.py |
Tests the shared transport and walker. |
scripts/README.md |
Documents the new library and tests. |
scripts/pr_review.py |
Uses the shared transport and walker. |
scripts/handoff.py |
Adapts handoff reads to the shared code. |
scripts/gh_graphql.py |
Implements the shared transport and walker. |
🧠 Review effort: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2914 +/- ##
==========================================
Coverage ? 60.00%
==========================================
Files ? 17
Lines ? 8773
Branches ? 0
==========================================
Hits ? 5264
Misses ? 3509
Partials ? 0
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:
|
…t Citation Fixes to Main (#2919) - #2910 reads the open handoff chain through `handoff.py tracks --json` in the `session-handoff` and `unattended-handoff` skills, not the search index - #2913 names the shared stash in the GOVERNANCE.md write-safety law and the host-wide agent-safety block - #2914 shares one GraphQL transport and cursor walker between `pr_review.py` and `handoff.py` - #2911 states the no-`push` condition in D4.1 and drops the `!= 'schedule'` form from the audit - #2918 lets a comment cite a contract section without echoing it, and cites the Concurrency exceptions by number Closes #2902 Closes #2900 Closes #2903 Closes #2904 Closes #2907 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
scripts/gh_graphql.py, one GraphQL transport (request, raisingGraphQLError, never exiting) and one cursor walker (walk, connection path as a parameter).pr_review.pykeeps its exit 1 and messages by mappingGraphQLErrorto its existingSystemExit.handoff.pymaps it toExecution, exit 2.tests/test_gh_graphql.pyand a handoff test that a transport failure exits 2 (the "errors beside rows" case fails on the old code, which answered from the rows).Intended behavior changes
pr_review.py: a nullpullRequestnow ends in a clean exit 1 with a message, where it used to raise a traceback.pr_review.py: a page claiming another without an advancing cursor now ends in a clean exit 1, where it used to loop forever.handoff.py: a response carryingerrors, or lackingpageInfo.hasNextPage, is now exit 2, where it used to answer from the rows it had.Closes #2903
🤖 Generated with Claude Code