Skip to content

chore(ci): flag fields removed from cached query models - #124050

Merged
trunk-io[bot] merged 11 commits into
masterfrom
posthog/ci-flag-cached-schema-removals
Oct 28, 2026
Merged

trunk-io[bot] merged 11 commits into
masterfrom
posthog/ci-flag-cached-schema-removals

Conversation

@vdekrijger

@vdekrijger vdekrijger commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Customers wait for a fresh calculation on insights and dashboards when a PR removes a field that cached query responses still hold, and the PR author sees no sign of that cost during review.

#122489 removed useNewEventsCluster from HogQLQueryModifiers. Every cached entry that stored the field then failed to parse and counted as a miss. Context is in this Slack thread.

Changes

  • A PR that removes a property or an enum value from any model that a Cached* response reaches in frontend/src/queries/schema.json now gets a Cached schema removals section in the shared CI report.
  • The section lists the removals and states the cost of each option: keep the field as deprecated and stop writing it, accept the misses, or bump the cache version. It also links a Slack channel for questions.
  • The author acknowledges the choice with a label: cache-impact-deprecated, cache-impact-accepted or cache-impact-bumped. Without one, the Frontend typechecking job fails, which blocks the required frontend gate. A label does not start CI, so the author re-runs the failed job after applying it.
  • The check is a step in Frontend typechecking, beside the existing schema.json check. It skips merge queue branches, and it skips itself with a notice when the base schema or the labels cannot be read, so an API error cannot fail the gate.
  • On a later push that no longer removes a field, the section reads "no removed fields". If that push leaves no frontend changes, Frontend typechecking is skipped and the old section stays.
  • Mechanical: a stdlib-only script with tests, a small poster script, and one entry in the CI report section list. Three labels were created in the repository for the options.
  • Not covered: entries already written (they heal when the query runs again or expire), objects inside anyOf lists, type changes, and changes to how results are built.

How did you test this code?

  • Ran the new pytest file, ruff, oxfmt, actionlint and hogli lint:workflows locally. actionlint reports only the notes and the parallel: error that master already has for ci-frontend.yml. The CI report script tests pass.
  • Ran the script on the real schema, with useNewEventsCluster added back to a copy used as the base. It flagged the property as alert, and the label flipped it to warn and acknowledged=true. A schema compared with itself reported no removal.
  • Replayed real history. Comparing the schema before and after feat(hogql): staff switch for the native events table #122489 flags HogQLQueryModifiers: property useNewEventsCluster. Across the last 40 master commits that changed schema.json, the only other flag is chore(experiments): drop legacy fields from experiment query response #124170, which removed six fields from CachedExperimentQueryResponse. The other 38 report no removal.
  • Imported the poster script. It writes nothing outside a PR context.
  • Not run: the workflow-plan suite passes except seven backend-diff tests that fail the same way on master, because the sandbox blocks git commit.
  • Ran the new steps on a throwaway PR, #124177, that removes a modifier from the schema. Without a label, the typecheck job failed and the report showed an alert. After cache-impact-accepted and a re-run of that job, the step passed and the report showed a warning. After the removal was reverted, the report read "no removed fields".
  • Not checked in CI: the Slack line added after those runs, and the posting steps on a fork PR.

Test rationale: The tests catch a removal the detector misses (property or enum value, in a model reached through a $ref or inline) and two false alarms: a model no cached response reaches, and an inline object extracted to a $ref. A renamed recursive model and an inline object extracted to a recursive ref guard the cycle check. The const and union cases cover the other shapes the schema generator emits: an enum narrowed to one value, a changed const, and a field made nullable. Other unions are skipped, so they can miss a removal but never raise a false alarm. The label cases guard the one input that turns the gate green, including unrelated labels. The workflow steps cannot run offline, so a unit test is the lowest level that catches these.

Release status

  • No feature flag controls this change

Docs update

None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Sonnet 5.5

