Skip to content

feat(people): match manager references by employee number, email or login - #10694

Draft
mzxchandra wants to merge 2 commits into
stagingfrom
claude/people-manager-matching
Draft

mzxchandra wants to merge 2 commits into
stagingfrom
claude/people-manager-matching

Conversation

@mzxchandra

Copy link
Copy Markdown
Contributor

Summary

  • People sync now links a manager reference that isn't an account ID. Directories fed by an HR system often fill Okta's managerId with an employee number, email or username, and publish used to drop those silently, leaving the org chart with no reporting lines
  • Each reference is matched in order: account ID, employee number, email, login (email and login case-insensitive). The first key with a match decides
  • Employee number comes from Okta employeeNumber, Entra employeeId and SCIM enterprise employeeNumber. An over-length SCIM value is left out, never truncated
  • A reference several accounts share at that key stays unlinked with a new manager_ambiguous warning (Changed, CSV) carrying the reference. A reference that names nobody, such as a departed manager, is still dropped without a warning
  • References that already equal an account ID skip matching, so ID-linked directories do no extra work
  • Each publish logs counts per key (by ID, employee number, email, login, unmatched, ambiguous)
  • Migration 0488 adds nullable people_directory_stage.employee_number and people_directory_issue.reference. Expansion only, no backfill; the old release never names either column
  • Docs: new "Finding managers" section on the People page

Type of Change

  • New feature

Testing

  • bun run test:integration on issues, snapshot, stage and large-directory people-sync suites: 36 passed
  • New cases: employee number, email and login in any case; key precedence (ID over employee number, employee number over login); ambiguous reference warns and an unknown one is silent; SCIM employeeNumber link
  • Mutation check: removing each guard (employee-number key, case folding, key precedence, ambiguity null, SCIM projection) turns a test red
  • publishes a 12,000-person reporting chain runs in 15s locally
  • bun run --cwd apps/sim test lib/people, bun run lint, bun run generate, bun run check:audits, bun run check:migrations origin/staging, drizzle-kit generate reports no drift
  • Type-check left to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…ogin

Directories fed by an HR system often fill Okta's managerId with an
employee number, email or username instead of the manager's Okta ID.
Publish dropped those references, so a fully synced directory could
show no reporting lines at all.

Publish now matches each manager reference in order: account ID, then
employee number (Okta employeeNumber, Entra employeeId, SCIM enterprise
employeeNumber), then email, then login, case-insensitively for the
last two. The first key with a match decides. A reference several
accounts share at that key is left unlinked with a manager_ambiguous
warning; one that names nobody, such as a departed manager, is dropped
silently as before. References that already equal an account ID skip
the matching entirely, so ID-linked directories do no extra work.

Each publish logs how many references each key matched.

Schema: nullable people_directory_stage.employee_number and
people_directory_issue.reference; no backfill.
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 3, 2026 3:21am UTC

Request Review

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mzxchandra I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 17 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@mzxchandra

Copy link
Copy Markdown
Contributor Author

@greptile

This branch was previously deployed

1 inactive deployment
Preview — 5bae1e3c Deployed Dec 3, 2026 by vercel[bot]
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.

1 participant