Skip to content

feat(hogql): switch the native events table per person - #122894

Open
aspicer wants to merge 8 commits into
aspicer/events-cluster-routefrom
aspicer/events-person-switch
Open

aspicer wants to merge 8 commits into
aspicer/events-cluster-routefrom
aspicer/events-person-switch

Conversation

@aspicer

@aspicer aspicer commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

A staff browser can try native JSON events without switching the project for everyone. Routing from #122489 follows the selected table without a separate project allowlist.

Problem

Staff cannot try ordinary app requests on native events without changing the project for every teammate. Per-query overrides cover API calls, but do not follow navigation through insights and dashboards.

The project also has overlapping switches: an instance setting and a stored modifier.

Changes

A staff browser with ph_new_events_schema=1 selects native events, including during impersonation. Non-staff requests ignore the cookie. A request context carries the choice, and streamed dashboard responses retain that context after middleware returns.

An explicit query modifier takes precedence over the cookie. Otherwise, the cookie, project instance setting and global instance setting select the table. Stored project modifiers no longer control it. The instance settings API validates project lists, and the settings page exposes the route host.

Queries resolve their table before caching or queueing. Native and legacy results have distinct cache keys and precompute identities. Nested reads inherit the running query's choice unless explicitly overridden.

Web and marketing revalidation jobs carry the resolved table to their workers and use separate native and legacy debounce keys. This prevents native requests from repeatedly scheduling rebuilds against legacy data.

Every printed native-events query routes to the events cluster when its host is configured. The separate routing allowlist is removed. Schema regeneration and setting descriptions are mechanical.

How did you test this code?

Test rationale: Existing API tests cover staff, non-staff, impersonation and explicit legacy overrides. New tests extend the routing matrix to nested reads. Queue-boundary tests check that each table gets one rebuild and that serialization preserves the choice without mutating the original query.

The routing, validation and queue-boundary tests ran locally. Database-backed tests remain for CI because the shared database is stopped. The settings-page change was not visually checked.

Release status

  • No feature flag controls this change

Docs update

The existing web analytics query-serving guide now describes table selection across precompute jobs and revalidation queues.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Fable 5.1; Codex, GPT-6.

Skills: /writing-tests, /writing-code-comments, /writing-pr-descriptions, /writing-clickhouse-queries, /improving-drf-endpoints, /writing-dataclasses, /writing-user-facing-copy, /authenticating-to-clickhouse, /running-ci-preflight, /stacking-prs. Review fixed lost table selection across nested reads and precompute workers, and simplified routing tests. No customer material was added.

Originally generated with Claude Code.

@aspicer aspicer self-assigned this Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Trunk lane — backend Python lane

This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.

✅ Complexity (TypeScript) — clean

Cyclomatic complexity above the limit in changed typescript files (10 for production files, 15 for test files). Warn only: worth simplifying when you next touch these functions.

⚠️ Duplication (Python) — 1 new duplicated block (worst 157 tokens)

New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

First copy Second copy Lines Tokens
products/analytics_platform/backend/lazy_computation/tests/test_lazy_computation_executor.py:3942 products/analytics_platform/backend/lazy_computation/tests/test_lazy_computation_executor.py:4011 20 157
✅ Duplication (TypeScript) — clean

New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

⚠️ Comment density — 5% of added code lines are comments (22 of 435)

This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out.

Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See .agents/skills/writing-code-comments/SKILL.md for the house rules.

Files with the most added comment lines:

File Comment lines Added lines
products/analytics_platform/backend/lazy_computation/lazy_computation_executor.py 5 27
posthog/api/team/query_modifiers.py 3 3
products/analytics_platform/backend/lazy_computation/tests/test_lazy_computation_executor.py 3 64
posthog/hogql/modifiers.py 2 4
posthog/hogql/test/test_new_events_schema_routing.py 2 115
products/dashboards/backend/api/dashboard.py 2 11
products/marketing_analytics/backend/hogql_queries/test_marketing_cost_trends_query_resolver.py 2 7
frontend/src/queries/schema/schema-general.ts 1 1