Skills: /authoring-ci-workflows, /writing-pr-descriptions, /writing-tests, /writing-dataclasses, /writing-code-comments, pr-shepherd.

  • The duplicate search found #123931 and #123812 for the same incident. Both change how old entries are read. The team chose to keep dropping unparseable entries and to show the cost before merge, so both are closed in favor of this PR.
  • The work drew on an internal Slack thread (linked above). No material from it is in the diff.
  • Review on the first push found two valid issues (the $ref false alarm and the deprecated guidance) and one workflow risk (the comment step). A later review found that the cycle guard skipped a real removal. All are fixed in this PR.
  • A devex review then asked for less new CI surface. The standalone workflow, its own comment and the description line are replaced by a step in the frontend CI, a CI report section and labels.
  • A pass against the repo's dataclass and comment standards made the script's dataclasses frozen, keyword-only and slotted, as in cancel_superseded_depot_runs.py, and typed closed string sets as Literal. @frozen from posthog.dataclasses is not usable here because importing it loads Celery.

🤖 Generated with Claude Code


Created with PostHog from a Slack thread

Removing a field from a model that a cached query response stores makes every old cache entry that holds it fail to parse and count as a miss. A new check compares the base and head frontend/src/queries/schema.json and comments on the PR with the cost of each option. The author acknowledges the choice with a "Cache impact:" line in the PR description.

Generated-By: PostHog Desktop
Task-Id: a71ba72c-45ef-4f06-9293-39974ec2ae71
@vdekrijger vdekrijger self-assigned this Oct 27, 2026
@trunk-io

trunk-io Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

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

PostHog Review · Standard · reviewed 8f6ac57: 2 Should fix.

This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.

See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.

@vdekrijger
vdekrijger marked this pull request as ready for review October 27, 2026 13:25
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

🚨 Trunk lane — universal lane

This PR is assigned to the universal lane. It cannot merge in parallel with other PRs, so it can take longer to merge. Ask dev-ex if you think this is wrong.

✅ 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) — 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.

⚠️ Bundle size — 🔺 +52.1 KiB (+0.1%)

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

Total: 77.17 MiB · 🔺 +52.1 KiB (+0.1%)

File Size Δ vs base
render-query/src/render-query/render-query.js 24.99 MiB 🔺 +49.9 KiB (+0.2%)

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

⚠️ Eager graph — 3 over budget

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

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.01 MiB · 25 files 🔺 +356 B (+0.0%) █████████░ 88.2% 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.98 MiB · 621 files 🔺 +639 B (+0.0%) ██████████ 98.1% of 3.03 MiB
🟡 authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
7.59 MiB · 2,568 files 🔺 +5.6 KiB (+0.1%) ██████████ 101.3% of 7.50 MiB
dashboard scene
src/scenes/dashboard/Dashboard.tsx
9.96 MiB · 3,733 files 🔺 +5.8 KiB (+0.1%) ██████████ 99.5% 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.78 MiB · 2,661 files 🔺 +5.6 KiB (+0.1%) ██████████ 100.5% 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
8.02 MiB · 2,654 files 🔺 +5.6 KiB (+0.1%) ██████████ 101.5% of 7.91 MiB
events scene
src/scenes/activity/explore/EventsScene.tsx
9.40 MiB · 3,514 files 🔺 +5.8 KiB (+0.1%) ██████████ 98.1% of 9.59 MiB
web analytics scene
src/scenes/web-analytics/WebAnalyticsScene.tsx
10.35 MiB · 3,765 files 🔺 +5.8 KiB (+0.1%) ██████████ 95.5% of 10.83 MiB
replay detail scene
src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
8.44 MiB · 3,109 files 🔺 +21.6 KiB (+0.3%) █████████░ 89.1% 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.7 KiB src/index.tsx
1.6 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
323.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
217.5 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
102.1 KiB src/products.tsx
86.1 KiB src/lib/api.ts
68.3 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
323.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
286.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.9 KiB ../packages/quill/packages/quill/dist/index.js
217.5 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
102.1 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.1 KiB src/lib/api.ts
Largest files eagerly shipped from src/scenes/dashboard/Dashboard.tsx
Size File
323.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
286.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.9 KiB ../packages/quill/packages/quill/dist/index.js
217.5 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
102.1 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
323.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
286.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.9 KiB ../packages/quill/packages/quill/dist/index.js
217.5 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
102.1 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.1 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
323.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
286.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.9 KiB ../packages/quill/packages/quill/dist/index.js
217.5 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
102.1 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
323.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
286.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.9 KiB ../packages/quill/packages/quill/dist/index.js
217.5 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
102.1 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
323.1 KiB ../node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/posthog-js/dist/module.mjs
286.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.9 KiB ../packages/quill/packages/quill/dist/index.js
217.5 KiB ../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@posthog/icons/dist/posthog-icons.es.js
187.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
102.1 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
323.1 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
286.4 KiB src/taxonomy/core-filter-definitions-by-group.json
239.9 KiB ../packages/quill/packages/quill/dist/index.js
217.5 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
102.1 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.30 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.30 MiB · 18 files 🔺 +512 B (+0.0%) ████░░░░░░ 40.3% 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
915.2 KiB dist/toolbar/toolbar-app-SM4KM3FT.css
695.1 KiB dist/toolbar/chunk-chunk-U3442AL4.js
259.9 KiB dist/toolbar/chunk-chunk-WGO24YVJ.js
131.8 KiB dist/toolbar/chunk-chunk-FDH2IBXT.js
130.4 KiB dist/toolbar/chunk-chunk-OUJWRTLQ.js
74.8 KiB dist/toolbar/toolbar-app-U572JKAF.js
69.0 KiB dist/toolbar/chunk-chunk-TSAL54PB.js
35.6 KiB dist/toolbar/chunk-chunk-XCCLDCK3.js
21.7 KiB dist/toolbar/chunk-chunk-UW2K5BF6.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.04 MiB (+0.1%)

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

