Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(ci): skip unused frontend base builds in the merge queue (#127437)

posthog[bot]fca6e8665acf
diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml
index a0843444aff8..ecc32082befb 100644
--- a/.github/workflows/ci-frontend.yml
+++ b/.github/workflows/ci-frontend.yml
@@ -562,7 +562,7 @@ jobs:
# only cost the vs-base delta, never redden every open PR's job. The comment steps
# below already degrade to "no base measurement" when the base reports are absent.
continue-on-error: true
- if: github.event_name == 'pull_request'
+ if: github.event_name == 'pull_request' && !startsWith(github.head_ref, 'trunk-merge/')
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
diff --git a/tools/workflow-plan/tests/workflows.test.ts b/tools/workflow-plan/tests/workflows.test.ts
index c2ef97e3cc7e..213618b65c26 100644
--- a/tools/workflow-plan/tests/workflows.test.ts
+++ b/tools/workflow-plan/tests/workflows.test.ts
@@ -592,6 +592,40 @@ const namedJobs = (file: string): Set<string> =>
)
describe('CI workflow run plans', () => {
+ it.each([
+ ['ready PR', pullRequest(), true, true],
+ ['merge queue', mergeQueue(), true, false],
+ ['master push', push(), true, false],
+ ['hourly schedule', schedule(), false, false],
+ ])('frontend size comparison runs only when consumed (%s)', (name, github, headBuild, baseBuild) => {
+ const wf = workflow('ci-frontend.yml')
+ const plan = planWorkflow(wf, {
+ name,
+ github,
+ steps: { ...allFiltersChanged(wf), ...frontendSelectors },
+ })
+ expect(plan.errors).toEqual([])
+ const steps = plan.jobs['frontend-bundle-size']?.steps ?? []
+ expect(steps.find((step) => step.name === 'Build base branch for size comparison')?.runs ?? false).toBe(
+ baseBuild
+ )
+ for (const step of [
+ 'Build frontend (bundle-size + eager-graph report)',
+ 'Measure PR dist size',
+ 'Check toolbar bundle stays under the CloudFront gzip limit',
+ 'Check toolbar graph stays inside its module boundary',
+ 'Check toolbar for CSP eval violations',
+ 'Calculate dist folder size',
+ ]) {
+ expect(steps.find((candidate) => candidate.name === step)?.runs ?? false, step).toBe(headBuild)
+ }
+ expect(
+ steps.find((step) => step.name === 'Check eager graph budgets and forbidden imports')?.runs ?? false
+ ).toBe(headBuild && github.event_name === 'pull_request')
+ expect(steps.find((step) => step.name === 'Post CI report — bundle size')?.runs ?? false).toBe(baseBuild)
+ expect(plan.jobs.frontend_tests?.result).toBe('success')
+ })
+
it.each(['build', 'quality', 'typecheck', 'test'])('Desktop %s shares the fallback detector filters', (name) => {
const filters = (file: string): Record<string, string[]> =>
load(