Skip to content

Warn, naming the cause, when a merged contributor is not credited - #325

Merged
parawanderer merged 1 commit into
mainfrom
fix/contributors-missing-is-a-warning
Nov 28, 2026
Merged

parawanderer merged 1 commit into
mainfrom
fix/contributors-missing-is-a-warning

Conversation

@parawanderer

Copy link
Copy Markdown
Owner

Update contributors failed on the merges of #315, #320 and #321 (46129851532 and two others) with "lazzurs is not in the list this run generated", blamed on GitHub's stats cache. The cause was different: every non-merge commit by @lazzurs is authored from an address GitHub does not link to their account (author.login is null on all 23), and /stats/contributors only counts linked commits. They were absent from every run, the weekly one included, so a rerun could not fix it. The only linked commit is their web merge of #315, which /contributors (the repo sidebar) counts and /stats/contributors does not.

Change

  • scripts/fetch_contributors.py: an absent --expect-contributor is a ::warning title=Not credited:: annotation and exit 0, no longer exit 1. A failed run also skipped "Open a PR if anything changed".
  • linked_commits(login) counts that login's non-merge commits on the default branch via /repos/{repo}/commits?author=, and why_missing words the warning from it: 0 names the commit email and Settings > Emails, more than 0 names the stale cache, a failed lookup names both.
  • update-contributors.yml: the comment explaining the flag now describes a warning.

Tests

scripts/test/test_fetch_contributors.py, 6 new: each wording of why_missing; a merge commit does not count as linked; a failed lookup returns None instead of raising; main with an absent expected login exits 0 and prints the annotation. With return 1 put back, the last one fails.

Verified

  • 17 tests pass, flake8 and pyright clean.
  • linked_commits against the live API: lazzurs 0, ubrt 50.

Not verified

  • The annotation's appearance on a real run: that needs a merge, or workflow_dispatch, which passes no expected login.

🤖 Generated with Claude Code

The merge-triggered contributor run failed whenever the PR's author was
absent from /stats/contributors, on the theory that the stats were
cached from before the merge. For lazzurs it was never the cache: every
one of their commits is authored from an address that is not on their
GitHub account, so GitHub links none of them, they are absent from
every run including the weekly one, and each merge of theirs (#315,
#320, #321) produced a red run that a rerun could not fix. The failure
also skipped the step that opens the pull request.

It is now a ::warning:: annotation and the script exits 0. To word it,
linked_commits() asks GitHub how many of their non-merge commits on the
default branch are linked to the account (merges are left out because
the stats endpoint leaves them out, while a web-interface merge is
linked): zero names the commit email and how to fix it, more than zero
names the stale cache, and a failed lookup names both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@parawanderer
parawanderer merged commit a20d076 into main Nov 28, 2026
4 checks passed

This branch was previously deployed

1 inactive deployment
Android Build — ec38ddaa Deployed Nov 28, 2026 by parawanderer via Instrumented tests (emulator) #437
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.

1 participant