Skip to content

Fix NoneType error in render script for null GitHub pinned item nodes - #20

Draft
dfm with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-with-copilot
Draft

Fix NoneType error in render script for null GitHub pinned item nodes#20
dfm with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-with-copilot

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The scripts/render script crashes with TypeError: 'NoneType' object is not subscriptable when the GitHub GraphQL API returns edges with null nodes (e.g., deleted/private pinned repos).

  • Filter null nodes: Skip edges where node is None before iterating over pinned repos
  • Guard null fields: Handle None description fields in format_repo by defaulting to empty string, since GitHub repos can have no description set
# Before
repos = repos["data"]["user"]["pinnedItems"]["edges"]

# After
repos = [
    r
    for r in repos["data"]["user"]["pinnedItems"]["edges"]
    if r.get("node") is not None
]

Filter out edges with null nodes from pinned items before processing,
and handle None description fields gracefully in format_repo.
Copilot AI changed the title [WIP] Fix issue with Copilot in cv actions Fix NoneType error in render script for null GitHub pinned item nodes Jul 28, 2026
Copilot finished work on behalf of dfm July 28, 2026 10:30
Copilot AI requested a review from dfm July 28, 2026 10:30
@dfm

dfm commented Jul 28, 2026

Copy link
Copy Markdown
Owner

@copilot Which repo is causing the issue?

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Which repo is causing the issue?

I can't determine the exact repo from the available data. The committed data/repos.json is stale — it contains all 6 valid nodes. The null node only appeared in the freshly fetched data during the CI run (when scripts/update-github-repos calls the GraphQL API), and that data wasn't persisted.

The most likely cause: the GraphQL query uses ... on Repository inline fragment inside pinnedItems. If a pinned item references a repo that was deleted, transferred, or made private/inaccessible to the API token, the API returns "node": null for that edge. The repos owned by other orgs (jax-ml/jax, exoplanet-dev/exoplanet, daft-dev/daft) would be the most likely candidates if access changed.

You could check by running the GraphQL query manually with your token to see which edge currently returns null.

Logs the full GraphQL response and checks each pinned item edge for
null/empty nodes and missing fields, to help diagnose the CI failure.
Copilot finished work on behalf of dfm July 30, 2026 12:25
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