This check does not block merging. It updates on every push and clears when the share drops.

⚠️ Bundle size — 🔺 +198 B (+0.0%)

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

Total: 76.57 MiB · 🔺 +198 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
1019.2 KiB · 24 files no change █████████░ 87.0% of 1.14 MiB
logged-out boot: index + App + bootApp (preloaded by every page, including /login)
src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
2.95 MiB · 620 files no change ██████████ 97.4% of 3.03 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
7.43 MiB · 2,549 files no change ██████████ 99.2% of 7.50 MiB
dashboard scene
src/scenes/dashboard/Dashboard.tsx
9.89 MiB · 3,716 files no change ██████████ 98.8% of 10.01 MiB
today home path
src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
7.61 MiB · 2,641 files no change ██████████ 98.3% of 7.74 MiB
AI-first home path
src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
7.86 MiB · 2,633 files no change ██████████ 99.4% of 7.91 MiB
events scene
src/scenes/activity/explore/EventsScene.tsx
9.34 MiB · 3,503 files no change ██████████ 97.4% of 9.59 MiB
web analytics scene
src/scenes/web-analytics/WebAnalyticsScene.tsx
10.25 MiB · 3,735 files no change █████████░ 94.6% of 10.83 MiB
replay detail scene
src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
8.38 MiB · 3,084 files no change █████████░ 88.5% of 9.47 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/svg/ stays out of src/index.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/components/ stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/layout/navigation-3000/navigationLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/scenes/dashboard/dashboardLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/lemon-ui/LemonMarkdown/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/RichContentEditor/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/CodeSnippet/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/taxonomy/core-filter-definitions-by-group.json stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 node_modules/zod/ stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/scenes/billing/billingLogic.tsx stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 src/lib/components/ProductEmptyState/productSetupPreloadLogic.ts stays out of src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 products/dashboards/frontend/widgets/previews/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts stays out of src/scenes/AuthenticatedShell.tsx
🟢 products/wizard/frontend/runs/WizardRunDetailsDrawer.tsx stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/layout/today/TodayShell.tsx stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/layout/today/TodayContextPanelFloating.tsx stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/layout/today/TodaySidePanel.tsx stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/layout/today/TodayTopBar.tsx stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/layout/today/todayRailItems.tsx stays out of src/scenes/AuthenticatedShell.tsx
🟢 zod/v4/locales/de.js stays out of src/scenes/AuthenticatedShell.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/svg/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 node_modules/@posthog/brand/dist/generated/hoggies/components/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx stays out of src/scenes/dashboard/Dashboard.tsx
🟢 src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx stays out of src/scenes/dashboard/Dashboard.tsx
🟢 src/queries/validators.js stays out of src/scenes/dashboard/Dashboard.tsx
🟢 src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 src/scenes/project-homepage/today/TodayReportPage.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 src/queries/Query/Query.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 packages/quill/packages/charts/ stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
🟢 products/posthog_ai/frontend/components/tool/widgets/VisualizationWidget.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 products/posthog_ai/frontend/components/tool/widgets/RecordingsWidget.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 src/queries/Query/Query.tsx stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 products/posthog_ai/frontend/api/primitives.ts stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 src/scenes/notebooks/Notebook/notebookLogic.ts stays out of src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
🟢 src/scenes/session-recordings/playlist/SessionRecordingsPlaylist.tsx stays out of src/scenes/activity/explore/EventsScene.tsx
🟢 src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx stays out of src/scenes/activity/explore/EventsScene.tsx
🟢 src/queries/validators.js stays out of src/scenes/activity/explore/EventsScene.tsx
🟢 src/scenes/web-analytics/LiveMetricsDashboard/LiveWebAnalyticsMetrics.tsx stays out of src/scenes/web-analytics/WebAnalyticsScene.tsx
🟢 products/product_analytics/frontend/insights/trends/WorldMap/countryVectors.tsx stays out of src/scenes/web-analytics/WebAnalyticsScene.tsx
🟢 src/scenes/settings/SettingsMap.tsx stays out of src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
🟢 @jspm/core/nodelibs/browser/fs stays out of src/scenes/session-recordings/detail/SessionRecordingDetail.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.7 KiB ../node_modules/.pnpm/@[email protected]/node_modules/@jspm/core/nodelibs/browser/process.js
4.0 KiB ../node_modules/.pnpm/[email protected]/node_modules/scheduler/cjs/scheduler.production.min.js
1.7 KiB ../node_modules/.pnpm/[email protected]/node_modules/base64-js/index.js
1.6 KiB src/index.tsx
1.3 KiB src/lib/utils/bootTiming.ts
1.2 KiB src/RootErrorBoundary.tsx
949 B src/scenes/ChunkLoadErrorBoundary.tsx
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
126.8 KiB ../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.production.min.js
99.8 KiB src/products.tsx
86.2 KiB src/lib/api.ts
68.2 KiB src/lib/lemon-ui/icons/icons.tsx
41.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@dnd-kit/core/dist/core.esm.js
36.4 KiB ../node_modules/.pnpm/[email protected]_patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5_react@18.3.1/node_modules/kea/lib/index.cjs.js
27.0 KiB ../node_modules/.pnpm/[email protected]/node_modules/tailwind-merge/dist/bundle-mjs.mjs
24.6 KiB ../node_modules/.pnpm/[email protected]/node_modules/buffer/index.js
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
285.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.8 KiB ../packages/quill/packages/quill/dist/index.js
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.8 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
99.8 KiB src/products.tsx
94.5 KiB ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@tiptap/core/dist/index.js
92.5 KiB ../node_modules/.pnpm/[email protected]/node_modules/prosemirror-view/dist/index.js
86.2 KiB src/lib/api.ts
Largest files eagerly shipped from src/scenes/dashboard/Dashboard.tsx
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
285.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.8 KiB ../packages/quill/packages/quill/dist/index.js
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.8 KiB ../node_modules/.pnpm/[email protected]/node_modules/re2js/build/index.esm.js
144.1 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.production.min.js
99.8 KiB src/products.tsx
94.5 KiB ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@tiptap/core/dist/index.js
92.5 KiB ../node_modules/.pnpm/[email protected]/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
285.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.8 KiB ../packages/quill/packages/quill/dist/index.js
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.8 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
99.8 KiB src/products.tsx
94.5 KiB ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@tiptap/core/dist/index.js
92.5 KiB ../node_modules/.pnpm/[email protected]/node_modules/prosemirror-view/dist/index.js
86.2 KiB src/lib/api.ts
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/ai-first/AiFirstHomepage.tsx
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
285.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.8 KiB ../packages/quill/packages/quill/dist/index.js
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.8 KiB ../node_modules/.pnpm/[email protected]/node_modules/re2js/build/index.esm.js
144.1 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.production.min.js
99.8 KiB src/products.tsx
94.5 KiB ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@tiptap/core/dist/index.js
92.5 KiB ../node_modules/.pnpm/[email protected]/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/activity/explore/EventsScene.tsx
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
285.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.8 KiB ../packages/quill/packages/quill/dist/index.js
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.8 KiB ../node_modules/.pnpm/[email protected]/node_modules/re2js/build/index.esm.js
144.1 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.production.min.js
99.8 KiB src/products.tsx
94.5 KiB ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@tiptap/core/dist/index.js
92.5 KiB ../node_modules/.pnpm/[email protected]/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/web-analytics/WebAnalyticsScene.tsx
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
285.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.8 KiB ../packages/quill/packages/quill/dist/index.js
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
182.9 KiB src/queries/validators.js
153.8 KiB ../node_modules/.pnpm/[email protected]/node_modules/re2js/build/index.esm.js
144.1 KiB ../packages/quill/packages/primitives/dist/index.js
126.8 KiB ../node_modules/.pnpm/[email protected][email protected]/node_modules/react-dom/cjs/react-dom.production.min.js
99.8 KiB src/products.tsx
94.5 KiB ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@tiptap/core/dist/index.js
Largest files eagerly shipped from src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
Size File
322.5 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
316.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/rrweb.js
285.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.8 KiB ../packages/quill/packages/quill/dist/index.js
215.9 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
153.8 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
99.8 KiB src/products.tsx
94.5 KiB ../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@tiptap/core/dist/index.js
92.5 KiB ../node_modules/.pnpm/[email protected]/node_modules/prosemirror-view/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

✅ Toolbar bundle — eager 2.29 MiB within budget

What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.

Metric Size Δ vs base Budget
Eager (shipped)
entry + static imports
2.29 MiB · 18 files no change ████░░░░░░ 40.0% of 5.72 MiB
Deferred (lazy) 2.11 MiB · 40 files no change n/a — loads on demand
Loader dist/toolbar.js 1.2 KiB no change █░░░░░░░░░ 6.0% of 19.5 KiB
Largest eagerly-shipped chunks
Size File
902.0 KiB dist/toolbar/toolbar-app-2NHVD7BP.css
692.2 KiB dist/toolbar/chunk-chunk-KZJS3INZ.js
260.7 KiB dist/toolbar/chunk-chunk-L6XVLVLY.js
131.8 KiB dist/toolbar/chunk-chunk-FDH2IBXT.js
130.4 KiB dist/toolbar/chunk-chunk-LD5GP6L7.js
74.8 KiB dist/toolbar/toolbar-app-VV6PM4RW.js
69.0 KiB dist/toolbar/chunk-chunk-TSAL54PB.js
35.6 KiB dist/toolbar/chunk-chunk-WFB7UOXI.js
21.7 KiB dist/toolbar/chunk-chunk-CRQXLGRI.js
6.8 KiB dist/toolbar/chunk-chunk-DV7IWQNF.js

Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile

✅ Dist folder size — 🔺 +1.0 KiB (+0.0%)

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

Total: 964.37 MiB · 🔺 +1.0 KiB (+0.0%)

ℹ️ MCP UI apps size — 34 app(s), 27969.1 KB JS

Built size of each MCP UI app (main.js + styles.css).

App JS CSS
debug 844.3 KB 209.1 KB
action 767.7 KB 209.1 KB
action-list 835.3 KB 209.1 KB
cohort 766.7 KB 209.1 KB
cohort-list 834.3 KB 209.1 KB
email-template 766.6 KB 209.1 KB
error-details 771.6 KB 209.1 KB
error-issue 768.9 KB 209.1 KB
error-issue-list 836.7 KB 209.1 KB
experiment 832.4 KB 209.1 KB
experiment-list 836.1 KB 209.1 KB
experiment-results 834.9 KB 209.1 KB
feature-flag 834.7 KB 209.1 KB
feature-flag-list 838.4 KB 209.1 KB
feature-flag-testing 770.0 KB 209.1 KB
inline-scan 767.2 KB 209.1 KB
insight-actors 833.8 KB 209.1 KB
llm-costs 831.1 KB 209.1 KB
session-recording 768.9 KB 209.1 KB
survey 768.3 KB 209.1 KB
survey-global-stats 831.1 KB 209.1 KB
survey-list 836.0 KB 209.1 KB
survey-stats 831.1 KB 209.1 KB
trace-span 767.1 KB 209.1 KB
trace-span-list 835.2 KB 209.1 KB
vision-observation-list 834.4 KB 209.1 KB
workflow 767.0 KB 209.1 KB
workflow-list 834.7 KB 209.1 KB
workflow-setup-status 766.7 KB 209.1 KB
query-results 1086.5 KB 209.1 KB
render-ui 1162.4 KB 209.1 KB
visual-review-snapshots 771.6 KB 209.1 KB
workflow-data-suggestions 769.4 KB 209.1 KB
workflow-sending-rules 768.0 KB 209.1 KB
ℹ️ MCP agent API — agent-facing tool changes

