Skip to content

fix: don't treat placeholder employers as organizations - #5168

Merged
skwowet merged 2 commits into
mainfrom
fix/issue-908-placeholder-employer-labels
Nov 2, 2026
Merged

skwowet merged 2 commits into
mainfrom
fix/issue-908-placeholder-employer-labels

Conversation

@skwowet

@skwowet skwowet commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Generic employer labels like "Freelance", "Self-employed", "Student" or "N/A" were resolved as organizations. They either created placeholder orgs or matched real companies by name (Freelancer Technology Pty Ltd, National Student Clearinghouse, Student Inc). This PR stops treating them as organizations. Enrichment records those roles at Individual - No Account instead.

Changes

  • Added isPlaceholderEmployerName to @crowd/common. It matches a fixed set of labels, ignoring case, spacing and punctuation. Digits and non-ASCII letters are kept, so Student42 doesn't match. Real names that only contain a label (Freelancer.com, Ace Freelance, Student Inc) don't match.
  • findOrCreateOrganization returns undefined for a placeholder name, before any lookup. This covers data sink for all integrations, enrichment and the public API. Every caller already handles undefined.
  • Enrichment maps placeholder roles to Individual - No Account, with no identities attached.
  • GitHub skips the GitHub org lookup when the profile company is a placeholder. Otherwise @freelancer resolves to the Freelancer Technology GitHub org, whose name isn't a placeholder.
  • POST /organizations rejects placeholder names with a 400.

The new exports in @crowd/common are additive. Existing rows pointing at placeholder or wrong orgs will be fixed separately.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

Related issue

Refs linuxfoundation/lfx-cdp-insights-ops#908

Copilot AI balanced review requested due to automatic review settings November 2, 2026 13:30
@skwowet skwowet changed the title fix: stop resolving placeholder employer labels to organizations fix: don't treat placeholder employers as organizations Nov 2, 2026
@skwowet skwowet self-assigned this Nov 2, 2026
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet
skwowet force-pushed the fix/issue-908-placeholder-employer-labels branch from eb21a7a to ed379ab Compare November 2, 2026 13:32

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.

🟡 Changes recommended

The data-sink cache can bypass placeholder safeguards and incorrectly attach members or skip real employers, while normalization also rejects legitimate names containing digits.

2 open issues
What changed in this PR

This PR prevents generic employer labels from resolving to organizations across CDP ingestion, enrichment, and the public API. Enrichment instead associates these roles with Individual - No Account.

Changes:

  • Adds shared placeholder-name detection and guards organization resolution and creation.
  • Maps placeholder enrichment roles to the fallback organization without triggering organization-wide member re-indexing.
  • Skips GitHub organization lookups for placeholder company names and documents the behavior.
File Description
services/​libs/​integrations/​src/​integrations/​github/​processStream.ts Skips GitHub organization lookups for placeholder employers.
services/​libs/​data-access-layer/​src/​organizations/​base.ts Adds a placeholder guard and fallback organization lookup.
services/​libs/​common/​src/​organization.ts Defines placeholder detection and the fallback organization name.
services/​apps/​members_enrichment_worker/​src/​activities/​enrichment.ts Maps placeholder roles to the fallback and excludes it from organization sync.
docs/​knowledge/​member-identity.md Documents placeholder employer handling.
backend/​src/​api/​public/​v1/​organizations/​createOrganization.ts Rejects placeholder organization names through request validation.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 13:36
@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; both previous findings are fixed and no new blocking issues were found.

Summary

Stops placeholder employer labels from becoming organizations.

  • Placeholder employer labels stop before organization matching.
  • Enrichment keeps placeholder roles under Individual - No Account.
  • GitHub skips organization lookup for placeholder profile companies.
  • The public organization endpoint rejects placeholder names.

Reviews (2) · Last reviewed commit: "fix: tighten placeholder name check and ..." · Reviewed by Greptile

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.

🔵 Needs a closer look

Identity-only caching makes placeholder handling order-dependent, causing lost or incorrect affiliations, while overbroad normalization incorrectly rejects distinct organization names.

2 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 2, 2026 13:42
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
@skwowet
skwowet force-pushed the fix/issue-908-placeholder-employer-labels branch from 27b41bf to 9ca3154 Compare November 2, 2026 13:42
@skwowet
skwowet merged commit 1343ed0 into main Nov 2, 2026
15 checks passed
@skwowet
skwowet deleted the fix/issue-908-placeholder-employer-labels branch November 2, 2026 13:47

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.

🔵 Needs a closer look

A missing or ambiguous fallback account silently drops placeholder roles, allowing reconciliation to delete existing enrichment work history without replacement instead of aborting the transaction.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

High severity Abort when the fallback account is missing or ambiguous

services/​apps/​members_enrichment_worker/​src/​activities/​enrichment.ts:440

If Individual - No Account is missing or has multiple active matches, this branch silently drops the placeholder roles. Reconciliation still runs and can delete existing enrichment work history without recording a replacement. Abort the transaction when the fallback cannot be resolved rather than treating a failed lookup as empty employment history.

2 resolved since last review

Review effort: Balanced

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