Skip to content

perf(ci): Build SDK dependencies within CI jobs - #26732

Merged
nicohrubec merged 22 commits into
developfrom
feat/benchmark-local-sdk-builds
Nov 25, 2026
Merged

nicohrubec merged 22 commits into
developfrom
feat/benchmark-local-sdk-builds

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What

  • Move affected-project selection and E2E matrix generation into an early planning job.
  • Start test jobs after planning, instead of waiting for the central build and artifact transfers. Each job builds ONLY its SDK dependency graph; E2Es pack local tarballs and browser jobs build the bundles they need. In theory we could even just remove the central build from PR runs now with some more small changes.
  • Share the build action and Nx targets between central and per-job builds. The central build still produces release artifacts.
  • Package Lambda layers from each test job’s local SDK outputs; retain the central release-only layer producer.
flowchart LR
  subgraph before["Before"]
    direction TB
    O1[Metadata] --> O2[Central build: plan tests, build SDK, pack and bundle]
    O2 --> O3[Upload artifacts]
    O3 --> O4[Test jobs: download artifacts and run tests]
    O4 --> O5[Required checks pass]
    O3 -. Release runs .-> O6[Release artifacts]
  end

  subgraph after["After"]
    direction TB
    N1[Metadata] --> N2[Plan test jobs]
    N1 --> N3[Central build: build SDK, pack and bundle]
    N2 --> N4[Test jobs: build needed SDK packages locally]
    N4 --> N5[Run tests]
    N3 --> N6[Required checks pass]
    N5 --> N6
    N3 -. Release runs .-> N7[Release artifacts]
  end

  before ~~~ after
Loading

Tests build their required SDK packages locally and run alongside the central build, which continues to produce release artifacts and remains required.

Why

Moving from a central to local builds eliminates/reduces two significant bottlenecks in our current CI:

  • Tests only wait for the SDK packages they actually need to build, rather than the entire repository.
  • Building on the test runner removes the upload, download and extraction of SDK build artifacts between runners.

It does add some complexity but overall I think it's worth it given the huge gain. One concern I had was that we could introduce a setup where local and central build (that produces release artifacts) could add some point subtly drift. I tried to share the logic here as much as possible extracting into a shared action to combat this. Also let codex run a full build comparison to ensure that the packages look exactly the same today.

Finish time, including queues Develop Decentralized Saved
Required checks 5:26 4:04 1:22
Last E2E 4:42 3:58 44s
Last runtime integration 5:19 3:26 1:53
Shared preparation ready 1:49 0:29 1:20

After this change, these are the 20 last finishing required jobs in the benchmark. Optional jobs and the required gate are excluded. This is a full CI run so most PR runs will be much much faster and even for full CI runs getting into the 3:00-3:30 range seems very easily doable.

Job Finished after CI started Job duration
Next 16 Webpack dev — 1/3 3:58 3:21
Browser unit tests 3:34 3:02
Next 14 dev — 1/2 3:33 2:55
Next 16 Bun 3:31 2:27
Browser full minified — 2/2 3:29 2:50
Nuxt 4 Deno 3:29 2:56
Next latest Webpack production 3:29 2:53
Next 16 Webpack production 3:28 2:51
Node 24 integration — 2/6 3:26 2:27
Next 15 basepath 3:24 2:47
Next latest Turbopack production 3:23 2:45
TanStack Start React 3:21 2:42
Next 16 Webpack dev — 3/3 3:20 2:44
Node 27 alpha integration — 5/6 3:19 2:21
Node 27 alpha integration — 2/6 3:18 2:43
Node 20 integration — 5/6 3:18 2:43
Browser tracing + replay — 2/2 3:17 2:44
Node 27 alpha integration — 6/6 3:17 2:42
Bun 1.4 integration — 5/6 3:17 2:43
Node 20 integration — 2/6 3:16 2:17

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: d05fafb (PR test merge using develop at 06fdfe2)

Against: 06fdfe2 (develop) · base run #67906

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.54 kB - -
@sentry/browser - with treeshaking flags 28.73 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.6 kB - -
@sentry/browser (incl. Tracing) 53.67 kB - -
@sentry/browser (incl. Tracing Core) 40.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.67 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.56 kB - -
@sentry/browser (incl. Tracing, Replay) 93.59 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.42 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.4 kB - -
@sentry/browser (incl. Feedback) 48.4 kB - -
@sentry/browser (incl. sendFeedback) 31.11 kB - -
@sentry/browser (incl. FeedbackAsync) 36.16 kB - -
@sentry/browser (incl. Metrics) 31.86 kB - -
@sentry/browser (incl. Logs) 32.13 kB - -
@sentry/browser (incl. Metrics & Logs) 32.8 kB - -
@sentry/react 32.56 kB - -
@sentry/react (incl. Tracing) 56.37 kB - -
@sentry/vue 38.74 kB - -
@sentry/vue (incl. Tracing) 56.68 kB - -
@sentry/svelte 30.57 kB - -
@sentry/effect (client) 42.21 kB - -
@sentry/effect (client, incl. Tracing) 54.96 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.31 kB - -
@sentry/remix (Remix 3 client bundle) 59.39 kB - -
CDN Bundle 32.53 kB - -
CDN Bundle (incl. Tracing) 54.15 kB - -
CDN Bundle (incl. Logs, Metrics) 35.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.63 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.22 kB - -
CDN Bundle (incl. Tracing, Replay) 91.93 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.47 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.86 kB - -
CDN Bundle - uncompressed 94.92 kB - -
CDN Bundle (incl. Tracing) - uncompressed 160.26 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 103.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.88 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.62 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.65 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 288.28 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.59 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 300.2 kB - -
@sentry/nextjs (client) 60.08 kB - -
@sentry/sveltekit (client) 55.02 kB - -
@sentry/core/server 45.83 kB - -
@sentry/core/browser 14.46 kB - -
@sentry/node 156.93 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.45 kB - -
@sentry/node - without tracing 89.79 kB - -
@sentry/node - without channel injection 145.88 kB - -
@sentry/aws-serverless 100.42 kB -0.01% -2 B 🔽
@sentry/cloudflare (withSentry) - minified 211.9 kB - -
@sentry/cloudflare (withSentry) 491.64 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 214.85 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 237.14 kB - -

View base workflow run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread .github/workflows/build.yml Resolved
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 3 not successful, 80 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E hono-5 (cloudflare) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Failing after 2m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E express-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E fastify-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E hono-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (cloudflare) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E fastify-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-without-tracing-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (0.x) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (content off) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 (MCP SDK OpenTelemetry) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps enabled by Sentry) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-4-sourcemaps (Vite server) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (delete all) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (delete all) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (manual upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solid-2-ssr (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vinext-cf-workers (workers cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (manual upload) Test (optional) Successful in 1m Details

@nicohrubec nicohrubec changed the title perf(ci): Benchmark building SDKs directly in test jobs perf(ci): Benchmark local SDK builds across the CI suite Nov 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c8dda1d. Configure here.

@nicohrubec
nicohrubec force-pushed the feat/benchmark-local-sdk-builds branch from c8dda1d to dedb2ee Compare November 23, 2026 08:40
@nicohrubec nicohrubec changed the title perf(ci): Benchmark local SDK builds across the CI suite perf(ci): Build SDK dependencies within CI jobs Nov 23, 2026
@nicohrubec
nicohrubec force-pushed the feat/benchmark-local-sdk-builds branch from b0dba15 to 497b8fc Compare November 23, 2026 10:14
@mydea

mydea commented Nov 23, 2026

Copy link
Copy Markdown
Member

hmm this seems pretty complicated 😅 and I am not sure I can quite follow the reasoning/ideas (I know this is WIP so feel free to disregard)

@nicohrubec

nicohrubec commented Nov 23, 2026 •

Copy link
Copy Markdown
Member Author

@mydea can maybe be cleaned up a bit but the basic idea is quite simple: instead of blocking each test job on the central build we just build in the test jobs directly whatever is needed. this means we eliminate two overheads.

  1. setup overhead of having two separate jobs and transferring data across runners and uploading + downloading tarballs etc
  2. test jobs no longer have to wait for builds that are not needed for the job

this means all test jobs can start immediately instead of 2 minutes after the job starts. the saving is huge 😅 but definitely a change we need to be a little bit careful with

@nicohrubec
nicohrubec force-pushed the feat/benchmark-local-sdk-builds branch 4 times, most recently from 8bc7940 to 18db132 Compare November 24, 2026 16:30
nicohrubec and others added 16 commits November 25, 2026 09:10
@nicohrubec
nicohrubec force-pushed the feat/benchmark-local-sdk-builds branch from 7ffc058 to d12e49d Compare November 25, 2026 08:12

job_build:
name: Build
job_get_test_matrix:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only purpose of this job is to check what changed and output a test plan including e.g. what e2es and integration tests should be run. we had this logic in the central build before now its just extracted into a separate job

e2e-matrix-aws-layer: ${{ steps.matrix.outputs.matrix-aws-layer }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}

job_build:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the central build job still exists and is responsible for producing the release artifacts, but it does not block the test runs anymore because test runs build the packages they need locally


- name: Build packages
run: pnpm run build:ci
uses: ./.github/actions/build-local-sdk

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one concern I had was that we could at some point introduce drift between the local builds that we test and the central build that we release, so I put the logic into a shared action so it should always be the same

github-token:
description: 'Token to download artifacts from `artifacts-run-id`. Only needed when that is set.'
default: ''
download-artifacts:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this decides whether to download from the central build or if we can use packages that are already built locally (as in the e2e test jobs for instance where we built whats necessary)

@nicohrubec
nicohrubec marked this pull request as ready for review November 25, 2026 12:05

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work, incredible gains!

@nicohrubec
nicohrubec merged commit 4f39fe3 into develop Nov 25, 2026
909 of 915 checks passed
@nicohrubec
nicohrubec deleted the feat/benchmark-local-sdk-builds branch November 25, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants