Improve GitHub identity resolution: bulk commit-list scan instead of per-email filter - #204
Merged
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, againstRocketBus/irisitself: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.loginfield it already attaches to every listed commit — the?author=<email>filter parameter is what's unreliable, not the underlying email→account linkage.Fix
gh api .../commits?since=...scan, bounded to the same lookback window already used for the localgit logread) as the primary path for non-noreply emails.?author=<email>call is kept, now only as a fallback for whatever the bulk scan doesn't cover._run_single_repo's push block,iris/cli.py:772-874) intoiris/platform/identity.py— makes it independently unit-testable with mockedsubprocess.run, no network required.Test plan
tests/test_identity.py(5 tests, mockedsubprocess.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 scenariopytest tests/ -q— 473 passed (468 existing + 5 new)resolve_active_users()directly againstRocketBus/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