chore(ci): select affected Storybook shards - #69932
Conversation
Generated-By: PostHog Code Task-Id: a16c1c5f-7dc1-4a87-8309-d76da59d8abe
🤖 CI report✅ Bundle size — 🟢 -61.6 KiB (-0.1%)Uncompressed size of every built Total: 70.02 MiB · 🟢 -61.6 KiB (-0.1%)
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 — 🔺 +202.4 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1438.39 MiB · 🔺 +202.4 KiB (+0.0%)
|
Generated-By: PostHog Code Task-Id: a16c1c5f-7dc1-4a87-8309-d76da59d8abe
|
👋 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. |
| echo "Selector declined to narrow (mode=$MODE); draft skips visual-regression (full run happens on ready for review)" | ||
| fall_back_to_skip | ||
| echo "Selector declined to narrow (mode=$MODE); running the full visual-regression matrix" | ||
| fall_back_to_full |
There was a problem hiding this comment.
is now running the full suite in draft PRs, or running selective tests on ALL PRs? if the former that's a waste of CI, and if the latter that's no bueno until we setup a merge queue (I don't like the idea of merging a PR without running the full suite).
|
The current implementation runs selective Storybook tests on all PRs, with fail-closed full-suite fallbacks for shared or uncertain changes. I cannot change |
Generated-By: PostHog Code Task-Id: a16c1c5f-7dc1-4a87-8309-d76da59d8abe
Problem
Visual regression CI runs the full Storybook shard matrix for every ready frontend pull request, even when a change can only affect a small feature area. This spends runner time on unrelated stories, such as SQL editor snapshots after an experiments-only change.
Why: Keep visual coverage strong while avoiding shards that cannot observe a changed module.
Changes
run-ci-frontendrequests.flowchart TD A[Frontend pull request] --> B[Full 16-shard Storybook matrix] classDef phBlue fill:#1d4aff,stroke:#1d4aff,color:#fff; classDef phYellow fill:#f9bd2b,stroke:#f9bd2b,color:#000; class A phYellow; class B phBlue;flowchart TD A[Frontend pull request] --> B[Build Vite module graph] B --> C{Safe to select?} C -->|Yes| D[Affected stories on sized shard matrix] C -->|No| E[Full 16-shard matrix] 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 A phYellow; class B phGray; class C phRed; class D,E phBlue;How did you test this code?
node --test bin/find-affected-stories.test.mjsnode --check bin/find-affected-storiesgit diff --checkThe tests catch regressions where feature-local changes select unrelated stories, shared library changes are narrowed unsafely, or unresolved runtime frontend files are skipped.
hogli ci:preflight --fixwas unavailable in this runner because neitherhoglinorfloxis installed.👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Automatic notifications
Docs update
No user-facing documentation change.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with OpenAI Codex. Invoked
/writing-testsbefore adding the selector regression tests. The selector intentionally fails closed to the full matrix for shared library changes and any frontend runtime file missing from the build graph.Created with PostHog Code