Skip to content

ci: split the slowest PR CI jobs into parallel legs - #7705

Merged
josephfarina merged 1 commit into
mainfrom
josephfarina/ci-faster
Oct 22, 2026
Merged

josephfarina merged 1 commit into
mainfrom
josephfarina/ci-faster

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

Maintainer impact

Every pull request waits about 19 minutes for CI (median of the last 40 successful runs, p90 about 20 minutes). One job sets that time in nearly every run: test-ui runs the whole UI Vitest project on one runner, and its test step alone takes about 16 minutes. The next-longest paths are test-node (about 13.5 minutes), docsite-browser followed by docsite-test (about 13 minutes), the visual chain (about 14 minutes to the end of Stable visual regression), and registry-contract (about 9 minutes). Queue time is not the problem: jobs start in a few seconds.

Intended invariant

AST-030 FR7: test, build, docsite-test and lint keep reporting on every pull request through their jobs or join jobs, and any owned failure fails its join. Every test file still runs in exactly one place, and AST-036 FR23 still runs only after the other UI workers on its runner have exited.

Change

  • test-ui and test-node each run in four legs with Vitest's --shard. The repository checks (copyright, exports, CLI api types, token docs, lab readiness, knowledge history), the isolated FR23 benchmark and the theme-family contract run in leg 1 only.
  • registry-contract runs as two legs, preview and production. Each leg builds the packages, then generates and verifies its own registry.
  • docsite-test becomes a join over docsite-browser and a new docsite-data job (the Core and canary package builds, then generate and test). These used to run one after the other; now they run side by side. Spec-only PRs still validate spec records in docsite-test itself.
  • docsite-browser runs on 4-core-ubuntu. After Core, the 11 packages it needs build side by side (pnpm --workspace-concurrency=4); pnpm still orders them by their declared dependencies.
  • visual-scout runs in five legs instead of three. The scout library joins any shard count.

For each matrix job, needs.<job>.result is success only when every leg passed. So ci-test-join.mjs and the docsite guards stay fail-closed without changes.

Evidence

  • Failure before the change: test-ui median 17m27s (step 16m02s); test-node 13m35s; docsite-browser 10m12s then docsite-test 2m30s; registry-contract 8m54s; visual scout legs about 4m20s each.
  • Success after the change: I measured per-file durations from a full local run of each project and replayed Vitest's own shard assignment (sha1 of the path, then contiguous slices). A real --shard=3/4 run picked the same files, except at one slice boundary. Expected slowest legs: about 5 to 6 minutes for UI (the two slowest files are about 3.5 minutes each and set a floor) and about 4 to 5 minutes for Node. CI on this PR gives the real numbers.
  • Product/runtime behavior verified unchanged: workflow and test files only.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm vitest run --project node .github/scripts/: 1,156 tests. The only failure is accessibility-audit.integration.test.mjs, which is flaky on my machine without the change too (a different subset fails on each run, and it passes on reruns).
  • pnpm vitest run --project ui --shard=3/4 (with FR23 excluded): 143 of 573 files, 3,543 tests, all passing.
  • From a clean tree: pnpm -F @astryxdesign/core build, then the parallel build of the other 11 packages (34s, every dist written).
  • After pnpm build, each registry leg ran on its own from an empty apps/docsite/public/shadcn. Production: gate, generate-data (latest), the hidden-production vitest, then verify-full-catalog with published packages (909 items). Preview: generate-data (canary), then verify-full-catalog (1,030 items). Both passed.
  • prettier --check on every changed file.

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 22, 2026 12:11am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 19, 2026
@astracat-bot

astracat-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 22, 2026, 12:34 AM UTC

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

46 of 486 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 26 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

A pull request's CI took about 19 minutes, and one job set that time:
test-ui ran the whole UI Vitest project on one runner for about 16
minutes. test-node (about 12 minutes), the docsite chain (about 13) and
registry-contract (about 9) were next in line.

- test-ui and test-node each run in four legs with Vitest's --shard.
  The repository checks and the isolated FR23 benchmark run in leg 1;
  FR23 still starts only after that runner's other UI workers exit.
- registry-contract runs its preview and hidden production registries
  in two legs. Each leg was verified alone from an empty registry
  directory.
- docsite-test becomes a join over docsite-browser and a new
  docsite-data job, so generation and tests run beside the browser
  contract instead of after it. Spec-only PRs still validate spec
  records in docsite-test.
- docsite-browser runs on four cores, and the packages it needs after
  Core build side by side.
- The visual scout runs in five legs instead of three.

Required check names (test, build, docsite-test, lint) are unchanged;
a matrix job's result is success only when every leg passed, so each
join still fails closed. The workflow contract tests now pin the legs.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found: the new legs keep test and docsite-test fail-closed, every test file still runs exactly once with the FR23 benchmark isolated in UI leg 1, and CI on this head brought both required checks in about 9 to 10 minutes after it started. Nothing further is needed from you; maintainers may want to weigh the extra runner time, since the split jobs now occupy 16 4-core runners per broad pull request where they used 6.

[Automated review]

@josephfarina
josephfarina merged commit e68a7d6 into main Oct 22, 2026
71 of 72 checks passed
@github-actions
github-actions Bot deleted the josephfarina/ci-faster branch October 22, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — aa6e2058 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant