Skip to content

feat: enable project-registry affiliation writes (CM-361)#4302

Open
skwowet wants to merge 1 commit into
feat/CM-361-part-1from
feat/CM-361-part-2
Open

feat: enable project-registry affiliation writes (CM-361)#4302
skwowet wants to merge 1 commit into
feat/CM-361-part-1from
feat/CM-361-part-2

Conversation

@skwowet

@skwowet skwowet commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Part 2 of CM-361. Part 1 discovers and parses project-maintained affiliation files in git_integration but left MO/MSA writes disabled for validation. This PR turns on those writes and updates shared affiliation logic so project-registry rows behave correctly downstream — ranked above email-domain/enrichment and picked up during activity ingest.

Changes

  • git_integration: call insert_member_organizations and insert_member_segment_affiliations after lookup/guard checks so parsed repo affiliations land in CDP
  • types: add OrganizationSource.PROJECT_REGISTRY (project-registry)
  • common: rank project-registry above email-domain and enrichment in getMemberOrganizationSourceRank (UI still wins)
  • data-access-layer: include fully undated MSAs in findMemberManualAffiliation so new activities resolve repo-derived affiliations the same way bulk refresh already does

Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet skwowet self-assigned this Jul 3, 2026
Copilot AI review requested due to automatic review settings July 3, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 is Part 2 of CM-361. Part 1 discovered and parsed project-maintained affiliation files in git_integration but kept the CDP writes disabled for validation. This PR turns those writes on and updates the shared affiliation logic so project-registry member-organization / member-segment-affiliation rows behave correctly downstream — ranked above email-domain/enrichment (but below UI) and picked up during activity ingest.

Changes:

  • git_integration: activate the previously commented-out insert_member_organizations / insert_member_segment_affiliations calls (plus their imports) so parsed repo affiliations land in CDP.
  • Introduce OrganizationSource.PROJECT_REGISTRY and slot project-registry between ui and email-domain in getMemberOrganizationSourceRank.
  • Expand findMemberManualAffiliation to also match fully undated MSAs so new activities resolve repo-derived affiliations like the bulk refresh path already does.

Reviewed changes

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

File Description
services/apps/git_integration/src/crowdgit/services/affiliation/affiliation_service.py Enables the actual MO/MSA inserts after lookup/guard checks and imports the two crud helpers.
services/libs/types/src/enums/organizations.ts Adds the PROJECT_REGISTRY = 'project-registry' enum value.
services/libs/common/src/member.ts Re-ranks sources so project-registry outranks email-domain/enrichment but not UI.
services/libs/data-access-layer/src/members/segments.ts Adds a fully-undated branch to the manual-affiliation lookup used during activity ingest.

One concern worth addressing before merge: the new undated branch in findMemberManualAffiliation interacts with ORDER BY "dateStart" DESC (PostgreSQL NULLS FIRST default), which lets an undated catch-all MSA win over a more specific dated MSA that covers the timestamp — see the inline comment.


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

Comment on lines +192 to 194
OR ("dateStart" IS NULL AND "dateEnd" IS NULL)
)
ORDER BY "dateStart" DESC, id
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