Skip to content

Improve GitHub identity resolution: bulk commit-list scan instead of per-email filter - #204

Merged
clickmatos merged 1 commit into
mainfrom
improve-github-identity-resolution
Aug 27, 2026
Merged

Improve GitHub identity resolution: bulk commit-list scan instead of per-email filter#204
clickmatos merged 1 commit into
mainfrom
improve-github-identity-resolution

Conversation

@clickmatos

Copy link
Copy Markdown
Contributor

Summary

Improves the data collection behind #202/#203 (group/split Hyper Engineers by resolved GitHub identity) — the user asked whether we can reduce how often someone ends up "unidentified" in the first place, rather than only handling it better once it happens.

Root cause: iris/cli.py's per-email resolution (gh api repos/{repo}/commits?author=<email>&per_page=1) misses real matches. Verified live, against RocketBus/iris itself:

$ gh api "repos/RocketBus/iris/commits?since=<90d-ago>&per_page=100" --paginate \
    -q '.[] | select(.author.login != null) | "\(.commit.author.email)\t\(.author.login)"'
...
renato.guimaraes@clickbus.com	renatoguimaraescb
...

GitHub's own commit-list endpoint resolves this exact email (the one reported as not linking up) to the login just fine via the .author.login field it already attaches to every listed commit — the ?author=<email> filter parameter is what's unreliable, not the underlying email→account linkage.

Fix

  • New bulk, date-bounded resolution step (one paginated gh api .../commits?since=... scan, bounded to the same lookback window already used for the local git log read) as the primary path for non-noreply emails.
  • The old per-email ?author=<email> call is kept, now only as a fallback for whatever the bulk scan doesn't cover.
  • Free noreply-email regex extraction unchanged.
  • Extracted the whole thing (previously nested closures inside _run_single_repo's push block, iris/cli.py:772-874) into iris/platform/identity.py — makes it independently unit-testable with mocked subprocess.run, no network required.

Test plan

  • New tests/test_identity.py (5 tests, mocked subprocess.run): noreply resolves with zero commit-API calls; non-noreply resolves via the bulk scan without falling back; bulk-scan miss correctly falls back to the per-email call; no GitHub remote skips API resolution entirely; two emails of the same person (one noreply, one real) merge under one identity, preferring the display name with a space — the exact reported scenario
  • pytest tests/ -q — 473 passed (468 existing + 5 new)
  • Live smoke test against real data: ran resolve_active_users() directly against RocketBus/iris's own last-90-days commit history (bypassing push, so nothing was actually sent) — resolved several real non-noreply identities correctly via the new bulk path (e.g. marcos.carvalho@clickbus.com -> codermarcos), no errors

🤖 Generated with Claude Code

…er unidentified people)

Root cause of the "same person shows up as two separate Hyper Engineers"
gap (#202/#203): the per-email resolution step
(gh api repos/{repo}/commits?author=<email>) misses real matches —
verified live: a real work email GitHub does tie to an account failed
that filtered query, while GitHub's own commit-list endpoint resolves
it fine via the .author.login field it already attaches to every
listed commit.

Adds a bulk, date-bounded resolution step (one paginated commit-list
scan, bounded to the same lookback window already used locally for
git log) as the primary path for non-noreply emails, ahead of the old
per-email API call, which now only runs as a fallback for whatever the
bulk scan didn't cover. The free noreply-email regex extraction is
unchanged.

Also extracts this logic out of nested closures inside
_run_single_repo's push block into iris/platform/identity.py, making
it independently unit-testable (mocked subprocess, no network) instead
of only reachable through a full analysis+push run.

Verified live against RocketBus/iris: renato.guimaraes@clickbus.com ->
renatoguimaraescb (the exact case reported) resolves via the bulk scan;
marcos.carvalho@clickbus.com -> codermarcos likewise, confirmed by
directly running resolve_active_users() against this repo's real
commit history.

Co-Authored-By: claude-code_2-1-238_agent <claude-code_2-1-238_agent@iris.invalid>
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clickbus-iris Ready Ready Preview Aug 27, 2026 10:34am

Request Review

@clickmatos
clickmatos merged commit b67bd7e into main Aug 27, 2026
5 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.

1 participant