perf(ci): build sandbox preview in parallel with storybook - #3811
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
25f1e06 to
28d3b2c
Compare
The PR `build` job was a single 6.5min pipeline dominated by one step: the sandbox Next.js export (~4min15s of it). Everything else — core build, four typechecks, storybook, analysis — fits in ~2min. Splitting the sandbox build into its own job removes it from everything else's critical path: - build-storybook: core build + typechecks + storybook + PR analysis (~2min). pr-a11y now starts when this finishes instead of waiting for the sandbox too, so the a11y comment update lands ~2-3min earlier. - build-sandbox: core build + sandbox export with the pinned Next.js cache (~5min), PR-only, in parallel from t0. - build: a join gate that keeps the historical check name — anything keyed on "build" (branch protection, tooling) keeps working, and it still fails when either side fails and passes on docsite-only PRs where the sandbox build is legitimately skipped. pr-comment now also waits for deploy-preview: the analysis is ready at ~2min, but posting preview links ~4min before the preview exists would leave them 404ing. Net effect it posts at the same time as before, and pr-comment-update gained an explicit needs on pr-comment so the final a11y body can never be overwritten by the initial pending one. PR wall time drops from ~8-9min to ~6.5min for component PRs; the cost is one extra runner spin-up and a duplicated ~40s core build. � Conflicts: � .github/workflows/ci.yml
28d3b2c to
a3dd6ae
Compare
PR Analysis ReportNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | View full report |
cixzhang
left a comment
There was a problem hiding this comment.
🟢 No review blockers found — CI-only change, verified clean within what I can check.
Initial review pass (community contributor) — findings are a triage map for maintainers, not a verdict.
This splits the ~4min sandbox export out of the build job into a parallel build-sandbox job and folds both back through a build join gate that keeps the historical check name.
Verified:
build-storybook(renamed frombuild) retains all four consumed outputs (pr_number,short_hash,storybook_url,sandbox_url); no downstream job references a now-removedneeds.build.*output.- The
buildjoin gate handles the edge cases correctly: docsite-only PRs skipbuild-sandboxand the gate still passes (success|skipped), and a skippedbuild-storybook(merge_group) skips the gate — matching the previous single-job cascade. pr-a11yanddeploy-previewnow point at the right upstream jobs for their artifacts.
Minor (non-blocking): the PR description mentions pr-comment/pr-comment-update reordering, but those jobs live in a separate workflow_run file that isn't touched here — the description slightly overstates the diff. No code impact.
Recap — #3811 · perf(ci): build sandbox preview in parallel with storybook · @Han5991
What it does: runs the slow sandbox export in its own job so PR CI wall time drops from ~8–9min to ~6.5min, with a join gate preserving the build check name.
Recommendation: Approve.
Summary
The PR
buildjob is a single ~6.5min pipeline, and one step dominates it: the sandbox Next.js export (4m15s of it, per recent run timings). Everything else in the job — core build, four typechecks, storybook build, PR analysis — fits in ~2min. This PR moves the sandbox export into its own job so it runs in parallel instead of serializing after everything else.PR CI wall time for component PRs drops from ~8–9min to ~6.5min, and the a11y audit starts ~4min earlier. Cost: one extra runner spin-up plus a duplicated ~40s core build.
Changes
build-storybook(renamed frombuild): core build + typechecks + storybook + PR analysis (~2min). Uploads the storybook + analysis artifacts and carries the preview-URL outputs, as before.build-sandbox(new): core build + sandbox export with the pinned Next.js cache, PR-only, parallel from t0 (~5min). The no-restore-keys cache rationale (feat: XDS un-prefix migration — bare names canonical, XDS* compat aliases #2941) is unchanged.build(new join gate): keeps the historical check name so anything keyed on "build" being green — branch protection, tooling, habit — keeps working. Fails if either parallel build fails; passes whenbuild-sandboxis legitimately skipped (docsite-only PRs); skips whenbuild-storybookskips (merge_group), matching the old cascade behavior.pr-a11ynow depends only onbuild-storybook, so it starts as soon as the storybook artifact exists (~2min) instead of waiting for the sandbox too.pr-commentnow also waits fordeploy-preview— correction (post-review): these two jobs live inpr-comment-updategained an explicitneeds: pr-commentpr-comment.yml(a separateworkflow_runworkflow this PR does not touch); the bullets described a considered change that didn't ship. The shipped diff isci.ymlonly.Behavior parity
buildredbuildred (via join)buildgreen (steps skipped)buildgreen (sandbox skipped, join passes)buildskipped (cascade from check-scope)Test plan
needs.build.*references (grep-verified)