Repository navigation
feat(workflows): send a broadcast to people who have a feature flag - #113009
Conversation
🤖 CI report
|
| Function | Location | Complexity | Limit |
|---|---|---|---|
FeatureFlag |
frontend/src/scenes/feature-flags/FeatureFlag.tsx:145 |
53 | 10 |
loadFeatureFlag |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:3333 |
25 | 10 |
<anonymous> |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:5799 |
25 | 10 |
saveFeatureFlagFailure |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:4402 |
19 | 10 |
saveFeatureFlagSuccess |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:4359 |
15 | 10 |
copyNewFlagToAdditionalProjects |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:759 |
14 | 10 |
findOrCreateBroadcastCohort |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:3829 |
14 | 10 |
saveTagsInline |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:5078 |
14 | 10 |
saveFeatureFlag |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:3515 |
13 | 10 |
refreshFeatureFlagSuccess |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:4560 |
12 | 10 |
loadCopyDependencyRequirements |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:4093 |
11 | 10 |
createPairedSchedule |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:4210 |
11 | 10 |
loadFeatureFlagSuccess |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:4749 |
11 | 10 |
applyTemplate |
frontend/src/scenes/feature-flags/featureFlagLogic.ts:4787 |
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) — clean
New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
⚠️ Comment density — 3% of added code lines are comments (21 of 609)
This section warns when comments are more than 3% of the code lines a PR adds, and alerts above 6%. Before agent-assisted PRs, the typical share was about 2%. Only full-line comments count. Docstrings, generated files, snapshots, migrations, and workflow files are left out.
Comments that restate the code, record how the change came about, or narrate the next line add noise for the next reader. Keep the comments that explain a reason the code cannot show, and remove the rest. See .agents/skills/writing-code-comments/SKILL.md for the house rules.
Files with the most added comment lines:
| File | Comment lines | Added lines |
|---|---|---|
frontend/src/scenes/feature-flags/featureFlagLogic.ts |
20 | 244 |
products/feature_flags/backend/api/feature_flag.py |
1 | 1 |
This check does not block merging. It updates on every push and clears when the share drops.
⚠️ Bundle size — 🔺 +4.3 KiB (+0.0%)
Uncompressed size of every built .js bundle, compared against the base branch.
Total: 76.63 MiB · 🔺 +4.3 KiB (+0.0%)
| File | Size | Δ vs base |
|---|---|---|
render-query/src/render-query/render-query.js |
24.50 MiB | 🔺 +3.9 KiB (+0.0%) |
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report
⚠️ Eager graph — 2 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.00 MiB · 24 files | no change | █████████░ 87.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.90 MiB · 609 files | no change | ██████████ 95.5% of 3.03 MiB |
🟡 authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
7.56 MiB · 2,556 files | 🔺 +470 B (+0.0%) | ██████████ 100.9% of 7.50 MiB |
dashboard scenesrc/scenes/dashboard/Dashboard.tsx |
9.57 MiB · 3,635 files | 🔺 +470 B (+0.0%) | ██████████ 95.6% of 10.01 MiB |
🟡 today home pathsrc/scenes/AuthenticatedShell.tsx + src/scenes/project-homepage/ProjectHomepage.tsx + src/scenes/project-homepage/today/TodayHome.tsx |
7.95 MiB · 2,893 files | 🔺 +470 B (+0.0%) | ██████████ 102.8% of 7.74 MiB |
events scenesrc/scenes/activity/explore/EventsScene.tsx |
9.12 MiB · 3,447 files | 🔺 +470 B (+0.0%) | ██████████ 95.1% of 9.59 MiB |
web analytics scenesrc/scenes/web-analytics/WebAnalyticsScene.tsx |
9.97 MiB · 3,664 files | 🔺 +470 B (+0.0%) | █████████░ 92.0% of 10.83 MiB |
replay detail scenesrc/scenes/session-recordings/detail/SessionRecordingDetail.tsx |
8.68 MiB · 3,261 files | 🔺 +470 B (+0.0%) | █████████░ 91.6% 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
🟢 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
🟢 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/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.4 KiB | src/index.tsx |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 1.0 KiB | src/lib/utils/bootTiming.ts |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
Largest files eagerly shipped from src/index.tsx + src/scenes/App.tsx + src/scenes/bootApp.ts
| Size | File |
|---|---|
| 321.6 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 221.3 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 |
| 106.2 KiB | src/products.tsx |
| 99.2 KiB | src/lib/api.ts |
| 70.3 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 |
| 29.2 KiB | src/scenes/scenes.ts |
| 27.6 KiB | src/lib/constants.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 321.6 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 237.4 KiB | ../packages/quill/packages/quill/dist/index.js |
| 221.3 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 |
| 142.1 KiB | ../packages/quill/packages/primitives/dist/index.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 |
| 106.2 KiB | src/products.tsx |
| 99.2 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/dashboard/Dashboard.tsx
| Size | File |
|---|---|
| 321.6 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 237.4 KiB | ../packages/quill/packages/quill/dist/index.js |
| 221.3 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 |
| 142.1 KiB | ../packages/quill/packages/primitives/dist/index.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 |
| 106.2 KiB | src/products.tsx |
| 99.2 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 |
|---|---|
| 321.6 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 237.4 KiB | ../packages/quill/packages/quill/dist/index.js |
| 221.3 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 |
| 142.1 KiB | ../packages/quill/packages/primitives/dist/index.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 |
| 106.2 KiB | src/products.tsx |
| 99.2 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/activity/explore/EventsScene.tsx
| Size | File |
|---|---|
| 321.6 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 237.4 KiB | ../packages/quill/packages/quill/dist/index.js |
| 221.3 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 |
| 142.1 KiB | ../packages/quill/packages/primitives/dist/index.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 |
| 106.2 KiB | src/products.tsx |
| 99.2 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/web-analytics/WebAnalyticsScene.tsx
| Size | File |
|---|---|
| 321.6 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 279.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 237.4 KiB | ../packages/quill/packages/quill/dist/index.js |
| 221.3 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 |
| 182.6 KiB | src/queries/validators.js |
| 153.7 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 142.1 KiB | ../packages/quill/packages/primitives/dist/index.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 |
| 106.2 KiB | src/products.tsx |
| 99.2 KiB | src/lib/api.ts |
Largest files eagerly shipped from src/scenes/session-recordings/detail/SessionRecordingDetail.tsx
| Size | File |
|---|---|
| 321.6 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.mjs |
| 315.9 KiB | ../node_modules/.pnpm/posthog-js@1.438.12_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js |
| 279.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 237.4 KiB | ../packages/quill/packages/quill/dist/index.js |
| 221.3 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 |
| 106.2 KiB | src/products.tsx |
| 99.2 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/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.25 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.25 MiB · 19 files | no change | ████░░░░░░ 39.3% 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 |
|---|---|
| 887.0 KiB | dist/toolbar/toolbar-app-LXZHKE22.css |
| 666.3 KiB | dist/toolbar/chunk-chunk-TSAMOE4J.js |
| 258.3 KiB | dist/toolbar/chunk-chunk-DRFI2VGN.js |
| 131.8 KiB | dist/toolbar/chunk-chunk-FDH2IBXT.js |
| 129.6 KiB | dist/toolbar/chunk-chunk-WGAF5EFS.js |
| 74.8 KiB | dist/toolbar/toolbar-app-Q7GHQJI2.js |
| 69.0 KiB | dist/toolbar/chunk-chunk-TSAL54PB.js |
| 35.6 KiB | dist/toolbar/chunk-chunk-7DZQZN7M.js |
| 21.7 KiB | dist/toolbar/chunk-chunk-23QQX5TR.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 — 🔺 +95.9 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1018.73 MiB · 🔺 +95.9 KiB (+0.0%)
ℹ️ MCP UI apps size — 33 app(s), 27023.9 KB JS
Built size of each MCP UI app (main.js + styles.css).
| App | JS | CSS |
|---|---|---|
| debug | 838.9 KB | 207.8 KB |
| action | 762.9 KB | 207.8 KB |
| action-list | 829.8 KB | 207.8 KB |
| cohort | 761.9 KB | 207.8 KB |
| cohort-list | 828.8 KB | 207.8 KB |
| email-template | 761.8 KB | 207.8 KB |
| error-details | 766.8 KB | 207.8 KB |
| error-issue | 763.3 KB | 207.8 KB |
| error-issue-list | 830.4 KB | 207.8 KB |
| experiment | 827.0 KB | 207.8 KB |
| experiment-list | 830.6 KB | 207.8 KB |
| experiment-results | 829.5 KB | 207.8 KB |
| feature-flag | 829.2 KB | 207.8 KB |
| feature-flag-list | 833.0 KB | 207.8 KB |
| feature-flag-testing | 765.1 KB | 207.8 KB |
| inline-scan | 762.4 KB | 207.8 KB |
| insight-actors | 828.3 KB | 207.8 KB |
| llm-costs | 825.6 KB | 207.8 KB |
| session-recording | 764.1 KB | 207.8 KB |
| survey | 763.5 KB | 207.8 KB |
| survey-global-stats | 825.6 KB | 207.8 KB |
| survey-list | 830.5 KB | 207.8 KB |
| survey-stats | 825.6 KB | 207.8 KB |
| trace-span | 762.3 KB | 207.8 KB |
| trace-span-list | 829.7 KB | 207.8 KB |
| vision-observation-list | 828.9 KB | 207.8 KB |
| workflow | 762.2 KB | 207.8 KB |
| workflow-list | 829.2 KB | 207.8 KB |
| workflow-setup-status | 761.9 KB | 207.8 KB |
| query-results | 1080.3 KB | 207.8 KB |
| render-ui | 1153.3 KB | 207.8 KB |
| visual-review-snapshots | 766.8 KB | 207.8 KB |
| workflow-data-suggestions | 764.6 KB | 207.8 KB |
ℹ️ MCP agent API — agent-facing tool changes
What this PR changes for agents, from the tool schema snapshots and tool definitions.
Tools changed (1):
| Tool | Params | Scopes | Annotations | Schema chars |
|---|---|---|---|---|
cohorts-list |
+created_by_id +type |
734 -> 994 |
✅ 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 ce7407b · box box-adba4d5f00f3 · ready in 1426s (push → usable) · build log · rebuilds on every push, torn down on close
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/src/scenes/feature-flags/featureFlagLogic.ts (1)
3585-3587: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftAdd a unit test for the new cohort-to-broadcast flow.
Test that a successful cohort response opens a broadcast with that cohort as its audience. Test that a failed request does not navigate and clears the loading state. These cases catch regressions in the new async action and its destination URL. As per coding guidelines, “All new packages and most new significant functionality should come with unit tests.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
aebb5b96-8708-406b-8ee3-6decdfc744ee
📒 Files selected for processing (2)
frontend/src/scenes/feature-flags/FeatureFlag.tsxfrontend/src/scenes/feature-flags/featureFlagLogic.ts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 4 remain after this review.
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
frontend/src/scenes/feature-flags/featureFlagLogic.ts-3596-3596 (1)
3596-3596: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winCheck breakpoints after each cohort request.
If the flag scene unmounts while a request is pending and the same flag mounts again before it resolves, the old loader can dispatch its success action to the remounted logic. A ready cohort can then send the user to Message Audience. Check
breakpoint()after each request and before returning.Suggested fix
const { cohort } = await api.featureFlags.createStaticCohort(props.id) + breakpoint() // The cohort fills in the background. Opening the broadcast earlier would let it send to no one. const deadline = Date.now() + BROADCAST_COHORT_WAIT_MS let status = await cohortsRetrieve(projectId, cohort.id as number) + breakpoint() while (status.is_calculating && Date.now() < deadline) { await breakpoint(BROADCAST_COHORT_POLL_MS) status = await cohortsRetrieve(projectId, status.id) + breakpoint() } + breakpoint() return status
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
cf7daff1-f232-444b-a630-76a62929275f
📒 Files selected for processing (2)
frontend/src/scenes/feature-flags/featureFlagLogic.test.tsfrontend/src/scenes/feature-flags/featureFlagLogic.ts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 3 remain after this review.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/src/scenes/feature-flags/featureFlagLogic.test.ts (1)
899-924: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a pending-request unmount test.
The new cases let creation and retrieval complete without unmounting the logic. Removing the cancellation breakpoints would not make those tests fail. Hold either request open, wait until it starts, unmount the logic, resolve the request, and assert that the old run does not navigate.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
33e40f8f-0453-41b6-a58e-2a7cccf3e821
📒 Files selected for processing (1)
frontend/src/scenes/feature-flags/featureFlagLogic.ts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 2 remain after this review.
79b259f to
bbab28b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: PostHog/posthog/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
0a35f91d-b77a-4cd9-b278-9c8898ded424
📒 Files selected for processing (2)
frontend/src/scenes/feature-flags/featureFlagLogic.test.tsfrontend/src/scenes/feature-flags/featureFlagLogic.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.
|
😎 Merged successfully - details. |
4ac581f to
52ca0ac
Compare
|
Risk: No findings The only change since the last review is regenerated OpenAPI output: a Sentinel reviewed |
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 1 · PR risk: 0/10 |
There was a problem hiding this comment.
Not approved — this change needs a human reviewer.
Re-add the stamphog label to request another review once you have addressed this.
The diff adds a nosemgrep suppression for a devex rule (prefer-codegen-api-namespaced-feature_flags, defined in .semgrep/rules/devex/). Suppressing house-pattern guards is a team-devex decision, so it can't be auto-approved.
- featureFlagLogic.ts adds a
nosemgrep: prefer-codegen-api-namespaced-feature_flagsmarker on the api.featureFlags.createStaticCohort call. That rule lives in .semgrep/rules/devex/, and suppressing it needs team-devex sign-off.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 166L, 2F substantive, 288L/3F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (288L, 3F, single-area, feat) |
| stamphog 2.3.1 | .stamphog/policy.yml @ cb83e20 · reviewed head cb83e20 |
There was a problem hiding this comment.
Not approved — escalated to a human reviewer.
Re-add the stamphog label to request another review once you have addressed this.
The API schema change lacks a current-head review, and the author has neither owning-team membership nor strong familiarity; the earlier cancellation concern is fixed by checks after requests. Request review from @PostHog/team-feature-flags, with Julian Bez or Gustavo H. Strassburger as suggested reviewers, before re-requesting.
- Author wrote 0% of the modified lines and has 6 merged PRs in these paths (familiarity MODERATE).
- Risky territory without independent assurance: Public API contracts — products/feature_flags/backend/api/feature_flag.py declares the cohort-creation endpoint's request and response schema, changing its generated client signature in products/feature_flags/frontend/generated/api.ts and adding a response type in services/mcp/src/api/generated.ts.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 174L, 3F substantive, 670L/8F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (670L, 8F, cross-cutting, feat) |
| stamphog 2.4.0 | .stamphog/policy.yml @ 7c9ba91 · reviewed head 7c9ba91 |
…n the broadcast button
# Conflicts: # frontend/src/scenes/feature-flags/FeatureFlag.tsx # frontend/src/scenes/feature-flags/featureFlagLogic.ts # products/feature_flags/backend/api/feature_flag.py # products/feature_flags/frontend/generated/api.schemas.ts # services/mcp/src/api/generated.ts
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. Install the Visual Review Chrome extension to see visual review results at the top of your pull requests. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013RQMQQJLuNLxz7KWAMzHwJ
|
/trunk merge |
Problem
Changes
entry_source:feature_flag.message audience clickedfires on every click, before the wait. It used to fire only when the broadcast opened.typeandcreated_by_idfilters, so the generated client can send them. The generated TypeScript and MCP files are regenerated output.feature-flag-cohort-creation, like Create cohort, and shows only for v1 flags. New flags and edit mode use a different form, so the entry does not appear there.Earlier screenshots (before the review fixes)
How did you test this code?
Head
a46154af, on an isolated local stack: own Postgres clone, Redis db 9/10, Celery worker, feature-flags service, Vite, and CDP API, batch-resolve, hogflow and email workers on a clone ofcyclotron_node. Playwright clicked through Chromium. Persons came in through local capture withexample.comemails, plus the SES success simulator address for the send. Most runs use a small project (8 persons), because a flag cohort on the 27k-person project takes about 2.5 minutes to fill.feature_flagposthog_cohort242: static, count 3,is_calculating=f. ClickHouseperson_static_cohort: 3 rowsaggregation_group_type_index: 0)/cohorts/245. The loading toast closedis_calculating=terrors_calculating=1set in Postgres)errors_calculating=1skippedcompleted.app_metrics2for the job:email_sent1.log_entries: "Email sent to success@simulator.amazonses.com", through real SES from the test sendermessage audience clicked: a spy wrappedposthog.capturein the page. One call with{source: 'feature_flag', destination: 'broadcast'}on a click that timed out, and one on the click that opened the broadcast.errors_calculatingin Postgres. The email subject and body for the real send were written through the hog flow API, because the visual editor is not drivable from Playwright. The sender, the audience and the launch went through the UI.featureFlagLogic.test.tscases now fail when someone removes the poll loop (a cohort that fills on the third check), theerrors_calculatingreuse check, or the server read of the flag. The outcome cases assert the toast text, the View cohort target, the broadcast name and source, the captured event, the list query parameters, and the loading toast dismissal.Earlier runs (before the review fixes)
Local dev stack, project 1, Playwright driving Chromium, with
feature-flag-cohort-creationandscene-menu-barturned on throughPERSISTED_FEATURE_FLAGS.Created four flags through the API:
dark-mode-rollout(active, person property condition), the same condition but disabled, one that matches nobody, and one with a 101-character key.Opened
dark-mode-rollout, opened the side panel, clicked Send a broadcast. A static cohort row appeared withis_calculating = t. After 6 s the page had not navigated and the item read "Finding the people who have this flag…".Simulated the population task finishing with
update posthog_cohort set is_calculating=false, count=3 where id=153(the local flags service cannot fill the cohort, see below). The page then opened/broadcasts/newwith "dark-mode-rollout announcement" and the cohort as its audience. The reach reads 0 because the simulated update wrote no member rows.Left a cohort calculating: after 60 s the toast "Still finding the people who have this flag. Send the broadcast from the cohort once it is ready." appeared with View cohort, the page stayed put, and the item re-enabled.
Long key, through File → Create → Broadcast: the broadcast name carries the full key.
Disabled flag: the item is disabled with "This flag is disabled, so no one has it. Enable it first." A forced click created no cohort and stayed on the page.
Double click: delayed the cohort request 4 s in the browser. During the request the item was disabled with "Finding the people who have this flag…". A second click did nothing, and exactly 1 cohort was created.
Failed request: answered the cohort request with a 500. The toast read "Create broadcast cohort failed: Simulated failure", the page stayed put, and the item re-enabled.
Left the flag page while the cohort was calculating, came back, then marked the cohort filled in Postgres. The page stayed on the flag and did not open a broadcast.
Gating flag off: neither Create cohort nor Send a broadcast appears in the side panel.
Cohort reuse, on new flags
betaandbeta-2. Each new cohort was marked filled by hand, as in step 3. Ran this after each step:beta, each on a fresh page visit: one row (160). The second visit opened the broadcast for cohort 160.update posthog_cohort set created_at = created_at - interval '61 minutes' where id=160), clickedbetaagain: a new row, 161.beta-2: a new row, 162. Clickingbetaagain reused 161, not the newerbeta-2cohort. Final rows:PATCHof its name, which bumpsupdated_atto 10:02:14), then clicked twice: the first click made row 164 although row 163 (10:02:04) was 10 s old, and the second reused 164. Row 161 was skipped throughout because the local population task had since marked iterrors_calculating = 1.Reuse is limited to the current user's cohorts (after the Veria finding). Setup: soft-deleted the leftover row 167, then made decoy row 166 look like a fresh
betasnapshot owned by another org member:created_bywithidanduuidfor every row (166 → user 15, the rest → user 1).betaas test@posthog.com: a new row 168 appeared and the decoy 166 was not used. Celery had not filled 168 after 30 s, so it was marked filled in Postgres (update posthog_cohort set is_calculating=false, count=0 where id=168). The page then opened the broadcast with cohort 168.beta, the first click sentPOST create_static_cohort_for_flag/with no body, created cohort 169 and opened the broadcast with it. The second click sent no create request and reused 169.select id, name, is_static, created_by_id from posthog_cohort where team_id=1 and name like 'Users with feature flag beta enabled%' order by id descreturned169 | … 19:39:00 | t | 1, then the earlier rows 168 and 167. I marked 169 filled in Postgres, because the local Celery does not fill flag cohorts.Not tested:
Step 12 was not repeated on the pre-fix commit, so the decoy being reused before the fix is shown by the unit test only.
Real cohort population. The local flags service answered the batch evaluation with 409 for newly created flags, and the run against an older flag did not finish, so step 3 flips the row by hand. Population is the existing Create cohort task and this PR does not change it.
The
message audience clickedanalytics event: local dev sends no analytics capture requests.Test rationale: Added two
it.eachblocks tofeatureFlagLogic.test.ts. No existing test covered this loader.<key>-2leads to a create. A cohort still filling at 90 minutes is reused, and one still filling past 4 hours leads to a create. Removing the age check fails the stale case.cohorts/:id/activity/, which reads the same rows:create_static_cohort_for_flagon flagqa-snapshot-reusemade cohort 249.GET activity_log/?scope=Cohort&item_id=249&page_size=1returned[]. AfterPATCH cohorts/249/it returned["updated"], andselect scope, item_id, activity from posthog_activitylog where scope='Cohort' and item_id='249'returnedCohort | 249 | updated.add_persons_to_static_cohortandremove_person_from_static_cohortreturn 500 on the local stack, because personhog is not configured there. Both calllog_activitywith the same scope and item id.Release status
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5)
featureFlagLogic.test.ts.findOrCreateBroadcastCohort, the event on every click, the sharedcanCreateFlagCohortgate, and the three test gaps.api.zod.tsin line.hogli build:openapithen changed only the cohort list files.created_byto be the current user, so another member's cohort leads to a new snapshot. Kept reuse for the same user so repeated clicks do not create duplicates.🤖 Generated with Claude Code
https://claude.ai/code/session_01BR6LoqsDMB9Wfnftcy2KiG