chore(insights): remove funnels-compare feature flag - #70098
Conversation
Compare-to-previous on funnels has fully rolled out, so drop the `product-analytics-funnels-compare` gate and make it always available. Removes the flag constant, the frontend gating in InsightDisplayConfig and insightVizDataLogic, the backend team-flag check in the funnels query runner, and the now-dead flag toggling in tests and stories. Generated-By: PostHog Code Task-Id: 6e4b2427-7f1e-46df-8d03-d4e7af3fc98c
🤖 CI report✅ Bundle size — 🟢 -289 B (-0.0%)Uncompressed size of every built Total: 70.03 MiB · 🟢 -289 B (-0.0%) No file changed by more than 1000 B. Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report ✅ Eager graph — within budgetHow 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
🟢 Largest files eagerly shipped from
|
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 668 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 277.3 KiB | ../node_modules/.pnpm/posthog-js@1.399.1/node_modules/posthog-js/dist/rrweb.js |
| 266.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 224.6 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 221.5 KiB | ../node_modules/.pnpm/posthog-js@1.399.1/node_modules/posthog-js/dist/module.js |
| 164.0 KiB | src/queries/validators.js |
| 154.2 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 105.9 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 |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Dist folder size — 🟢 -3.5 KiB (-0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1441.10 MiB · 🟢 -3.5 KiB (-0.0%)
|
Note from PostHog Code The failing In draft mode the jest job runs
The full sharded jest matrix that runs on ready-for-review splits this across runners and stays under the cap, so it should be green there. No code change is warranted for this check. |
🦔 Hogbox preview · ✅ ready▶ Open the preview
commit |
|
Reviews (1): Last reviewed commit: "chore(insights): remove funnels-compare ..." | Re-trigger Greptile |
|
Follow-up from PostHog Code Visual regression check: Net: both red checks ( On the automated security finding (medium, from an untrusted third-party bot): removing the gate is the intended general-availability of funnel compare-to-previous. Compare is opt-in per-insight (the user toggles it), queries remain team-scoped, and this now matches how trends/stickiness/web-analytics compare already run without any flag gate. I did not reintroduce a server-side gate, since that would negate the purpose of this PR. |
There was a problem hiding this comment.
Mechanical, fully-disclosed removal of an already-fully-rolled-out feature flag with matching frontend/backend/test changes; the one security-bot concern (potential extra ClickHouse load once compare is unconditional) was substantively rebutted by the author (opt-in, team-scoped, mirrors already-unguarded trends/stickiness compare) and the thread is resolved, and the author is on the owning team with STRONG familiarity in this exact code.
- Author wrote 92% of the modified lines and has 188 merged PRs in these paths (familiarity STRONG).
- hex-security-app[bot] reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 53L, 7F substantive, 141L/13F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (141L, 13F, cross-cutting, chore) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ bb56ec9 · reviewed head 03534f9 |
TL;DR
The "Compare to previous" toggle on funnel insights used to be hidden behind a feature flag. It's now rolled out to everyone, so I'm removing the flag and turning the feature on for all.
Problem
product-analytics-funnels-comparegated the funnel compare-to-previous feature during rollout. The feature has fully shipped, so the flag is now dead weight and adds a per-query flag check plus flag plumbing across the frontend, backend, tests, and stories.Why: clean up the flag now that funnel compare is generally available.
Changes
PRODUCT_ANALYTICS_FUNNELS_COMPAREconstant.showCompareinInsightDisplayConfigandsupportsCompareininsightVizDataLogicno longer check the flag — funnel compare is always on (FLOW viz still excluded, mirroring the backend)._is_compare_activein the funnels query runner drops the team-flag lookup.How did you test this code?
Ran
ruff checkandruff formaton the backend funnels package (clean). Frontend lint/typecheck couldn't run in this environment (node_modulesnot installed). The compare test suites keep their assertions; only the flag-gating cases were removed since that branch no longer exists.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored by Claude (PostHog Code) at Thomas's direction to remove the flag. Invoked the
/writing-testsskill before pruning the flag-gated tests. Chose to make funnel compare unconditionally available (matching the fully-rolled-out state) rather than adjust the flag default, and removed the flag-off test cases because the branch they covered no longer exists.Created with PostHog Code