Skip to content

feat(data-warehouse): add a trino variant of the data ops scene - #110369

Merged
trunk-io[bot] merged 24 commits into
masterfrom
eric/data-ops-trino-variant-backend
Oct 13, 2026
Merged

trunk-io[bot] merged 24 commits into
masterfrom
eric/data-ops-trino-variant-backend

Conversation

@EDsCODE

@EDsCODE EDsCODE commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

  • An organization whose warehouse serves queries through Trino gets a Data ops scene about DuckDB workers, which do not serve its queries.
  • Its Monitoring tab shows worker activity, and its Settings tab offers a Postgres connection its users should not use.
  • The backend has one flag, data-warehouse-scene, and no way to say which query engine a Data ops scene describes.
  • The original monitoring contract is in feat: add tenant-safe Trino monitoring routes and per-org query metrics duckgres#1248. Calls also use the Hogtower adapter when HOGTOWER_API_URL is configured.

Changes

  • A Trino organization gets a Data ops scene about its queries: live query activity, query history, and its Trino connection.
  • A new organization flag, data-warehouse-scene-trino, selects this variant. It wins when both flags are on. No organization has it yet.
  • Nothing changes for an organization that has data-warehouse-scene alone.

Note

One change reaches existing callers. The Overview endpoints for data status and source schemas now return 403 without either flag. They had no flag check before.

Monitoring tab

  • A Trino organization sees six live cards, eight history charts, and a table of the queries in flight.

Trino monitoring tab at 1400px

  • An expanded row shows the source, queue time, CPU time, peak memory, rows read, start time, and the SQL with literal values masked.

Expanded query row

  • A warning banner and dashes replace the live cards when the live data cannot be read. Zeros would read as an idle warehouse.

Live data unavailable

  • A failed refresh keeps the last good data and marks the section that failed.
  • Changing the history range clears the previous range while new metrics load, including when the new request fails.
  • Overview and Monitoring appear only when the warehouse and Trino are both ready. Until then the organization sees Settings.
Monitoring tab at 520px Trino monitoring tab at 520px

Settings tab

  • A Trino organization sees its host, port, catalog, schema, and username, plus a Trino CLI command.

Trino settings, ready

  • The status stays at provisioning while the query engine sets up, and the status poll keeps running until Trino is ready.

Trino settings, query engine setting up

  • A failed setup shows an error banner that tells the user to contact support.

Trino settings, query engine failed

  • The provision form says the warehouse name becomes part of the connection host and catalog.

Trino provision form

  • The reset password dialog says the new password can take up to five minutes to apply.
  • A DuckDB organization's Settings tab does not change. This is that tab rendered from this branch:

DuckDB settings, unchanged

Trino settings at 520px Trino settings at 520px

The Trino tabs are a new surface, so they have no before screenshots. All values in the screenshots are invented.

Backend, MCP, and navigation

  • Named enum classes give Trino metric and lifecycle choices consistent OpenAPI names.
  • The Hogtower adapter forwards both Trino monitoring routes to /api/v2/warehouses/:id/monitoring/trino/, preserving metric and window parameters.
  • managed-warehouse-trino-monitoring/ returns live totals, concurrency and queue limits, and up to 200 in-flight queries.
  • managed-warehouse-trino-monitoring-timeseries/ returns one of nine metrics over a window from 1 hour to 30 days.
  • available: false means the live data could not be read, so zero totals then do not mean an idle warehouse.
  • Each variant gets a 404 from the other variant's monitoring endpoints. The message names the right endpoints and MCP tools.
  • warehouse_status gains a trino block. It stays null until the warehouse is ready, and an unknown Trino state maps to unavailable.
  • The Postgres connection is null for a Trino organization, because its users connect only through Trino.
  • Two MCP tools read the same data behind the new flag and the warehouse_view:read scope.
  • The import registration gate accepts either flag and evaluates each flag on its own. An error on the Trino flag cannot stop a DuckDB organization's imports.
  • Data ops appears in the nav, search, and product lists when either flag is on, through a new alternativeFlags field on nav items. An item without it behaves as before.

Before:

flowchart LR
    Caller[Data ops or MCP tool] --> D[DuckDB monitoring endpoints]
    D --> CPW[Control plane worker routes]
    classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff;
    classDef phRed fill:#f54e00,stroke:#f54e00,color:#fff;
    classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000;
    class Caller phYellow;
    class D phBlue;
    class CPW phRed;
Loading

After:

flowchart LR
    Caller[Data ops or MCP tool] --> D[DuckDB monitoring endpoints]
    Caller --> T[Trino monitoring endpoints]
    D -->|duckdb variant| CPW[Control plane worker routes]
    D -->|trino variant| N[404 naming the other endpoints]
    T -->|duckdb variant| N
    T -->|trino variant| CPT[Control plane Trino routes]
    CPT --> Q[Live query list]
    CPT --> M[Metric history]
    classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff;
    classDef phRed fill:#f54e00,stroke:#f54e00,color:#fff;
    classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000;
    classDef phGray fill:#e5e7eb,stroke:#c7ccd1,color:#000;
    class Caller phYellow;
    class D,T phBlue;
    class CPW,CPT phRed;
    class N,Q,M phGray;
Loading

Where to look first

  • The response serializers are an allow-list. They drop unknown upstream fields, and reject another organization's data or an unexpected series label.
  • data_ops_variant() and dataOpsVariantFromFlags hold the variant rule, once on each side.
  • trinoCombinedStatus folds the warehouse state and the Trino state into the one status a user sees.
  • The Trino contract, tab, and kea logic are near-copies of the DuckDB ones on purpose. The DuckDB path can then be deleted at sunset without untangling shared code.

Mechanical:

  • The generated OpenAPI, MCP, and schema files.
  • The DuckDB monitoring components moved into their own files, so both tabs share them.
  • The internal monitoring doc and the product README.

Keep the Trino flag off until the Django, frontend, and MCP changes are deployed and the production monitoring routes pass a smoke test.

How did you test this code?

Test rationale:

  • The adapter passthrough test now covers both monitoring variants and guards against missing Trino mappings returning 501.
  • The range-change tests check loading, success, and failure without showing the previous range. Existing same-range refresh coverage still checks last-good data.
  • The search-list test covers all flag combinations after master moved filtering into searchListsLogic.
  • test_data_ops_variant_prefers_the_trino_flag catches a flipped precedence or a missing duckdb fallback. The closest existing tests cover is_enabled with one flag.
  • test_data_ops_variant_fails_closed_when_flag_evaluation_errors catches an evaluation error that grants a variant.
  • The two 404 tests catch one variant reading the other variant's monitoring data. The existing monitoring tests cover only the DuckDB path.
  • test_overview_endpoints_require_a_managed_warehouse_flag catches an ungated Overview endpoint. The existing access control tests check scopes, not the flag.
  • test_registration_gate_accepts_either_managed_warehouse_flag catches a Trino-only organization that the gate rejects, and a Trino flag error that blocks a DuckDB organization.
  • The Trino snapshot and timeseries tests catch an internal field, another organization's data, or an invalid metric, window, or label crossing the API.
  • test_trino_status_for_presents_only_customer_safe_fields catches an internal field in the trino block, and any error or unknown state shown as anything but unavailable.
  • test_warehouse_status_skips_the_trino_read_until_the_warehouse_is_ready catches a Trino read against a warehouse that is still provisioning.
  • The MCP filtering test catches the Trino tools appearing without their scope or flag.
  • The isFileSystemImportFlagEnabled cases catch a nav item that hides when only its alternative flag is on. The helper is new.
  • The scene logic cases catch the wrong variant for each flag combination.
  • The Trino monitoring tab tests catch zeros shown for unreadable live data.
  • The Trino monitoring logic tests catch a failed poll that blanks the tab, and a poll that outlives the tab.
  • The trinoCombinedStatus cases catch a wrong status for each pair of warehouse and Trino states. The helper is new.
  • The Settings tab tests catch a psql command shown to a Trino organization, and the Trino branch changing the DuckDB tab.
  • The provisioning logic case catches a status poll that stops while Trino is still setting up.

Most screenshots come from Storybook with mocked API responses. The two ready-state Trino settings screenshots come from a local dev stack against a fake control plane with invented data.

Local follow-up checks: Hogtower adapter and Trino monitoring API tests, Data ops and search frontend suites, MCP tool filtering, frontend and MCP typechecks, API regeneration, and scoped preflight.

The CI follow-up corrects the monitoring fixture type and a pre-existing Tasks completion assertion. The affected Tasks and adapter suites run locally.

Not checked:

  • Nothing ran against a deployed control plane or a live Trino cell. Every upstream response is mocked from the contract in feat: add tenant-safe Trino monitoring routes and per-org query metrics duckgres#1248.
  • The CLI command was not used to connect.
  • The five minute figure comes from the sync intervals in the control plane, not from a measured reset.
  • The DuckDB Monitoring tab was not rendered again after its components moved.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Release status

  • This change is behind a feature flag and is not available to users

Docs update

docs/internal/managed-warehouse-monitoring.md covers the Trino endpoints. No public docs change, because the variant is not available to users.

🤖 Agent context

Follow-up agent: Codex (GPT-6) merged current master, preserved the Hogtower adapter, added Trino monitoring mappings, fixed range changes, and converted the Trino serializer choices to named enums for the current CI rules.

