fix(platform): merge Hyper Engineers when a repo's commit name is the GitHub handle itself - #206
Merged
Conversation
… GitHub handle itself
Confirmed live (gh api search/commits) that some people's git config uses
their GitHub username as the commit author name in some repos (e.g.
"lucastribioliclickbus") and their real name in others ("Lucas Tribioli"),
often paired with different commit emails (noreply vs. corporate) across
repos. When push-time API resolution failed to tie the corporate email to
a login for those specific repos, nameToGithub had no entry for the raw
handle-as-name string, splitting the person into two Hyper Engineers cards
— even though userMap already knew the mapping from a different repo's
successful resolution, just not until display time.
computeHyperEngineers now checks userMap by name during grouping too, not
only at display time, so the two variants merge into one. Also switches
repo counting from a raw counter to a Set of repo ids, so a repo that
lists the same person under two name/email variants only counts once.
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.
|
4 tasks
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
Reported: Lucas Tribioli showed up twice in Hyper Engineers (18 repos / 11 repos), both under "Identificados", both linking to the same
lucastribioliclickbusGitHub profile.Confirmed live via
gh api search/commitsagainst the real org data: he uses two different commit emails across repos — anoreplyemail in some, his corporate email (lucas.tribioli@clickbus.com) in others — and in the corporate-email repos, his local git config name is literally his GitHub handle (lucastribioliclickbus) instead of "Lucas Tribioli".Root cause:
computeHyperEngineers's grouping key only checkednameToGithub(built from each repo's already-resolvedactive_userspush). For repos where push-time API resolution failed to tie the corporate email to a login, there's nonameToGithubentry for the raw handle-as-name string — so that entry grouped separately, keyed by the raw name/email instead of the shared identity.userMapdid already know the right mapping (from a different repo's successful resolution), but that richer lookup only ran at display time, after grouping had already split the person into two buckets — so the split entry still showed a resolved GitHub link, just as a second, separate card.Fix
computeHyperEngineersnow also checksuserMapby name during grouping, not only at display time — closing the exact gap above.Setof repo ids, so a repo that lists the same merged identity under two name/email variants (possible within one repo too) only counts once — addresses "removendo os repositórios repetidos".userMapentry is found, since the raw handle-as-name string otherwise wins by being longer.Test plan
platform/tests/org-summary.test.tsreproducing the exact scenario (raw name = GitHub handle, resolved viauserMapnotnameToGithub; and same-repo double-counting)npx vitest run— full suite passes (275/275)npx tsc --noEmit— cleannpx eslint— clean