Total: 973.39 MiB · 🔺 +1.04 MiB (+0.1%)

✅ Playwright — all passed

All tests passed.

View test results →

@parameterai

parameterai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Risk: No findings

This increment deduplicates renamed-$ref comparisons in the cached-schema-removal CI check by moving the visited-pair set from a per-path parameter to the SchemaPair instance. The exponential diamond blowup from the earlier review is fixed, and the memoization cannot hide removals: identical ref pairs always resolve to identical definitions, and same-named refs are still compared directly as top-level models. No new security issues.

Sentinel reviewed 0dfa4db · Review settings

@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team October 27, 2026 13:27
…-effort

An inline object that became an equivalent $ref was reported as removed fields.
The comparison now follows a $ref when only one side has it, and guards against cycles.
The comment step no longer fails an acknowledged PR when the write fails.
The deprecated option now says to stop writing the field to cached responses.

Generated-By: PostHog Desktop
Task-Id: a71ba72c-45ef-4f06-9293-39974ec2ae71
An inline object compared against a recursive $ref hit the same pair at a nested location and skipped a real removal.
Only a pair of two refs can cycle, because an inline side is finite.

Generated-By: PostHog Desktop
Task-Id: a71ba72c-45ef-4f06-9293-39974ec2ae71
@vdekrijger vdekrijger added the stamphog Request AI approval (no full review) label Oct 27, 2026 — with PostHog

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not approved — this change needs a human reviewer.

Re-adding the stamphog label gives the same result unless the changed files change.

stamphog can't approve this pull request because two gates refused it. The deny-list gate flagged .github/workflows/ci-cached-schema-removals.yml as a CI workflow path, and those paths are only approved for authors on team-devex. The tier gate also classified the change (389 lines across 3 files) as T2-never, so it is not eligible for automated approval at all.

Please ask a human reviewer to take this one, ideally someone on team-devex since it adds a CI workflow. Splitting the workflow file into its own pull request won't change the outcome for that file, but it would let the scripts and tests be reviewed separately.

Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✗ matches: ci_workflows (stamphog approves these paths only for authors on team-devex)
size ✓ 278L, 2F substantive, 389L/3F incl. docs/generated/snapshots — within ceiling
tier ✗ classified as T2-never: T2-never (389L, 3F, single-area, chore)
stamphog 2.6.1 .stamphog/policy.yml @ unknown · reviewed head 864c27d

@stamphog stamphog Bot removed the stamphog Request AI approval (no full review) label Oct 27, 2026
@vdekrijger vdekrijger added the posthog-review Run a Standard PostHog Review label Oct 27, 2026

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

PostHog Review · Standard · reviewed 864c27d: no findings.

This Standard review started from the posthog-review label. Comment @posthog review --deep for a Deep review, or @posthog help to see all commands.

@posthog posthog Bot removed the posthog-review Run a Standard PostHog Review label Oct 27, 2026

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

🤖 Agent review · steered by a person

Requesting changes. This is a quick look only. The block is about devex patterns, not the detection logic. @webjunkie can take a closer look later.

The script and its tests are the right shape. The objections are about the wiring around them. There is more than one good fix for each, so treat these as directions, not a spec.

Do not add a separate workflow

The frontend CI already checks schema.json in "Check if schema.json and validators.js are up to date" (.github/workflows/ci-frontend.yml:760). The comparison can run as a step there. A new workflow adds its own trigger, concurrency group and token permissions for one file.

Post through the shared CI report, not a new bot comment

The workflow posts its own sticky comment as github-actions[bot] with pull-requests: write on the default token. The repository has a shared CI report comment for this, in frontend/bin/ci-report/update-ci-report.mjs. Migration risk analysis, comment density, complexity, snapshots and coverage all post a section into it, with an app token. One more section there keeps PR pages readable as these checks grow.

Reconsider the acknowledgement line

A "Cache impact:" line in the description is a new mechanism. Other guards here use a label (the cross-lane check, test-new-events-schema) or a reviewed allowlist (migration deletions). The description line also forces the edited trigger, so every description edit reruns the check. A label per option, or another existing mechanism, avoids both.

…port

Review asked for less new CI surface. The check is now a step in the frontend typechecking job, posts a section into the shared CI report, and reads cache-impact labels instead of a PR description line. The standalone workflow, its sticky comment and the edited trigger are gone.

Generated-By: PostHog Desktop
Task-Id: a71ba72c-45ef-4f06-9293-39974ec2ae71

Copy link
Copy Markdown
Contributor Author

Note

🤖 Automated comment by PR Shepherd, not written by a human

Addressed all three points in 6893839.

  • No separate workflow. The standalone workflow is deleted. The comparison now runs as a step in Frontend typechecking, beside the existing schema.json check. It skips merge queue branches. It also skips itself with a notice if the base schema or the labels cannot be read, so an API error cannot fail the required gate.
  • Shared CI report. The check now posts a Cached schema removals section through the report helpers, and clears it on a later push that no longer removes a field. It uses github.token, as the neighbouring frontend report steps do, not an app token.
  • Labels, not a description line. The options are now cache-impact-deprecated, cache-impact-accepted and cache-impact-bumped, and the three labels exist in the repository. Labels are read live, so re-running the failed job after applying one works. The edited trigger is gone with the workflow.

Trade-off to know about: the check now fails a job in the required frontend gate until a label is applied, and re-running it re-runs the whole typecheck job. A removal like this is rare, so I kept the single step. A separate small job would make the re-run cheaper but needs gate wiring.

Not yet exercised on a PR that changes schema.json: the base schema read, the label read, and the report section write and clear.

Same-typed string fields (model, location, kind, name) and the memo key pair could be swapped without a type error. Dataclasses now use frozen, kw_only and slots as in cancel_superseded_depot_runs.py, closed string sets use Literal, the memo key is a small frozen class, and render_body is defined before its first call. Behavior is unchanged.

Generated-By: PostHog Desktop
Task-Id: a71ba72c-45ef-4f06-9293-39974ec2ae71

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

PostHog Review · Standard · reviewed 9b0f886: 1 Should fix.

The CI report section now links the Slack channel where authors can ask which cache impact option fits their change.

Generated-By: PostHog Desktop
Task-Id: a71ba72c-45ef-4f06-9293-39974ec2ae71
@trunk-io

trunk-io Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

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

🤖 Agent review · steered by a person

Approving. The three devex points are resolved: the check runs as a step in Frontend typechecking, it posts a section in the shared CI report, and labels acknowledge a removal. #124177 shows the fail, label and clear runs work as intended.

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

PostHog Review · Standard · reviewed 237c5a0: 1 Should fix.

This is review round 3 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.

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

PostHog Review · Standard · reviewed b4c7063: 1 Should fix.

This is review round 4 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.

@trunk-io
trunk-io Bot merged commit 064959a into master Oct 28, 2026
235 checks passed
@trunk-io
trunk-io Bot deleted the posthog/ci-flag-cached-schema-removals branch October 28, 2026 13:27
@deployment-status-posthog

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

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-10-28 13:47 UTC Run
prod-us ✅ Deployed 2026-10-28 14:08 UTC Run
prod-eu ✅ Deployed 2026-10-28 13:58 UTC Run

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.

2 participants