Skip to content

ci(audience): add CDN bundle size gate (SDK-115)#2855

Merged
ImmutableJeffrey merged 1 commit intomainfrom
feat/audience-cdn-bundle-size
Apr 16, 2026
Merged

ci(audience): add CDN bundle size gate (SDK-115)#2855
ImmutableJeffrey merged 1 commit intomainfrom
feat/audience-cdn-bundle-size

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Contributor

@ImmutableJeffrey ImmutableJeffrey commented Apr 15, 2026

Summary

  • Measures the gzipped CDN bundle of @imtbl/audience on every PR that touches audience, audience-core, metrics, or the lockfile
  • Posts a sticky PR comment with raw + gzipped size and delta vs the PR base
  • Warns at 20 KB gzipped, fails at 24 KB (current bundle: ~17.8 KB)
  • Advisory only — not a required check (paths-filtered workflows can't be required checks without blocking unrelated PRs)
  • Fork PRs skip the comment (the action fails the job on permission errors) and fall back to the job summary
  • If the base build fails, deltas show as "n/a" and the absolute budget gate still fires
  • Thresholds live in packages/audience/sdk/bundlebudget.json

Stacked on #2853

Targets feat/audience-cdn-bundle, not main. The comment header shows the stack parent as the base ref until #2853 merges.

Linear: SDK-115

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 15, 2026

View your CI Pipeline Execution ↗ for commit 4eeb429

Command Status Duration Result
nx affected -t build,lint,test ✅ Succeeded 1s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-16 05:52:02 UTC

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

✅ Audience Bundle Size — @imtbl/audience

Metric Size Delta vs main (aa051dd)
Gzipped 18239 bytes (17.81 KB) 0 bytes
Raw (minified) 53033 bytes 0 bytes

Budget: 24.00 KB gzipped (warn at 20.00 KB)

@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/audience-cdn-bundle branch from 90add33 to 42565f8 Compare April 15, 2026 07:19
@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/audience-cdn-bundle-size branch 2 times, most recently from db6104f to f64e467 Compare April 15, 2026 16:11
nattb8
nattb8 previously approved these changes Apr 15, 2026
@ImmutableJeffrey ImmutableJeffrey marked this pull request as ready for review April 15, 2026 23:11
@ImmutableJeffrey ImmutableJeffrey requested review from a team as code owners April 15, 2026 23:11
JCSanPedro
JCSanPedro previously approved these changes Apr 15, 2026
Base automatically changed from feat/audience-cdn-bundle to main April 15, 2026 23:41
@ImmutableJeffrey ImmutableJeffrey dismissed stale reviews from JCSanPedro and nattb8 April 15, 2026 23:41

The base branch was changed.

Adds a GitHub Actions workflow that measures the gzipped size of the
@imtbl/audience CDN bundle on every PR and posts a sticky comment with
the delta vs the PR base.

- Warns at 20 KB gzipped, fails the build over 24 KB
- Builds the full dep chain (audience-core, metrics) before measuring
- Degrades gracefully when the base build is unavailable (reports n/a
  deltas, still enforces the absolute budget)
- Routes all GitHub context through env blocks (no shell injection)
- Skips comment posting on fork PRs, falls back to job summary
- Budget thresholds live in packages/audience/sdk/bundlebudget.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/audience-cdn-bundle-size branch from f64e467 to 4eeb429 Compare April 16, 2026 05:38
@ImmutableJeffrey ImmutableJeffrey added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 2402e53 Apr 16, 2026
8 checks passed
@ImmutableJeffrey ImmutableJeffrey deleted the feat/audience-cdn-bundle-size branch April 16, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants