posthog icon indicating copy to clipboard operation
posthog copied to clipboard

refactor(inbox): key warehouse source setup by signal source

Open rnegron opened this issue 4 months ago • 5 comments

Problem

Adding a signal source should be one entry. Today it's four product-keyed structures plus two copy-pasted DataSourceSetup components.

That shape assumes one warehouse product means exactly one signal source, which breaks the moment GitHub backs a second (CI signals). It also already ships a bug: the two copies drifted, so the pganalyze wizard pre-selects issues+servers while sync only forces issues.

Changes

Before:

flowchart LR
    S[signal source] --> P{{warehouse product}}
    P --> A[DATA_WAREHOUSE_SOURCE_CONFIG]
    P --> B[SIGNAL_SOURCE_REQUIRED_TABLES]
    P --> C[agentRosterMeta.dataWarehouseSource]
    P --> D[inline completion map]
    A --> X[DataSourceSetup in AgentsTab]
    D --> Y[DataSourceSetup in SignalSourcesPanel]
    classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000;
    classDef phRed fill:#f54e00,stroke:#f54e00,color:#fff;
    classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000;
    classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff;
    class S phYellow;
    class P phRed;
    class A,B,C,D phGray;
    class X,Y phBlue;

After:

flowchart LR
    S[signal source] --> R[WAREHOUSE_SOURCE_SETUP]
    R --> X[DataSourceSetup]
    classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000;
    classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000;
    classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff;
    class S phYellow;
    class R phGray;
    class X phBlue;
  • Keyed by signal source, not warehouse product, so one product can back several. Adding a source becomes one registry entry
  • pganalyze drift fixed; unused roster-meta field removed
  • Enabling an already-connected source now syncs every repo's rows. Multi-repo GitHub names rows owner/repo.issues, which the exact-name match missed, so the source sat there not syncing. New schemasToEnableFor

[!WARNING] First-time setup is still broken for qualified sources, and is not fixed here. sourceWizardLogic matches requiredTables against schema.table exactly (L1520), so connecting GitHub from the inbox fails with Required tables not found in source: issues. That match belongs to the data warehouse wizard.

[!NOTE] Backend half of the same naming bug: the signals qualified-schema PR. Independent, no file overlap, either can merge first.

How did you test this code?

  • Jest: 66 inbox tests. signalSourcesLogic.test.ts covers schemasToEnableFor — catches a multi-repo source resolving to nothing, and only the first repo being enabled. Nothing covered qualified names before
  • kea typegen + tsc clean; the re-key itself is pure re-wiring, no behavior change beyond the pganalyze fix
  • Merged master (246 commits). One conflict, where anomaly investigation added a listener beside the re-keyed one. Kept both, then checked every renamed symbol for stale callers

Automatic notifications

  • [ ] Publish to changelog?
  • [ ] Alert Sales and Marketing teams?

Docs update

None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted). Extracted by Claude Code from the CI signals stack; the stack absorbs this on merge.

The multi-repo fix landed here rather than in its own PR because this PR already rewrites that exact call site. A review pass found the wizard gap called out above; an earlier draft of this description wrongly implied setup was covered.

rnegron avatar Jul 14 '26 18:07 rnegron

🦔 Hogbox preview · ✅ ready

▶ Open the preview

🔑 Login [email protected] / 12345678 (demo data)
🧩 Running this PR's backend and frontend, on the PostHog :master base
🔗 Link stable across rebuilds — a re-push swaps the box underneath, the URL stays
🔒 Access tailnet only (PostHog VPN)
🛠️ Admin inspect & debug state in hogland
💤 Idle sleeps after ~30 min idle (snapshot to S3, zero node cost) and wakes on your next visit in ~30s, behind a brief "waking up" screen

commit 5d3cf8a · box box-acb306fdac0f · ready in 735s (push → usable) · build log · rebuilds on every push, torn down on close

github-actions[bot] avatar Jul 14 '26 18:07 github-actions[bot]

Reviews (1): Last reviewed commit: "refactor(inbox): key warehouse source se..." | Re-trigger Greptile

greptile-apps avatar Jul 14 '26 18:07 greptile-apps

🤖 CI report

✅ Bundle size — 🟢 -398 B (-0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 64.84 MiB · 🟢 -398 B (-0.0%)

No file changed by more than 1000 B.

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

✅ Eager graph — within budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.23 MiB · 22 files no change ███░░░░░░░ 28.6% of 4.29 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
8.15 MiB · 2,988 files 🟢 -297 B (-0.0%) █████████░ 88.1% of 9.25 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx 🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx 🟢 [object Object] stays out of src/index.tsx 🟢 [object Object] stays out of src/index.tsx 🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx 🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx 🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx 🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx

Largest files eagerly shipped from src/index.tsx
Size File
126.8 KiB ../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.production.min.js
24.6 KiB ../node_modules/.pnpm/[email protected]/node_modules/buffer/index.js
6.3 KiB ../node_modules/.pnpm/[email protected]/node_modules/react/cjs/react.production.min.js
4.5 KiB ../node_modules/.pnpm/@[email protected]/node_modules/@jspm/core/nodelibs/browser/process.js
3.9 KiB ../node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.production.min.js
1.4 KiB ../node_modules/.pnpm/[email protected]/node_modules/base64-js/index.js
1.3 KiB src/RootErrorBoundary.tsx
912 B ../node_modules/.pnpm/[email protected]/node_modules/ieee754/index.js
789 B src/scenes/ChunkLoadErrorBoundary.tsx
762 B src/index.tsx
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
281.3 KiB ../node_modules/.pnpm/[email protected]/node_modules/posthog-js/dist/rrweb.js
267.7 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
235.5 KiB src/taxonomy/core-filter-definitions-by-group.json
223.2 KiB ../node_modules/.pnpm/[email protected]/node_modules/posthog-js/dist/module.js
164.0 KiB src/queries/validators.js
154.3 KiB ../node_modules/.pnpm/[email protected]/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.production.min.js
105.8 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/[email protected]/node_modules/prosemirror-view/dist/index.js
93.3 KiB ../packages/quill/packages/quill/dist/index.js

Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479

✅ Dist folder size — 🟢 -51.5 KiB (-0.0%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 1336.52 MiB · 🟢 -51.5 KiB (-0.0%)

✅ Playwright — all passed

All tests passed.

View test results →

github-actions[bot] avatar Jul 14 '26 18:07 github-actions[bot]

Static Badge   Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

trunk-io[bot] avatar Jul 14 '26 18:07 trunk-io[bot]

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

posthog[bot] avatar Jul 14 '26 21:07 posthog[bot]