Skip to content

fix: improve member merge suggestions for split git email profiles (CM-1137)#4115

Merged
skwowet merged 2 commits into
mainfrom
improve/CM-1137
May 15, 2026
Merged

fix: improve member merge suggestions for split git email profiles (CM-1137)#4115
skwowet merged 2 commits into
mainfrom
improve/CM-1137

Conversation

@skwowet
Copy link
Copy Markdown
Collaborator

@skwowet skwowet commented May 14, 2026

Summary

Improves member merge suggestions for contributors split across multiple Git commit emails.

Git ingest stores commit-author emails as git/username, but merge scoring treated those values like stable platform handles. That caused profiles for the same person to hard-clash and score 0.2 before noreply, display-name, or metadata checks could run.

Changes

  • Relax git/username clashes when both values are email-like, while keeping real platform username clashes intact.
  • Only use verified usernames as hard clash signals, so enrichment-derived social slugs do not veto stronger identity evidence.
  • Add guardrails for bots, placeholder names, and local-machine default identities.
  • Add GitLab noreply parsing and include GitLab/GitHub noreply-to-username matches in candidate generation and scoring.
  • Fix confidence score bumps so metadata signals actually increase similarity.
  • Add a local-machine email local-part signal for *.local / *.lan commit identities.
  • Preserve noreply identities in the LLM payload while continuing to strip normal emails.
  • Tighten the LLM prompt so display name alone is not enough to approve a merge.

Validation

  • Ran focused member similarity checks against real DB-derived cases.
  • Verified positive cases for split Git email profiles and negative cases for clashing real platform usernames / placeholder names.
  • Ran merge worker typecheck and lint.

Note

Medium Risk
Changes core member-merge candidate generation and similarity scoring (clash detection, confidence bumping, new identity heuristics), which can meaningfully alter merge decisions and may cause false merges/splits if edge cases are missed.

Overview
Improves member merge suggestions for contributors split across multiple git commit emails by relaxing clash detection to only consider verified username conflicts and by exempting git/username email-like clashes when display names look non-placeholder/non-bot.

Expands matching and scoring signals: adds parseGitLabNoreplyEmail support and uses noreply→username matches in both OpenSearch candidate queries and similarity checks; fixes noreply deduping to key on platform:value; fixes confidence bumping (previously no-op) and adds a new boost for shared local-part across local-machine git emails.

Tightens LLM merging behavior by preserving noreply emails (while stripping other emails) and updating the prompt to treat display name as a supporting-only signal that cannot alone justify a merge.

Reviewed by Cursor Bugbot for commit 33411ae. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI review requested due to automatic review settings May 14, 2026 10:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves member merge-suggestion recall for contributors whose git identities are stored as git/username email addresses (work/personal/local-machine splits), while expanding noreply support (GitLab) and fixing a confidence-score bumping bug so secondary signals can influence similarity scoring.

Changes:

  • Add GitLab noreply parsing + provider constants, and expose shared helpers for noreply/local-machine email handling in @crowd/common.
  • Relax “clashing username identities” for git/username values that are email-like (contain @) when display names indicate a real identity; add local-machine local-part matching as an additional confidence bump.
  • Keep noreply identities when preparing LLM input; fix noreply dedupe key to include platform and fix bumpFactor so metadata bumps are applied.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
services/libs/common/src/email.ts Adds GitLab noreply parsing plus helpers (isNoreplyEmail, isLocalMachineEmail, getEmailLocalPart) and switches GitHub suffix handling to shared constants.
services/libs/common/src/constants/email-providers.ts Introduces noreplyEmailProviders constants used by common email utilities.
services/apps/merge_suggestions_worker/src/utils.ts Preserves noreply identities when stripping email-like identities for LLM input.
services/apps/merge_suggestions_worker/src/memberSimilarityCalculator.ts Adjusts clash logic for git email “usernames”, fixes bumpFactor bug, adds local-machine local-part bump signal, and adds GitLab noreply matching.
services/apps/merge_suggestions_worker/src/activities/memberMergeSuggestions.ts Adds GitLab noreply extraction into candidate generation and fixes dedupe to use platform:value composite key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/apps/merge_suggestions_worker/src/memberSimilarityCalculator.ts Outdated
@skwowet skwowet force-pushed the improve/CM-1137 branch from b8cf307 to 5b79d50 Compare May 14, 2026 10:51
Copilot AI review requested due to automatic review settings May 14, 2026 10:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread services/apps/merge_suggestions_worker/src/memberSimilarityCalculator.ts Outdated
Comment thread services/apps/merge_suggestions_worker/src/memberSimilarityCalculator.ts Outdated
Copilot AI review requested due to automatic review settings May 15, 2026 07:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings May 15, 2026 07:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread services/apps/merge_suggestions_worker/src/workflows.ts
Copilot AI review requested due to automatic review settings May 15, 2026 08:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread services/apps/merge_suggestions_worker/src/utils.ts Outdated
Copilot AI review requested due to automatic review settings May 15, 2026 08:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread services/apps/merge_suggestions_worker/src/enums.ts Outdated
Comment thread services/apps/merge_suggestions_worker/src/utils.ts
Comment thread services/apps/merge_suggestions_worker/src/enums.ts Outdated
Copilot AI review requested due to automatic review settings May 15, 2026 08:59
Comment thread services/apps/merge_suggestions_worker/src/memberSimilarityCalculator.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comment thread services/apps/merge_suggestions_worker/src/utils.ts
Comment thread services/apps/merge_suggestions_worker/src/enums.ts Outdated
Comment thread services/apps/merge_suggestions_worker/src/activities/memberMergeSuggestions.ts Outdated
@skwowet skwowet force-pushed the improve/CM-1137 branch from 206e031 to 56bd5a0 Compare May 15, 2026 09:16
Copilot AI review requested due to automatic review settings May 15, 2026 09:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread services/apps/merge_suggestions_worker/src/memberSimilarityCalculator.ts Outdated
Comment thread services/apps/merge_suggestions_worker/src/utils.ts Outdated
@skwowet skwowet force-pushed the improve/CM-1137 branch from ed39f50 to 575547e Compare May 15, 2026 09:51
Copilot AI review requested due to automatic review settings May 15, 2026 09:57
@skwowet skwowet force-pushed the improve/CM-1137 branch from 575547e to 496514c Compare May 15, 2026 09:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread services/libs/common/src/constants/email-providers.ts
Copilot AI review requested due to automatic review settings May 15, 2026 10:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread services/apps/merge_suggestions_worker/src/utils.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9211dfd. Configure here.

Comment thread services/apps/merge_suggestions_worker/src/utils.ts
Copilot AI review requested due to automatic review settings May 15, 2026 10:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

…M-1137)

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet skwowet force-pushed the improve/CM-1137 branch from d941ade to 33411ae Compare May 15, 2026 11:07
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 15, 2026 11:24
@skwowet skwowet merged commit e088a2e into main May 15, 2026
19 checks passed
@skwowet skwowet deleted the improve/CM-1137 branch May 15, 2026 11:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment on lines 473 to 517
@@ -409,13 +505,60 @@ class MemberSimilarityCalculator {
confidenceScore = this.bumpConfidenceScore(confidenceScore, bumpFactor)
}

// Catches contributors whose only identity is commits from an unconfigured machine —
// same local-part across *.local / *.lan addresses is a strong hint they're the same person.
if (this.hasSameLocalPartInGitUsername(member, similarMember)) {
isHighConfidence = true
confidenceScore = this.bumpConfidenceScore(confidenceScore, bumpFactor)
}

if (!isHighConfidence) {
return this.LOW_CONFIDENCE_SCORE
}
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.

2 participants