What this PR changes for agents, from the tool schema snapshots and tool definitions.

Tools changed (4):

Tool Params Scopes Annotations Schema chars
batch-export-create 27,594 -> 27,660
batch-export-update 27,353 -> 27,419
file-download-batch-exports-count-rows-create 12,140 -> 12,206
file-download-batch-exports-create 18,656 -> 18,722
⚠️ Playwright — 1 flaky

🎭 Playwright report · View test results →

⚠️ 1 flaky test:

  • create experiment via wizard, add metrics, and launch (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this section? Help fix flakies and failures and it will go green!

⚠️ Backend coverage — 97.0% of changed backend lines covered — 10 uncovered

🧪 Backend test coverage

Patch coverage — changed backend lines (products + core): ███████████████████░ 97.0% (380 / 390)

File Patch Uncovered changed lines
products/dashboards/backend/api/dashboard.py 33.3% 590, 3363
products/notebooks/backend/temporal/frame_materialize.py 64.3% 394–395, 557–558, 967
products/batch_exports/backend/temporal/pipeline/internal_stage.py 89.3% 535–536, 538

🤖 Agents: add a test only if an uncovered line exposes a realistic regression that existing tests miss. Otherwise explain why no new test is needed under "How did you test this code?". Gap list: the patch-coverage artifact on this run (gh run download 530024966107572 -n patch-coverage), or the coverage-data block at the end of this comment.

Per-product line coverage (touched products)
Product Coverage Lines
platform_features ██░░░░░░░░░░░░░░░░░░ 12.1% 7 / 58
demo ███████████░░░░░░░░░ 56.3% 1,540 / 2,736
data_tools ████████████░░░░░░░░ 60.9% 95 / 156
warehouse_sources_queue █████████████░░░░░░░ 65.2% 2,157 / 3,306
authorization ████████████████░░░░ 79.7% 181 / 227
batch_exports ████████████████░░░░ 81.6% 22,921 / 28,083
apm █████████████████░░░ 84.1% 1,306 / 1,553
engineering_analytics █████████████████░░░ 85.0% 11,463 / 13,482
commands █████████████████░░░ 85.5% 1,618 / 1,893
mcp_analytics █████████████████░░░ 86.2% 5,720 / 6,638
ml_inference █████████████████░░░ 86.3% 524 / 607
posthog_ai ██████████████████░░ 87.9% 4,296 / 4,886
notebooks ██████████████████░░ 88.5% 15,342 / 17,338
dashboards ██████████████████░░ 88.6% 7,710 / 8,706
warehouse_suggestions ██████████████████░░ 88.6% 3,047 / 3,438
mcp_registry ██████████████████░░ 89.0% 1,596 / 1,794
webmcp ██████████████████░░ 89.6% 240 / 268
cohorts ██████████████████░░ 89.7% 8,585 / 9,575
product_tours ██████████████████░░ 89.7% 1,355 / 1,510
signals ██████████████████░░ 89.8% 84,756 / 94,384
visual_review ██████████████████░░ 90.6% 9,858 / 10,875
tasks ██████████████████░░ 90.7% 80,867 / 89,128
managed_warehouse ██████████████████░░ 91.0% 12,218 / 13,425
data_warehouse ██████████████████░░ 91.1% 15,273 / 16,768
canvas ██████████████████░░ 91.1% 7,998 / 8,776
aeo ██████████████████░░ 91.2% 1,602 / 1,756
today ██████████████████░░ 91.2% 3,798 / 4,163
data_modeling ██████████████████░░ 91.4% 10,507 / 11,492
autoresearch ██████████████████░░ 91.4% 11,618 / 12,705
cdp ██████████████████░░ 91.5% 10,251 / 11,206
business_knowledge ██████████████████░░ 91.6% 10,017 / 10,934
metrics ██████████████████░░ 91.7% 10,625 / 11,588
slack_app ██████████████████░░ 91.7% 21,398 / 23,330
wizard ██████████████████░░ 91.7% 6,870 / 7,490
streamlit_apps ██████████████████░░ 91.9% 3,139 / 3,415
error_tracking ██████████████████░░ 92.1% 18,833 / 20,454
conversations ██████████████████░░ 92.2% 30,216 / 32,776
review_hog ██████████████████░░ 92.2% 17,749 / 19,244
stamphog ███████████████████░ 92.6% 8,810 / 9,519
early_access_features ███████████████████░ 92.6% 1,339 / 1,446
managed_migrations ███████████████████░ 92.6% 1,630 / 1,760
alerts_platform ███████████████████░ 92.8% 7,522 / 8,108
notifications ███████████████████░ 93.0% 1,199 / 1,289
web_analytics ███████████████████░ 93.3% 25,764 / 27,618
ai_training ███████████████████░ 93.3% 598 / 641
alerts ███████████████████░ 93.3% 9,488 / 10,167
surveys ███████████████████░ 93.4% 6,918 / 7,406
cross_project_dashboards ███████████████████░ 93.4% 880 / 942
approvals ███████████████████░ 93.4% 4,576 / 4,898
exports ███████████████████░ 93.6% 4,161 / 4,447
ai_gateway ███████████████████░ 93.6% 787 / 841
billing_alerts ███████████████████░ 93.7% 2,093 / 2,233
context_layer ███████████████████░ 93.8% 3,981 / 4,244
messaging ███████████████████░ 93.8% 4,705 / 5,015
mcp_store ███████████████████░ 93.9% 9,144 / 9,735
marketing_analytics ███████████████████░ 93.9% 21,227 / 22,598
ai_observability ███████████████████░ 93.9% 29,066 / 30,938
customer_analytics ███████████████████░ 94.1% 27,892 / 29,651
workflows ███████████████████░ 94.2% 22,860 / 24,267
logs ███████████████████░ 94.4% 19,281 / 20,434
legal_documents ███████████████████░ 94.4% 2,313 / 2,451
replay_vision ███████████████████░ 94.5% 31,999 / 33,863
actions ███████████████████░ 94.7% 1,004 / 1,060
reminders ███████████████████░ 94.8% 760 / 802
endpoints ███████████████████░ 94.9% 9,330 / 9,834
growth ███████████████████░ 94.9% 11,347 / 11,959
annotations ███████████████████░ 95.1% 1,095 / 1,151
skills ███████████████████░ 95.3% 7,440 / 7,810
uptime_monitoring ███████████████████░ 95.3% 306 / 321
experiments ███████████████████░ 95.4% 39,202 / 41,090
access_control ███████████████████░ 95.5% 8,105 / 8,491
subscriptions ███████████████████░ 95.6% 13,598 / 14,225
data_catalog ███████████████████░ 95.6% 4,581 / 4,791
product_analytics ███████████████████░ 95.8% 29,860 / 31,173
revenue_analytics ███████████████████░ 95.9% 1,877 / 1,958
feature_flags ███████████████████░ 95.9% 28,362 / 29,585
data_quality ███████████████████░ 96.0% 8,523 / 8,878
tracing ███████████████████░ 96.4% 4,360 / 4,524
warehouse_sources ███████████████████░ 96.5% 475,874 / 493,192
security ███████████████████░ 96.7% 1,549 / 1,602
account_audits ███████████████████░ 96.7% 770 / 796
pulse ███████████████████░ 97.1% 2,023 / 2,083
analytics_platform ████████████████████ 98.0% 2,843 / 2,900
groups ████████████████████ 98.2% 1,838 / 1,871
field_notes ████████████████████ 99.4% 172 / 173

Report-only. Patch coverage = changed backend lines covered vs origin/master. Sorted lowest first.
Known gaps: lines covered only by Temporal tests show as uncovered; core line numbers may drift if master changed the same file.

@aspicer
aspicer added this pull request to stack #122895 October 23, 2026 21:06
@trunk-io

trunk-io Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

Failed Test Failure Summary Logs
Scenes-App/Experiments ExperimentWithHealthFindings play-test The UI test could not find the text “Why?” because the Storybook page remained on a loading spinner. Logs ↗︎
Experiment lifecycle › creation and launch › create experiment via wizard, add metrics, and launch The test failed because waiting for the URL to change timed out after 15 seconds. Logs ↗︎
test_broker_failure_shrinks_the_debounce_slot_to_a_backoff The broker-failure test expected the debounce key to have a short backoff TTL, but the key was missing or had no expiration (TTL returned -2). Logs ↗︎
test_distinct_shapes_are_capped_by_the_team_warm_budget The test expected the throttling key to have a positive expiration time, but the key was missing from Redis. Logs ↗︎

View Full Report ↗︎ ⋅ Docs

@aspicer
aspicer marked this pull request as ready for review October 24, 2026 06:18
@aspicer
aspicer requested a review from a team as a code owner October 24, 2026 06:18
@parameterai

parameterai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Risk: No findings

This increment threads the resolved events-table route through nested reads, precompute revalidation queues, and dashboard tile-group customization. I traced every production change: the route contextvar only selects between two tables holding the same event data (no access boundary), the access-gate rename preserves exact semantics, the batch-export interval filter moved to ClickHouse bind parameters, and the dashboard groups rewrite keeps all validation limits. No new security issues.

Sentinel reviewed 1a48ad2 · Review settings

@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested review from a team October 24, 2026 06:19
@pr-assigner-resolver-posthog

Copy link
Copy Markdown

👀 Auto-assigned reviewers

These soft owners were skipped because they only have minor changes here. Nothing blocks merge, so self-assign if you'd like a look:

  • @PostHog/batch-exports (products/batch_exports/product.yaml)
  • @PostHog/team-growth (frontend/src/scenes/owners.yaml)
  • @PostHog/team-analytics-platform (products/analytics_platform/product.yaml)
  • @PostHog/team-feature-flags (products/cohorts/product.yaml)

Soft owners come from each directory's owners.yaml and each product's product.yaml (resolved nearest-file-wins). For a skipped owner, the locator is the file that decided it. Generated files and lockfiles are ignored when deciding ownership.

@posthog

posthog Bot commented Oct 24, 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.

Install the Visual Review Chrome extension to see visual review results at the top of your pull requests.

aspicer and others added 8 commits October 24, 2026 12:52
A staff cookie reads events_json for every request from that browser, impersonation included. The project switch is the CLICKHOUSE_HOGQL_USE_NEW_EVENTS_SCHEMA_TEAMS instance setting alone; a stored project modifier no longer counts. Routing follows the table: any query that reads events_json starts on the events cluster when CLICKHOUSE_NATIVE_EVENTS_HOST is set, and CLICKHOUSE_NATIVE_EVENTS_TEAMS is deleted.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ute builds

The streamed dashboard load runs after the middleware chain has returned, so it
now serializes tiles inside a copy of the request's context. A precompute job's
identity names the events table it was built from, so a build from events_json
is never served to a legacy read. The instance settings API rejects a project
list that does not parse, since every query reads it.

Two tests ran for the first time on the full matrix and failed: the login-as
view reads a form post, which the API test client only sends when asked, and a
stored project modifier no longer switches the earliest-timestamp lookup.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ng modifiers

The INSERT's printer asks the same switches for its table, so the job identity
only needs the switch's answer. The database-free marketing resolver test pins
the table in both places it is asked, so its hashes no longer depend on a warm
instance-settings cache.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…dentity names

The daily-unique-persons transform keyed the job on the runner's modifiers but
the inline build printed with fresh ones, so a per-query pin plus the person's
cookie could store rows from one events table under the other's identity. The
job now carries the modifiers that made it, and the build prints with them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@aspicer
aspicer force-pushed the aspicer/events-person-switch branch from 1897700 to 1a48ad2 Compare October 24, 2026 19:57

This branch has not been deployed

No deployments
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