Skip to content

Share One GraphQL Cursor Walker Between pr_review.py and handoff.py #2903

Closed

Description

@ptr727

Problem

scripts/handoff.py gains a labeled() GraphQL cursor walk on branch feature/handoff-consistent-reads. scripts/pr_review.py already has one, follow() over gh_graphql(). Its docstring says it exists so "a fix to how a page is followed lands once". The two can't be shared as they stand, for two reasons:

  • gh_graphql() reports a failure by raising SystemExit with a message, which exits 1. In handoff.py, 1 means a refusal the caller can act on, and 2 means the command did not run. Importing it would report a failed read as a refusal.
  • follow() is hard-wired to ["repository"]["pullRequest"].

Fix

Pull one GraphQL transport and cursor walker into a shared module under scripts/. It should raise an exception type each caller maps to its own exit code, and it should take the connection path as a parameter. Then move both scripts onto it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions