Skip to content

Bug: TypeError crash when PR author is a deleted GitHub account (ghost user) #366

@Grizouforever

Description

@Grizouforever

Description

When a GitHub user deletes their account, the GraphQL API returns null for the author field on their PRs. The current code accesses pr_raw['author']['login'] without null-checking, causing a TypeError that crashes PR processing for the entire miner evaluation.

Affected code

  • gittensor/utils/github_api_tools.py line 929: pr_raw['author']['login'] in self-merge check
  • gittensor/utils/github_api_tools.py line 933: review['author']['login'] != pr_raw['author']['login'] in review check
  • gittensor/classes.py line 277: pr_data['author']['login'] in PullRequest.from_github_data()

Steps to reproduce

  1. A miner has a merged PR on a whitelisted repo
  2. The PR author later deletes their GitHub account
  3. Validator tries to score the miner's PRs
  4. TypeError: 'NoneType' object is not subscriptable crashes the evaluation

Expected behavior

PRs from deleted accounts should be gracefully skipped or handled with a fallback login like 'ghost'.

Actual behavior

TypeError crash stops the entire miner evaluation.

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