Skip to content

fix(github): preserve bot classification across collection paths - #9387

Merged
klesh merged 1 commit into
apache:mainfrom
fs24-chrter:fix/github-bot-classification
Nov 14, 2026
Merged

klesh merged 1 commit into
apache:mainfrom
fs24-chrter:fix/github-bot-classification

Conversation

@fs24-chrter

@fs24-chrter fs24-chrter commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation.
  • I have added relevant tests.
  • I have added relevant documentation.
  • I will add labels to the PR, such as pr-type/bug-fix, pr-type/feature-development, etc.

Summary

This PR fixes GitHub bots being incorrectly classified as human accounts when collecting data through REST and GraphQL.

  • GraphQL: Requests __typename to distinguish bots from users reliably. Previously, the decoder could populate both fragments and cause bots to be treated as users.
  • REST: Adds [bot] to usernames when GitHub explicitly returns type: "Bot", including aliases such as Copilot. This preserves bot detection during account conversion.
  • Across repositories: Keeps bot classification intact when different repositories and collection methods update the same account, using its numeric GitHub ID.
  • Regression coverage: Adds unit and end-to-end tests for decoder behavior, REST aliases, historical data, and repeated conversion across repositories.

Does this close any open issues?

Closes #9385

@klesh klesh 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.

LGTM
Thanks for your contribution

@klesh
klesh merged commit c6eab87 into apache:main Nov 14, 2026
10 checks passed
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.

[Bug][GitHub] Bot reviewers are classified as human after GraphQL and REST comment collection

2 participants