Skills used for the follow-up: signed-git-publish, reviewing-distributed-systems, improving-drf-endpoints, writing-tests, writing-code-comments, writing-ui-components, writing-kea-logics, using-kea-disposables, adopting-generated-api-types, implementing-mcp-tools, writing-user-facing-copy, running-ci-preflight, writing-pr-descriptions, debugging-ci-failures, and depot-ci. The local CodeRabbit CLI is unavailable; the existing bot finding about stale ranges is addressed.

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code. Claude Sonnet 5.5 subagents wrote the code. Claude Opus 5.5 planned and coordinated the work, and wrote the restack and review fixes on 2026-10-06.

  • The work came from one written design and plan. A separate subagent reviewed each task, and one more reviewed the whole branch.
  • This PR opened as a four-PR stack and was combined on 2026-10-06. GitHub shows feat(data-warehouse): add trino monitoring endpoints and mcp tools #110370, feat(data-warehouse): add trino monitoring tab to data ops #110371, and feat(data-warehouse): show trino connection in data ops settings #110372 as merged into this PR's branch. Nothing from them is on master.
  • Restacked onto master on 2026-10-06. Master moved the Today tools filter into scenes/tools/toolsLogic.ts, so the any-flag nav check moved there. Master also removed the Data quality tab from Data ops (chore(data-warehouse): remove data quality tab from data ops #110906).
  • Rebased onto master again on 2026-10-07. Master moved the sidebar product list into navProductItems.ts (refactor(today): extract the nav product list into getNavProductItems #112178), so the any-flag nav check moved there too. Master also stopped listing disabled MCP tools in tools.yaml (feat(mcp): discover tool candidates instead of committing enabled: false stubs #112348), so this PR now adds only the two Trino tool entries there.
  • Skills invoked: superpowers:brainstorming, superpowers:writing-plans, superpowers:subagent-driven-development, superpowers:using-git-worktrees, /stacking-prs, /writing-pr-descriptions, /reviewing-with-coderabbit, /debugging-ci-failures, /writing-tests, /writing-code-comments, /writing-ui-components.
  • CodeRabbit CLI pass: skipped. The CLI was signed out and setup was declined.
  • Bot review threads on the stack, all resolved:
    • Fixed: the register gate skipped the second flag after an error on the first.
    • Fixed: the new tests cast partial status objects. They now use typed fixtures.
    • Covered in this PR: Trino-only nav access, the Trino Monitoring tab, the Trino connection in Settings, and the status poll through Trino setup. Each finding saw only one layer of the stack.
    • Not changed: stopping data_ops_variant() on a Trino flag error. That would lock every DuckDB organization out of Data ops during the error.
    • Not changed: password reset for a Trino organization. duckgres copies the root password hash into Trino, so this reset rotates the Trino password.
    • Not changed: Monitoring stays hidden while the Trino status cannot be read. Settings then says "Couldn't check the query engine status. Refresh to try again."
  • The JDBC URL came out of the Trino connection details on 2026-10-06, so the two ready-state Trino settings screenshots were retaken without it.
  • Reviews changed two things: an unknown Trino state now maps to unavailable rather than pending, and the expanded query row uses the table width.
  • No duplicate: a search of open PRs for the Trino Data ops variant found nothing.
  • Public artifact: no customer material informed this work. Every fixture and screenshot uses invented names and example.com hosts.

🤖 Generated with Claude Code

@trunk-io

trunk-io Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Oct 1, 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) — 12 functions above the limit (max 94)

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.

Function Location Complexity Limit
SettingsTab products/data_warehouse/frontend/scenes/DataOpsScene/tabs/SettingsTab.tsx:107 94 10
queueAction frontend/src/layout/panel-layout/ProjectTree/projectTreeDataLogic.tsx:789 39 10
<anonymous> frontend/src/layout/panel-layout/ProjectTree/projectTreeDataLogic.tsx:1352 26 10
loadWarehouseStatusSuccess products/data_warehouse/frontend/scenes/DataOpsScene/tabs/warehouseProvisioningLogic.ts:688 22 10
<anonymous> frontend/src/lib/components/Search/searchListsLogic.tsx:548 20 10
TrinoMonitoringTab products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoMonitoringTab.tsx:99 18 10
<anonymous> frontend/src/layout/panel-layout/navbar/tabs/flat-nav/flatNavLogic.ts:55 14 10
MonitoringTab products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringTab.tsx:284 14 10
loadFolder frontend/src/layout/panel-layout/ProjectTree/projectTreeDataLogic.tsx:1837 12 10
insightNew frontend/src/products.tsx:1677 12 10
<anonymous> frontend/src/lib/components/Search/searchListsLogic.tsx:324 11 10
SummaryCards products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringTab.tsx:124 11 10
✅ Duplication (Python) — clean

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.

⚠️ Duplication (TypeScript) — 7 new duplicated blocks (worst 478 tokens)

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.

First copy Second copy Lines Tokens
products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseMonitoringLogic.ts:286 products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseTrinoMonitoringLogic.ts:269 83 478
products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseMonitoringLogic.ts:192 products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseTrinoMonitoringLogic.ts:177 25 152
frontend/src/products.tsx:2450 products/data_warehouse/manifest.tsx:162 28 123
products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringTab.tsx:263 products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoHistoricalCharts.tsx:101 20 104
products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringTab.tsx:299 products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoMonitoringTab.tsx:114 24 94
products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseMonitoringLogic.ts:263 products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseTrinoMonitoringLogic.ts:252 17 92
products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringTab.tsx:219 products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoHistoricalCharts.tsx:45 12 73
⚠️ Bundle size — 🔺 +16.7 KiB (+0.0%)

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

Total: 75.76 MiB · 🔺 +16.7 KiB (+0.0%)

File Size Δ vs base
posthog-app/_parent/products/data_warehouse/frontend/scenes/DataOpsScene/DataWarehouseScene.js 65.4 KiB 🔺 +16.0 KiB (+32.4%)

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
1002.4 KiB · 23 files 🔺 +379 B (+0.0%) █████████░ 85.5% 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.86 MiB · 604 files 🔺 +484 B (+0.0%) █████████░ 94.2% of 3.03 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
7.29 MiB · 2,514 files 🔺 +1.1 KiB (+0.0%) ██████████ 95.3% of 7.64 MiB
dashboard scene
src/scenes/dashboard/Dashboard.tsx
9.53 MiB · 3,598 files 🔺 +1.1 KiB (+0.0%) █████████░ 92.5% of 10.30 MiB
today home path
src/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx
7.31 MiB · 2,524 files 🔺 +1.1 KiB (+0.0%) █████████░ 92.6% of 7.89 MiB
events scene
src/scenes/activity/explore/EventsScene.tsx
9.12 MiB · 3,433 files 🔺 +1.1 KiB (+0.0%) █████████░ 92.3% of 9.88 MiB
replay detail scene
src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
11.90 MiB · 4,275 files 🔺 +1.1 KiB (+0.0%) ████████░░ 79.1% of 15.05 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
🟢 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/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
🟢 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

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
1.3 KiB src/index.tsx
912 B ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js
839 B src/scenes/ChunkLoadErrorBoundary.tsx
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
Size File
319.8 KiB ../node_modules/.pnpm/posthog-js@1.438.8_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
220.8 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
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
101.6 KiB src/products.tsx
99.6 KiB src/lib/api.ts
69.0 KiB src/lib/lemon-ui/icons/icons.tsx
38.7 KiB ../node_modules/.pnpm/@dnd-kit+core@6.0.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@dnd-kit/core/dist/core.esm.js
33.9 KiB ../node_modules/.pnpm/kea@4.0.0-pre.6_patch_hash=139b8d1f1304f9d9da452a9a1244c94ea679dbcb85687d8999563146879fb6f5_react@18.3.1/node_modules/kea/lib/index.cjs.js
28.6 KiB src/scenes/scenes.ts
27.6 KiB src/lib/constants.tsx
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
319.8 KiB ../node_modules/.pnpm/posthog-js@1.438.8_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
280.8 KiB src/taxonomy/core-filter-definitions-by-group.json
220.8 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
153.7 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
113.0 KiB ../packages/quill/packages/quill/dist/index.js
101.6 KiB src/products.tsx
99.6 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
90.6 KiB ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js
Largest files eagerly shipped from src/scenes/dashboard/Dashboard.tsx
Size File
319.8 KiB ../node_modules/.pnpm/posthog-js@1.438.8_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
280.8 KiB src/taxonomy/core-filter-definitions-by-group.json
220.8 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
181.9 KiB src/queries/validators.js
153.7 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
113.0 KiB ../packages/quill/packages/quill/dist/index.js
101.6 KiB src/products.tsx
99.6 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/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
319.8 KiB ../node_modules/.pnpm/posthog-js@1.438.8_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
280.8 KiB src/taxonomy/core-filter-definitions-by-group.json
220.8 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
153.7 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
113.0 KiB ../packages/quill/packages/quill/dist/index.js
101.6 KiB src/products.tsx
99.6 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
90.6 KiB ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js
Largest files eagerly shipped from src/scenes/activity/explore/EventsScene.tsx
Size File
319.8 KiB ../node_modules/.pnpm/posthog-js@1.438.8_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
280.8 KiB src/taxonomy/core-filter-definitions-by-group.json
220.8 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
181.9 KiB src/queries/validators.js
153.7 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
113.0 KiB ../packages/quill/packages/quill/dist/index.js
101.6 KiB src/products.tsx
99.6 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
Largest files eagerly shipped from src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
Size File
319.8 KiB ../node_modules/.pnpm/posthog-js@1.438.8_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs
316.0 KiB ../node_modules/.pnpm/posthog-js@1.438.8_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js
280.8 KiB src/taxonomy/core-filter-definitions-by-group.json
220.8 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
181.9 KiB src/queries/validators.js
153.7 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
113.0 KiB ../packages/quill/packages/quill/dist/index.js
101.6 KiB src/products.tsx
99.6 KiB src/lib/api.ts

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.23 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.23 MiB · 19 files 🔺 +437 B (+0.0%) ████░░░░░░ 39.0% of 5.72 MiB
Deferred (lazy) 2.10 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
872.2 KiB dist/toolbar/toolbar-app-W7JAUACF.css
663.8 KiB dist/toolbar/chunk-chunk-5ARO34UB.js
257.8 KiB dist/toolbar/chunk-chunk-XKSBXSLG.js
131.8 KiB dist/toolbar/chunk-chunk-FDH2IBXT.js
129.6 KiB dist/toolbar/chunk-chunk-6YGXEUMC.js
74.7 KiB dist/toolbar/toolbar-app-E5ULFF3R.js
69.0 KiB dist/toolbar/chunk-chunk-TSAL54PB.js
35.6 KiB dist/toolbar/chunk-chunk-N2YRQU46.js
21.7 KiB dist/toolbar/chunk-chunk-CRQKSBYE.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 — 🔺 +184.5 KiB (+0.0%)

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

Total: 1007.74 MiB · 🔺 +184.5 KiB (+0.0%)

ℹ️ MCP UI apps size — 32 app(s), 17274.0 KB JS

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

App JS CSS
debug 598.2 KB 206.2 KB
action 454.4 KB 206.2 KB
action-list 564.5 KB 206.2 KB
cohort 453.4 KB 206.2 KB
cohort-list 563.5 KB 206.2 KB
email-template 453.2 KB 206.2 KB
error-details 469.9 KB 206.2 KB
error-issue 454.8 KB 206.2 KB
error-issue-list 565.1 KB 206.2 KB
experiment 561.6 KB 206.2 KB
experiment-list 565.3 KB 206.2 KB
experiment-results 566.6 KB 206.2 KB
feature-flag 567.1 KB 206.2 KB
feature-flag-list 570.9 KB 206.2 KB
feature-flag-testing 457.6 KB 206.2 KB
inline-scan 453.9 KB 206.2 KB
insight-actors 562.7 KB 206.2 KB
llm-costs 559.6 KB 206.2 KB
session-recording 455.7 KB 206.2 KB
survey 455.0 KB 206.2 KB
survey-global-stats 562.2 KB 206.2 KB
survey-list 565.2 KB 206.2 KB
survey-stats 562.2 KB 206.2 KB
trace-span 453.8 KB 206.2 KB
trace-span-list 564.4 KB 206.2 KB
vision-observation-list 563.6 KB 206.2 KB
workflow 453.8 KB 206.2 KB
workflow-list 563.9 KB 206.2 KB
loops-review 458.1 KB 206.2 KB
query-results 815.9 KB 206.2 KB
render-ui 899.5 KB 206.2 KB
visual-review-snapshots 458.3 KB 206.2 KB
ℹ️ MCP agent API — agent-facing tool changes

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

Tools added (2): managed-warehouse-trino-metric-history-get, managed-warehouse-trino-monitoring-get

⚠️ Playwright — 2 flaky

🎭 Playwright report · View test results →

⚠️ 2 flaky tests:

  • Redirect to appropriate place after login (chromium)
  • Logout in another tab results in logout in the current tab too (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 — 96.0% of changed backend lines covered — 15 uncovered

🧪 Backend test coverage

Patch coverage — changed backend lines (products + core): ███████████████████░ 96.0% (379 / 394)

File Patch Uncovered changed lines
products/managed_warehouse/backend/presentation/views.py 81.2% 64–67, 74–76, 1157, 1159, 1178, 1228, 1237
products/data_warehouse/backend/presentation/managed_warehouse_trino_monitoring.py 97.4% 178, 182
products/data_warehouse/backend/presentation/views/data_warehouse.py 98.1% 1592

🤖 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 38312301391 -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 ███████████░░░░░░░░░ 55.8% 1,506 / 2,699
data_tools ████████████░░░░░░░░ 61.2% 90 / 147
warehouse_sources_queue █████████████░░░░░░░ 66.8% 1,922 / 2,878
aeo ███████████████░░░░░ 76.3% 617 / 809
batch_exports ████████████████░░░░ 80.2% 21,426 / 26,728
github_commands █████████████████░░░ 83.7% 977 / 1,167
apm █████████████████░░░ 84.1% 1,306 / 1,553
engineering_analytics █████████████████░░░ 84.9% 11,355 / 13,374
mcp_analytics █████████████████░░░ 85.7% 4,844 / 5,651
ml_inference █████████████████░░░ 86.3% 524 / 607
warehouse_suggestions █████████████████░░░ 87.3% 2,252 / 2,580
posthog_ai ██████████████████░░ 87.7% 4,226 / 4,817
notebooks ██████████████████░░ 88.4% 15,201 / 17,196
today ██████████████████░░ 88.6% 2,866 / 3,233
mcp_registry ██████████████████░░ 89.0% 1,596 / 1,794
product_tours ██████████████████░░ 89.1% 1,337 / 1,500
dashboards ██████████████████░░ 89.4% 7,322 / 8,194
webmcp ██████████████████░░ 89.6% 240 / 268
cohorts ██████████████████░░ 89.6% 8,458 / 9,438
cdp ██████████████████░░ 89.9% 6,829 / 7,599
signals ██████████████████░░ 90.0% 69,588 / 77,352
data_modeling ██████████████████░░ 90.1% 10,856 / 12,043
ai_training ██████████████████░░ 90.4% 349 / 386
tasks ██████████████████░░ 90.6% 80,856 / 89,222
visual_review ██████████████████░░ 90.7% 9,842 / 10,856
data_warehouse ██████████████████░░ 90.9% 15,096 / 16,607
canvas ██████████████████░░ 91.0% 7,804 / 8,580
exports ██████████████████░░ 91.0% 9,763 / 10,732
business_knowledge ██████████████████░░ 91.0% 8,791 / 9,656
autoresearch ██████████████████░░ 91.1% 10,436 / 11,453
managed_warehouse ██████████████████░░ 91.3% 11,136 / 12,202
error_tracking ██████████████████░░ 91.6% 16,797 / 18,328
wizard ██████████████████░░ 91.7% 6,027 / 6,571
streamlit_apps ██████████████████░░ 91.9% 3,139 / 3,415
stamphog ██████████████████░░ 92.0% 8,243 / 8,964
conversations ██████████████████░░ 92.0% 29,714 / 32,284
early_access_features ███████████████████░ 92.6% 1,339 / 1,446
managed_migrations ███████████████████░ 92.6% 1,630 / 1,760
alerts ███████████████████░ 92.9% 7,246 / 7,797
surveys ███████████████████░ 93.1% 6,626 / 7,118
review_hog ███████████████████░ 93.1% 16,014 / 17,201
web_analytics ███████████████████░ 93.1% 24,961 / 26,811
notifications ███████████████████░ 93.2% 1,152 / 1,236
approvals ███████████████████░ 93.4% 4,526 / 4,848
cross_project_dashboards ███████████████████░ 93.4% 880 / 942
slack_app ███████████████████░ 93.5% 14,854 / 15,882
context_layer ███████████████████░ 93.7% 3,409 / 3,640
marketing_analytics ███████████████████░ 93.8% 20,074 / 21,402
messaging ███████████████████░ 93.8% 4,468 / 4,762
billing_alerts ███████████████████░ 93.9% 2,090 / 2,226
customer_analytics ███████████████████░ 93.9% 26,079 / 27,773
mcp_store ███████████████████░ 93.9% 9,008 / 9,593
experiments ███████████████████░ 94.1% 33,985 / 36,106
ai_observability ███████████████████░ 94.2% 26,434 / 28,069
replay_vision ███████████████████░ 94.3% 30,070 / 31,884
legal_documents ███████████████████░ 94.3% 2,289 / 2,427
logs ███████████████████░ 94.5% 15,850 / 16,770
actions ███████████████████░ 94.6% 973 / 1,029
reminders ███████████████████░ 94.8% 760 / 802
endpoints ███████████████████░ 94.8% 9,333 / 9,847
skills ███████████████████░ 94.8% 7,061 / 7,445
growth ███████████████████░ 94.8% 11,268 / 11,880
metrics ███████████████████░ 94.9% 6,730 / 7,089
annotations ███████████████████░ 95.0% 816 / 859
tracing ███████████████████░ 95.2% 3,631 / 3,815
data_catalog ███████████████████░ 95.5% 4,419 / 4,628
access_control ███████████████████░ 95.6% 7,881 / 8,245
product_analytics ███████████████████░ 95.7% 28,723 / 29,999
alerts_platform ███████████████████░ 95.8% 5,012 / 5,234
revenue_analytics ███████████████████░ 95.9% 1,878 / 1,959
data_quality ███████████████████░ 95.9% 8,569 / 8,933
feature_flags ███████████████████░ 96.2% 26,932 / 27,997
warehouse_sources ███████████████████░ 96.4% 457,949 / 475,107
security ███████████████████░ 96.7% 1,452 / 1,501
pulse ███████████████████░ 97.4% 2,023 / 2,078
analytics_platform ████████████████████ 98.0% 2,775 / 2,833
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.

✅ Hogbox preview — ready, open the preview

▶ 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 11eb36a · box box-db682e64e446 · ready in 1338s (push → usable) · build log · rebuilds on every push, torn down on close

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Retrigger

[Medium risk] Adds a Trino variant to the data warehouse monitoring interface.

The PR does not appear safe to merge while Trino monitoring can present old metrics as the selected time range.

Reviews (2) · Last reviewed commit: "chore(nav): format the nav item flag che..." · Reviewed by Greptile

Comment thread products/managed_warehouse/backend/presentation/views.py
Comment thread products/managed_warehouse/backend/presentation/views.py
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
  • Review profile: QUIET
  • Plan: Enterprise
  • Run ID: 1372550e-86fd-4e61-aeae-2991aea5b64e

📥 Commits

Reviewing files that changed from the base of the PR and between d738666 and 4316d7f.


⛔ Files ignored due to path filters (4)
  • products/data_warehouse/frontend/generated/api.schemas.ts is excluded by !**/generated/**
  • products/data_warehouse/frontend/generated/api.ts is excluded by !**/generated/**
  • services/mcp/src/generated/data_warehouse/api.ts is excluded by !**/generated/**
  • services/mcp/src/tools/generated/data_warehouse.ts is excluded by !**/generated/**

📒 Files selected for processing (14)
  • frontend/src/layout/panel-layout/navbar/tabs/navProductItems.ts
  • frontend/src/lib/components/Search/searchLogic.tsx
  • frontend/src/lib/constants.tsx
  • frontend/src/products.tsx
  • frontend/src/queries/schema.json
  • frontend/src/queries/schema/schema-general.ts
  • posthog/schema.py
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/SettingsTab.test.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoConnectionDetails.tsx
  • products/data_warehouse/mcp/tools.yaml
  • services/mcp/schema/generated-tool-definitions.json
  • services/mcp/schema/tool-definitions-all.json
  • services/mcp/src/api/generated.ts
  • services/mcp/tests/unit/tool-filtering.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.



📝 Walkthrough

Walkthrough

Adds a Trino variant of managed Data Warehouse, including status and monitoring APIs, frontend settings and monitoring views, and MCP tools. Adds a Trino feature flag that takes precedence over the existing warehouse flag. File-system imports now support alternative feature flags, and product visibility filters use the shared flag predicate.


Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 4316d

Earlier review concerns about flag-evaluation error handling and rollout ordering are still open. Resolve or explicitly accept them before merging, and keep the Trino flag off until the control-plane work is deployed.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 4316d

Access to the new warehouse views is gated, but query privacy and copied command safety depend on upstream behavior that has not been fully verified. No exploitable security issue has been established.

Retained concerns

  • Medium · security · inferred: The new SQL-bearing API and MCP surface depends on external organization-scoped retrieval and SQL sanitization. Local validation checks response identity and structure, but does not establish that query records belong to that organization or that literals and comments were removed. This is an unresolved confidentiality contract, not verified leakage.
  • Low · security · inferred: The newly copied CLI command interpolates host, catalog, and username without shell quoting, while the local presenter checks only types, nonempty values, and the port range. Shell injection would additionally require attacker influence over those upstream fields and a user executing the copied text; neither attacker influence nor an exploit is established.
Security review details

Security Blast Radius

  • inferred — The new monitoring surface represents an organization's warehouse, reachable through an authorized project API and qualifying MCP credentials. It distributes query metadata and SQL, not merely aggregate metrics. Declared organization mismatches are rejected, but actual record ownership still depends on the external producer.

Security Findings and Attack Paths

  • inferred — The deferred command-injection path requires malicious upstream connection text, successful presentation/copy, and manual execution in a user's shell. No browser-side shell execution is present, and upstream attacker control remains unknown. Query disclosure likewise remains conditional on missing producer scoping or masking; neither path is a verified finding.

Trust Boundaries and Controls

  • observed — Monitoring actions explicitly require warehouse_view:read and enforce variant checks. MCP tools separately require that scope and the Trino flag. Warehouse status inherits authentication and membership permissions; its unclassified action is rejected for scoped token access rather than implicitly bypassing scope enforcement.

Resilience and Maintainability Implications

  • observed — Response validation rejects organization and metric mismatches and unexpected metric labels. Trino status reduces malformed or unsupported upstream responses to unavailable without a connection. These controls contain malformed responses but do not validate the semantic ownership or sanitization of otherwise well-shaped query text.

Hardening Proposals

  • proposed — Before enabling the variant, verify the external query-scoping and SQL-masking contract with adversarial tenant and sensitive-literal cases. Establish shell-safe argument encoding for copied connection commands independently of upstream writer validation.

Pre-merge checks · Passed 1
Passed Passed checks (1 passed)
Check name Status Explanation
Description check Passed The description is complete and follows the repository template. It explains the problem, user-visible changes, screenshots, testing rationale and limitations, release status, documentation, agent con…

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: PostHog/posthog/.coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: 03d3fe02-2b22-41fc-bdb5-57ba7174dbd8

📥 Commits

Reviewing files that changed from the base of the PR and between 9fc672e and 94a785b.

📒 Files selected for processing (10)
  • products/data_warehouse/backend/presentation/views/data_warehouse.py
  • products/data_warehouse/backend/tests/api/test_data_warehouse.py
  • products/data_warehouse/backend/tests/api/test_managed_warehouse_monitoring.py
  • products/data_warehouse/backend/tests/api/test_misc_warehouse_viewsets_access_control.py
  • products/managed_warehouse/backend/README.md
  • products/managed_warehouse/backend/facade/feature_flags.py
  • products/managed_warehouse/backend/presentation/views.py
  • products/managed_warehouse/backend/temporal/ducklake_register_data_imports_workflow.py
  • products/managed_warehouse/backend/tests/api/test_presentation.py
  • products/managed_warehouse/backend/tests/temporal/test_ducklake_register_data_imports_workflow.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

Comment thread products/managed_warehouse/backend/presentation/views.py
@EDsCODE
EDsCODE force-pushed the eric/data-ops-trino-variant-backend branch from 94a785b to ddfc5e9 Compare October 6, 2026 09:11
@hosthog

hosthog Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

HostHog preview — posthog-desktop-web

The previews for this PR have been torn down and no longer serve.

@coderabbitai coderabbitai 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.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
products/data_warehouse/backend/presentation/views/data_warehouse.py-1393-1394 (1)

1393-1394: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep data-warehouse-scene-trino disabled until the Trino monitoring routes ship.

When this organization flag is enabled, both existing monitoring actions return 404 before their upstream calls, and this head does not register the Trino routes. Trino organizations can therefore have no monitoring endpoint during this rollout. Keep the flag off until those routes deploy, or include the routes in the same rollout.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
  • Review profile: QUIET
  • Plan: Enterprise
  • Run ID: 07a41c42-bc9b-4e8c-83ac-30921fb9bfa6
📥 Commits

Reviewing files that changed from the base of the PR and between 94a785b and ddfc5e9.

📒 Files selected for processing (4)
  • products/data_warehouse/backend/presentation/views/data_warehouse.py
  • products/managed_warehouse/backend/README.md
  • products/managed_warehouse/backend/temporal/ducklake_register_data_imports_workflow.py
  • products/managed_warehouse/backend/tests/temporal/test_ducklake_register_data_imports_workflow.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@EDsCODE
EDsCODE removed this pull request from stack #110373 October 6, 2026 09:38
@EDsCODE EDsCODE changed the title feat(data-warehouse): add trino data ops variant flag and gates feat(data-warehouse): add a trino variant of the data ops scene Oct 6, 2026

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
products/data_warehouse/backend/presentation/managed_warehouse_trino_monitoring.py (1)

153-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Merge the duplicated series validator.

serialize_trino_monitoring_series repeats serialize_monitoring_series line for line. The only difference is the label allow-list. Give the shared function an allowed_labels mapping parameter and call it from both modules. The current code says the same thing twice, so a later change to one validator can miss the other.

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
  • Review profile: QUIET
  • Plan: Enterprise
  • Run ID: 3d90ff53-e241-4913-9dd7-685df6538601
📥 Commits

Reviewing files that changed from the base of the PR and between ddfc5e9 and d738666.

⛔ Files ignored due to path filters (4)
  • products/data_warehouse/frontend/generated/api.schemas.ts is excluded by !**/generated/**
  • products/data_warehouse/frontend/generated/api.ts is excluded by !**/generated/**
  • services/mcp/src/generated/data_warehouse/api.ts is excluded by !**/generated/**
  • services/mcp/src/tools/generated/data_warehouse.ts is excluded by !**/generated/**
📒 Files selected for processing (55)
  • docs/internal/managed-warehouse-monitoring.md
  • frontend/src/layout/panel-layout/ProjectTree/projectTreeDataLogic.tsx
  • frontend/src/layout/panel-layout/navbar/tabs/flat-nav/flatNavLogic.ts
  • frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts
  • frontend/src/lib/components/NavPanelAdvertisement/navPanelProductPushAdLogic.ts
  • frontend/src/lib/components/Search/searchLogic.tsx
  • frontend/src/lib/constants.tsx
  • frontend/src/lib/utils/fileSystemImportFlags.test.ts
  • frontend/src/lib/utils/fileSystemImportFlags.ts
  • frontend/src/products.tsx
  • frontend/src/queries/schema.json
  • frontend/src/queries/schema/schema-general.ts
  • frontend/src/scenes/library/libraryLogic.ts
  • frontend/src/scenes/settings/user/SidebarSettings.tsx
  • frontend/src/scenes/tools/toolsLogic.ts
  • posthog/schema.py
  • products/data_warehouse/backend/presentation/managed_warehouse_monitoring.py
  • products/data_warehouse/backend/presentation/managed_warehouse_trino_monitoring.py
  • products/data_warehouse/backend/presentation/views/data_warehouse.py
  • products/data_warehouse/backend/tests/api/test_data_warehouse.py
  • products/data_warehouse/backend/tests/api/test_managed_warehouse_monitoring.py
  • products/data_warehouse/backend/tests/api/test_managed_warehouse_trino_monitoring.py
  • products/data_warehouse/frontend/scenes/DataOpsScene/DataWarehouseScene.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/dataOpsVariant.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/dataWarehouseSceneLogic.test.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/dataWarehouseSceneLogic.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringChart.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringMetricCard.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringSection.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/MonitoringTab.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/SettingsTab.test.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/SettingsTab.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoConnectionDetails.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoHistoricalCharts.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoMonitoringSummaryCards.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoMonitoringTab.test.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoMonitoringTab.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/TrinoQueryDetails.tsx
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseTrinoMonitoringLogic.test.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/managedWarehouseTrinoMonitoringLogic.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/monitoringChartData.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/trinoMonitoringFormat.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/trinoWarehouseStatus.test.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/trinoWarehouseStatus.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/warehouseProvisioningLogic.test.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/warehouseProvisioningLogic.ts
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/warehouseStatusFixtures.ts
  • products/data_warehouse/manifest.tsx
  • products/data_warehouse/mcp/tools.yaml
  • products/managed_warehouse/backend/presentation/views.py
  • products/managed_warehouse/backend/tests/api/test_presentation.py
  • services/mcp/schema/generated-tool-definitions.json
  • services/mcp/schema/tool-definitions-all.json
  • services/mcp/src/api/generated.ts
  • services/mcp/tests/unit/tool-filtering.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 7 remain after this review.

@EDsCODE
EDsCODE force-pushed the eric/data-ops-trino-variant-backend branch from d738666 to ee0f7e2 Compare October 6, 2026 10:07
@trunk-io

trunk-io Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

Failed Test Failure Summary Logs
Scenes-App/Project Homepage ProjectHomepage smoke-test The test timed out while waiting for loading indicators or spinners to disappear. Logs ↗︎
Scenes-App/Notebooks/Nodes/Customer Journey AllStepsCompleted smoke-test The test timed out while waiting for an element with the class '.react-flow__node' to become visible. Logs ↗︎
Auth › Redirect to appropriate place after login The browser navigation to the activity events page was aborted. Logs ↗︎
Auth › Logout in another tab results in logout in the current tab too The page reload was aborted, possibly because the frame was detached. Logs ↗︎

View Full Report ↗︎ ⋅ Docs

EDsCODE and others added 9 commits October 7, 2026 14:45
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ster gate

An error evaluating the new Trino flag skipped the existing flag, so a
DuckDB organization could skip import registration.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
EDsCODE and others added 4 commits October 7, 2026 14:45
…ttings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… tests

The Trino settings, status and polling tests cast partial status objects,
which hid any drift from the generated API type.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ails

The Trino settings keep the connection fields and the Trino CLI command.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@EDsCODE
EDsCODE force-pushed the eric/data-ops-trino-variant-backend branch from 380bd85 to 21c8134 Compare October 7, 2026 12:47
@EDsCODE
EDsCODE marked this pull request as ready for review October 7, 2026 12:52
@parameterai

parameterai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Risk: No findings

This follow-up increment removes unused frontend feature-flag constants, fixes a test fixture type in the Hogtower adapter suite, and expands the tasks API provenance tests to cover mobile and web client provenance. No production code changed, and no new security issues are introduced.

Sentinel reviewed 11eb36a · Review settings

@github-actions
github-actions Bot requested a deployment to preview-pr-110369 October 7, 2026 12:52 In progress
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested review from a team October 7, 2026 12:52
@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/team-growth (frontend/src/lib/components/owners.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.

@bill-ph bill-ph 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.

Reviewed the variant rule (data_ops_variant / dataOpsVariantFromFlags), the new Trino monitoring endpoints and allow-list serializers, trino_status_for and the warehouse_status changes, the per-flag import registration gate, the new 403 gate on the Overview endpoints, the alternativeFlags nav helper and its call sites, and the Trino scene/settings/monitoring logic. The cross-variant 404s, the org-id check reused from serialize_monitoring_response, the fail-closed flag evaluation, and the fact that the flag stays off until duckgres#1248 ships all look right. I didn't repeat the points already raised in the greptile/CodeRabbit threads (password reset for Trino orgs, keeping DuckDB on a Trino flag error, stale chart data after a range change).

P2

  • Trino snapshot shows SQL text and usernames from the whole organization (managed_warehouse_trino_monitoring.py): the DuckDB snapshot returns only counts and session state. This endpoint returns user and the masked query for every in-flight query in the org. Any member with project-level warehouse_view:read can call it, including through MCP or a personal API key. In an org with several projects and project-level access control, a user who can only see project A would see table, column and schema names from queries against project B's schema. Literal masking doesn't hide those. Consider filtering to the current team's schema or user, or requiring org admin for the query list, or at least note the decision in the internal doc.
  • not_enabled right after the warehouse becomes ready stops the status poll (trinoWarehouseStatus.ts / warehouseProvisioningLogic.ts): the poll only continues for pending/provisioning. If the control plane hasn't created the Trino row yet when the warehouse turns ready, /trino returns enabled: false. The poll then stops and the user gets "isn't set up ... Contact support" until a manual refresh. Worth confirming against duckgres#1248 that the Trino row exists before the warehouse reports ready for orgs on this flag. If that isn't guaranteed, keep polling briefly on not_enabled.

Inline comments

  • products/data_warehouse/backend/presentation/managed_warehouse_trino_monitoring.py:92 — P2: This exposes masked SQL plus user for every in-flight query in the org. The DuckDB snapshot only returns counts and session state. A member scoped to one project, with warehouse_view:read through the UI, MCP or an API key, would see table, column and schema names from other projects' queries. Consider scoping to the team's schema or user, or gating the query list on org admin.
  • products/data_warehouse/frontend/scenes/DataOpsScene/tabs/trinoWarehouseStatus.ts:46 — P2: If the warehouse reaches ready before the control plane creates the Trino row, this branch is hit and the provisioning poll stops, because it only continues for pending/provisioning. The user sees "Contact support" until a refresh. Please confirm duckgres guarantees the ordering, or keep polling on not_enabled for a short grace period.

— Robo Bill v2 (opus, high reasoning)

@fuziontech fuziontech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was generated by an automated review agent on behalf of @fuziontech.

Summary & Assessment: APPROVE

This PR cleanly introduces the Trino variant for the Data Ops scene (data-warehouse-scene-trino), providing dedicated monitoring, connection settings, and telemetry for organizations querying via Trino while preserving full backwards compatibility for DuckDB-backed organizations.

Key highlights of the implementation:

  1. Tenant Isolation & Security:
    • Strict organization verification in trino_status_for (resp.data.status.org == organization_id) and serialize_trino_monitoring_snapshot prevents cross-tenant data leaks.
    • Dedicated response serializers serve as an explicit allow-list, stripping operator-only fields (e.g., cell, principal, resource_group, status_message).
    • Monitoring endpoints enforce warehouse_view:read scopes and resource-level access control.
  2. Feature Gating & Reliability:
    • data_ops_variant enforces clean precedence (trino > duckdb) and fails closed on flag errors.
    • In Temporal activities, evaluating each access flag independently ensures an error evaluating one flag cannot block access granted by the other.
    • Navigation and catalog discovery cleanly support multi-flag visibility via alternativeFlags without mutating existing single-flag behaviors.
  3. Frontend UX & Resilience:
    • Distinct handling of coordinator unavailability (available: false) prevents showing zero counts as an idle warehouse during outages.
    • managedWarehouseTrinoMonitoringLogic handles partial metric load failures gracefully via Promise.allSettled, caching last-known series data and bounding poll timers to component lifecycles via Kea disposables.
    • Responsive layouts follow @container rules with mobile/narrow resilience.

Non-blocking Follow-up Considerations

  • Upstream Deployment Order: As noted in the PR, keep the data-warehouse-scene-trino flag disabled until PostHog/duckgres#1248 is fully deployed to all target environments.
  • Concurrent Timeseries Metric Fan-out: managedWarehouseTrinoMonitoringLogic fires 9 concurrent timeseries requests on mount and window change. While Promise.allSettled ensures resilience, keep an eye on upstream control-plane latency during high concurrency across active users.

@github-actions
github-actions Bot requested a deployment to preview-pr-110369 October 12, 2026 18:22 In progress
@github-actions
github-actions Bot requested a deployment to preview-pr-110369 October 12, 2026 18:27 In progress
@trunk-io
trunk-io Bot merged commit 0fa5438 into master Oct 13, 2026
316 checks passed
@trunk-io
trunk-io Bot deleted the eric/data-ops-trino-variant-backend branch October 13, 2026 17:28
@deployment-status-posthog

deployment-status-posthog Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-10-13 18:38 UTC Run
prod-us ✅ Deployed 2026-10-13 18:51 UTC Run
prod-eu ✅ Deployed 2026-10-13 18:52 UTC Run

This branch was successfully deployed

1 active deployment
preview-pr-110369 — 11eb36a0 Deployed Oct 12, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-backend-github Keep this PR backend tests on GitHub Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants