Repository navigation
feat: resolve contributor emails to akrites members by verified domain (CM-1826) - #4917
Conversation
…n (CM-1826) Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
PR SummaryLow Risk Overview The resolver loads verified domains once per call, walks subdomains up to the registrable domain, and skips public/disposable domains and domains claimed by more than one member (with a single warn). Results are keyed as Unit tests cover matching, exclusions, conflicts, determinism, and batched CDP fetch behavior. Reviewed by Cursor Bugbot for commit 3fce8ad. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
|
There was a problem hiding this comment.
🟡 Changes recommended
Provider and disposable-domain subdomains can still be accepted when stored directly as primary domains.
1 open finding
What changed in this PR
Adds email-domain affiliation resolution for Akrites member contributors.
Changes:
- Resolves normalized emails using verified primary domains.
- Excludes conflicts, public providers, and disposable domains.
- Adds comprehensive unit tests.
| File | Description |
|---|---|
types.ts |
Defines email-domain affiliation results. |
resolveEmailDomainAffiliations.ts |
Implements domain-based resolution. |
resolveEmailDomainAffiliations.test.ts |
Tests matching, exclusions, and determinism. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
| const registrable = registrableDomain(domain) | ||
| if (!registrable || !domain.endsWith(registrable)) return [domain] |
| if (isIneligibleDomain(domain) || conflictingDomains.has(domain)) continue | ||
| const owner = owners.get(domain) | ||
| if (!owner) { | ||
| owners.set(domain, { akritesMember: member.name, cdpOrganizationId }) | ||
| } else if (owner.akritesMember !== member.name) { |


Summary
Second affiliation resolver for the Akrites member contributors epic (CM-1807): email → Akrites member via the member's verified CDP primary domains. Confidence
email_domain, score0.7. Pure function over a batch; nothing is persisted, scheduled or wired (that is CM-1828).resolveEmailDomainAffiliations(cdpQx, emails, members = AKRITES_MEMBERS)returns aMapkeyed byemail:<lowercased email>.fetchManyOrganizationVerifiedPrimaryDomains, walked in registry order so output is stable regardless of DB row order.foo.co.uknever triesco.uk).meetup.com: IBM + Microsoft) is excluded for both and logged once per call. Same member under several org ids keeps the first in registry order.Expected coverage once wired: ~55k of 1.74M distinct contributor emails, Google / Microsoft / Red Hat / IBM on top, zero public-provider matches.
Test plan
__tests__/resolveEmailDomainAffiliations.test.ts(exact, subdomain, registrable-domain stop, public provider, disposable, unknown, invalid, cross-member conflict, same-member determinism, single batched query, case/dedupe)npx vitest run src/member-contributors: 8 files, 89 tests pass--deny-warnings, oxfmt, package-level tsc clean on touched files🤖 Generated with Claude Code