Repository navigation
perf(ci): Build SDK dependencies within CI jobs - #26732
Conversation
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.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 3 not successful, 80 successful. See the run.
Successful checks
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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.
c8dda1d to
dedb2ee
Compare
b0dba15 to
497b8fc
Compare
|
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) |
|
@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.
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 |
8bc7940 to
18db132
Compare
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
7ffc058 to
d12e49d
Compare
Co-Authored-By: OpenAI Codex <[email protected]>
|
|
||
| job_build: | ||
| name: Build | ||
| job_get_test_matrix: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
| github-token: | ||
| description: 'Token to download artifacts from `artifacts-run-id`. Only needed when that is set.' | ||
| default: '' | ||
| download-artifacts: |
There was a problem hiding this comment.
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)
Co-Authored-By: OpenAI Codex <[email protected]>
andreiborza
left a comment
There was a problem hiding this comment.
Really nice work, incredible gains!

What
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 ~~~ afterTests 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:
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.
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.