Skip to content

feat(org-lens): seed demo accounts when persona detection returns none#692

Merged
ahmedomosanya merged 1 commit into
feat/CD-3507-org-lens-shellfrom
demo/CD-3507-org-lens-seed-fallback
May 12, 2026
Merged

feat(org-lens): seed demo accounts when persona detection returns none#692
ahmedomosanya merged 1 commit into
feat/CD-3507-org-lens-shellfrom
demo/CD-3507-org-lens-seed-fallback

Conversation

@ahmedomosanya
Copy link
Copy Markdown

WIP / Draft. Demo overlay stacked on top of #646 so the org lens shell's preview URL has a populated org selector for the CD-3507 stakeholder demo. Intended to be reverted from the shell branch before #646 merges to main.

Ticket: CD-3507

Summary

  • Add ORG_LENS_DEMO_SEED_ACCOUNTS (8 orgs: Toyota + IBM family) in packages/shared/src/constants/accounts.constants.ts. Each entry carries only accountId + accountName so tier, slug, and logo continue to resolve live from platinum_lfx_one_org_lens_account_context via getOrgLensAccountContext.
  • Add private withDemoSeedFallback(req, accounts) helper in PersonaDetectionService that returns the seed only when the input list is empty, so real board_member detections are never displaced.
  • Apply the helper to all three return paths of computePersonaDetections: persona-service error, no detections, and the success path's extractOrganizations output.

Why

The persona-service contract for user-scoped organizations is still blocked upstream (Prabodh's work). Today the only path that populates organizations is extractOrganizations, which scrapes board_member detection extras — so engineering accounts on the dev cluster see an empty selector. The seed unblocks the stakeholder demo without faking enrichment data: tier badges, logos, and slugs all come from the real Snowflake context.

Out of scope (intentionally)

  • Real persona-service organizations integration. Will replace this fallback once the upstream contract is in.
  • UI changes. The selector, tier badge, and downstream pages are unchanged.
  • Mocking enrichment fields (tier/slug/logo). Those keep flowing through getOrgLensAccountContext so the demo exercises the live path.

Test plan

  • From this branch, make nats-forward + make start, log in, visit http://localhost:4200/org/overview
  • Org selector trigger and dropdown show all 8 seeded orgs with Snowflake-resolved logos/names
  • Tier badge resolves live: Toyota → Platinum Membership; IBM Watson Health → Contributor
  • yarn check-types passes
  • Verify a real board-member account still sees its detected org first (not displaced by seed)

Follow-ups

  • Delete ORG_LENS_DEMO_SEED_ACCOUNTS and withDemoSeedFallback once the upstream persona service returns user-scoped organizations.

Generated with Cursor Composer

The CD-3507 stakeholder demo on the feat/CD-3507-org-lens-shell preview
URL needs the org selector populated for any logged-in user, but the
persona-service contract for user-scoped organizations is still blocked
upstream. Today the only path that populates `organizations` is
`extractOrganizations`, which scrapes `board_member` detection extras,
so most engineering accounts on the dev cluster see an empty selector.

Overlay a small demo seed (8 orgs: Toyota + the IBM family) only when
extraction yields zero. Real board members remain unaffected: the seed
never displaces detected orgs, it just fills the void. The seed
deliberately carries only `accountId` + `accountName` so tier, slug,
and logo continue to resolve live from
`platinum_lfx_one_org_lens_account_context` via
`getOrgLensAccountContext`, exercising the real enrichment path
end-to-end (Toyota -> Platinum, IBM Watson Health -> Contributor).

Remove `ORG_LENS_DEMO_SEED_ACCOUNTS` and `withDemoSeedFallback` once
the upstream persona service starts returning user-scoped
organizations.

- add ORG_LENS_DEMO_SEED_ACCOUNTS in packages/shared accounts constants
  (identifier + name only)
- add private withDemoSeedFallback(req, accounts) helper in
  PersonaDetectionService
- apply the fallback to all three return paths of
  computePersonaDetections (error / no-detections / success)

Generated with [Cursor Composer](https://cursor.com/composer)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: ahmedomosanya <aopeyemi@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings May 12, 2026 13:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bfa2d5de-f7e4-497e-9047-2a25dffae138

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch demo/CD-3507-org-lens-seed-fallback

Comment @coderabbitai help to get the list of available commands and usage tips.

@ahmedomosanya ahmedomosanya added ai-assisted A task or activity that was supported by AI, such as CoPilot, ChatGPT, or other AI technology. enhancement New feature or request WIP labels May 12, 2026
@ahmedomosanya ahmedomosanya self-assigned this May 12, 2026
@ahmedomosanya ahmedomosanya marked this pull request as ready for review May 12, 2026 13:44
@ahmedomosanya ahmedomosanya requested a review from a team as a code owner May 12, 2026 13:44
@ahmedomosanya ahmedomosanya merged commit a3001c0 into feat/CD-3507-org-lens-shell May 12, 2026
14 checks passed
@ahmedomosanya ahmedomosanya deleted the demo/CD-3507-org-lens-seed-fallback branch May 12, 2026 13: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 adds a demo-only fallback to ensure the Org Lens org selector is populated when persona detection returns no organizations (e.g., users without board_member detections), by seeding a fixed set of demo accounts.

Changes:

  • Introduces ORG_LENS_DEMO_SEED_ACCOUNTS (Toyota + IBM family) in shared constants.
  • Adds withDemoSeedFallback(...) in PersonaDetectionService and applies it to multiple computePersonaDetections return paths (including error / empty detections / success).

Reviewed changes

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

File Description
packages/shared/src/constants/accounts.constants.ts Adds exported demo seed accounts list used as an organizations fallback.
apps/lfx-one/src/server/services/persona-detection.service.ts Applies the demo seed fallback when persona detection yields no orgs (and currently also on detection error).

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

Comment on lines +263 to +267
logger.debug(req, 'extract_organizations', 'No detected orgs — returning Org Lens demo seed', {
seed_count: ORG_LENS_DEMO_SEED_ACCOUNTS.length,
});
return ORG_LENS_DEMO_SEED_ACCOUNTS.map((account) => ({ ...account }));
}
Comment on lines +20 to +29
export const ORG_LENS_DEMO_SEED_ACCOUNTS: Account[] = [
{ accountId: '0012M00002ND5yOQAT', accountName: 'Toyota Motor Corporation' },
{ accountId: '0014100000kgVoqAAE', accountName: 'International Business Machines Corporation' },
{ accountId: '0014100000Te2QjAAJ', accountName: 'Red Hat, Inc.' },
{ accountId: '0014100000TdzYmAAJ', accountName: 'Apptio' },
{ accountId: '0012M00002ZLGHsQAP', accountName: 'IBM Watson Health' },
{ accountId: '0012M000027Enn8QAC', accountName: 'Nordcloud, an IBM Company' },
{ accountId: '0012M00002F2mObQAJ', accountName: 'Stackwatch Inc' },
{ accountId: '0014100000Te2qeAAB', accountName: 'Turbonomic, an IBM Company' },
];
personas: ['contributor'],
projects: [],
organizations: [],
organizations: this.withDemoSeedFallback(req, []),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted A task or activity that was supported by AI, such as CoPilot, ChatGPT, or other AI technology. enhancement New feature or request WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants