Skip to content

Check for a Null GraphQL Node in the Shared Transport Rather Than per Caller #3687

Closed

Description

@ptr727

Problem

GitHub's GraphQL API can return null for an item in a nodes list that it could not resolve at read time, with no entry in errors. The fix for #3392 checks for this in scripts/pr_review.py's own gh_graphql(). A query is read again, and a null that persists ends the run naming where it sat. The check does not live in the shared transport, scripts/gh_graphql.py request(), and the other scripts using that transport guard per site or not at all:

  • scripts/pr_cleanup.py guards one connection with an isinstance(n, dict) test.
  • scripts/handoff.py guards rows through rows_of, but node["name"] for node in row["labels"]["nodes"] is unguarded and raises TypeError on a null label node.

Reproduce

Feed handoff.py's label read a row such as {"labels": {"nodes": [None, {"name": "handoff"}]}}. It raises rather than reporting.

Done when

  • The null-node check sits in one place every GraphQL caller shares, most likely gh_graphql.request() raising GraphQLError, with pr_review.py's query-only re-read kept around it.
  • The per-site guards it makes redundant are removed.
  • A unit test covers a null node through the shared transport.

Found by the local strict review on the #3392 fix, out of that change's file scope.

Activity

  1. ptr727 commented on Nov 2, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-02): PR #3816 merged to develop and its branch is deleted, so this claim holds no files. The issue closes on promotion.

    Backlog burndown claim (away run 2026-11-02, round 2, group G4). Branch: burndown/3687-graphql-null-node. Issues: #3687.

    Predicted file set:

    • scripts/gh_graphql.py, scripts/pr_review.py, scripts/pr_cleanup.py, scripts/handoff.py, scripts/backlog_metrics.py
    • tests/test_gh_graphql.py, tests/test_pr_review.py, tests/test_pr_cleanup.py, tests/test_handoff.py, tests/test_backlog_metrics.py

    Out of bounds for this group: scripts/README.md (group G1), every skill tree, .github/workflows/* and .github/actions/* (open PR #3801).

    Scope: develop only. The feature pull request carries Closes on promotion: for each issue it fully fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions