Skip to content

refactor(inbox): key warehouse source setup by signal source - #70830

Closed
rnegron wants to merge 12 commits into
masterfrom
rauln/inbox-source-setup-rekey
Closed

refactor(inbox): key warehouse source setup by signal source#70830
rnegron wants to merge 12 commits into
masterfrom
rauln/inbox-source-setup-rekey

Conversation

@rnegron

@rnegron rnegron commented Jul 14, 2026

Copy link
Copy Markdown
Member

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;
Loading

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;
Loading
  • 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.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🦔 Hogbox preview · ✅ ready

▶ Open the preview

🔑 Login test@posthog.com / 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

@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 14, 2026 18:23
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

Comment thread frontend/src/scenes/inbox/signalSourcesLogic.ts Outdated
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🤖 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/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
24.6 KiB ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js
6.3 KiB ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
4.5 KiB ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js
3.9 KiB ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js
1.4 KiB ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
1.3 KiB src/RootErrorBoundary.tsx
912 B ../node_modules/.pnpm/ieee754@1.2.1/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/posthog-js@1.404.0/node_modules/posthog-js/dist/rrweb.js
267.7 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/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/posthog-js@1.404.0/node_modules/posthog-js/dist/module.js
164.0 KiB src/queries/validators.js
154.3 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
105.8 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/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 →

@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@posthog

posthog Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

👋 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.

rnegron added 2 commits July 15, 2026 11:26
Thread the setup source through onDataSourceSetupComplete from DataSourceSetup's stable prop instead of reading live reducer state, so the signal still enables if the connect resolves after Back/close. Also run required-table syncs concurrently, derive WarehouseBackedSource from the registry, and drop the vestigial values wrapper.
@rnegron
rnegron force-pushed the rauln/inbox-source-setup-rekey branch from 6fcf638 to a880dc8 Compare July 16, 2026 14:03
@rnegron rnegron added the waiting Prevents stale-bot from marking the PR as stale. label Jul 23, 2026
@rnegron

rnegron commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

superseded by #67117

@rnegron rnegron closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting Prevents stale-bot from marking the PR as stale.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant