Skip to content

Share One GraphQL Transport and Cursor Walker Between pr_review.py and handoff.py - #2914

Merged
ptr727 merged 4 commits into
developfrom
feature/graphql-walker
Oct 12, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/graphql-walker

Conversation

@ptr727

@ptr727 ptr727 commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/gh_graphql.py, one GraphQL transport (request, raising GraphQLError, never exiting) and one cursor walker (walk, connection path as a parameter).
  • pr_review.py keeps its exit 1 and messages by mapping GraphQLError to its existing SystemExit. handoff.py maps it to Execution, exit 2.
  • No new exit code. All existing tests pass unchanged. Added tests/test_gh_graphql.py and 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 null pullRequest now 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 carrying errors, or lacking pageInfo.hasNextPage, is now exit 2, where it used to answer from the rows it had.

Closes #2903

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 12, 2026 13:47
…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>
Copilot AI lite review requested due to automatic review settings October 12, 2026 20:50
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6295bd8-e203-4455-a536-5215c546bda9

  • 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.

🟡 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.

Comment thread scripts/gh_graphql.py Outdated
Comment thread scripts/gh_graphql.py
Comment thread scripts/handoff.py
ptr727 and others added 2 commits October 12, 2026 13:57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

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

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.22642% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@26b8da7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
scripts/pr_review.py 86.66% 2 Missing ⚠️
scripts/gh_graphql.py 98.59% 1 Missing ⚠️
scripts/handoff.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2914   +/-   ##
==========================================
  Coverage           ?   60.00%           
==========================================
  Files              ?       17           
  Lines              ?     8773           
  Branches           ?        0           
==========================================
  Hits               ?     5264           
  Misses             ?     3509           
  Partials           ?        0           
Flag Coverage Δ
python-3.13 60.00% <96.22%> (?)

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 f490a81 into develop Oct 12, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/graphql-walker branch October 12, 2026 21:10
ptr727 added a commit that referenced this pull request Oct 12, 2026
…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)
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