Skip to content

ci: run the full unit suite on 4 shards instead of 24 - #46799

Merged
nwparker merged 1 commit into
mainfrom
nwparker/ci-rebalance-after-test-cut
Nov 22, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/ci-rebalance-after-test-cut

Conversation

@nwparker

@nwparker nwparker commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Runs the full unit suite on 4 shards by default instead of 24, now that the suite is ~400 files (#46786).

Data is from the #46786 PR run at head 6a44979b4, run 44993605720:

  • The 24 shards spent 504s in the test step but 1,223 runner-seconds in total. Each shard pays ~30s of checkout and install setup.
  • 4 shards should spend about 500s of tests plus 4×30s of setup, roughly 620 runner-seconds per PR (~600s saved). That is 20 fewer jobs queued per PR.
  • Each shard's wall time goes from 34–82s to an estimated ~150s. That is still under the PR critical path: real WSL terminal took 272s and the package jobs 247s.

Required follow-up (repo setting)

The repo variable ORCA_UNIT_FULL_SHARD_COUNT=24 overrides this default. Until it changes, this PR has no effect:

gh variable set ORCA_UNIT_FULL_SHARD_COUNT --body 4 --repo stablyai/orca

(or gh variable delete ORCA_UNIT_FULL_SHARD_COUNT --repo stablyai/orca to use the code default).

Looked at and left alone

  • Headless Node server: its changes job already scopes it. Across 10 recent PRs it used 0–185 runner-seconds. It only ran 14 jobs on test: cut the suite to the tests that guard real invariants #46786 because that PR touched everything. It is also the release orcad-template qualifier.
  • Small dedicated workflows: Journal file lock, Coding Plan credential contract, Windows orcad serve switch E2E and Performance contracts are path-scoped and run only surviving tests. They all fired on test: cut the suite to the tests that guard real invariants #46786 for the same reason.
  • Cache warmers: they run on main pushes and on a schedule, and still feed the live pr.yml Docker fixtures and the Wayland clipboard cache.

Verification

  • bun .github/scripts/check-required-pr-context.mjs: passes.
  • bun .github/scripts/check-pull-request-job-timeouts.mjs: passes.
  • actionlint on unit-plan.yml: clean.
  • pnpm check:changed: passes.
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

Performance

None, because this only changes how many CI runners the unit suite is split across; app code is untouched.

After the suite cut (#46786), 24 shards spent ~500s on tests but ~1,220
runner-seconds in total, since each shard pays ~30s of setup. Four shards
keep the unit lane (~150s) under the package/WSL critical path (~250-270s).
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The default full unit shard count changes from 24 to 4 in the workflow and unit matrix configuration. A configured ORCA_UNIT_FULL_SHARD_COUNT repository variable remains the selected workflow value.

Merge Risk: Low · up to 00d0f

This reduces the default full unit shard count from 24 to 4, which cuts CI runner cost and queued jobs. It also lengthens each unit shard's wall time to roughly 150 seconds, which should still be below the other CI lanes. The code risk is small and easy to revert, but the PR description needs a Performance section so the required check passes, and the wall-time increase should be explicitly accepted.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the full unit suite default moves from 24 shards to 4, which matches the workflow default and the FULL_SHARD_COUNT change in the summaries. The 'ci:' prefix fits a CI…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is detailed and data-backed. It explains the what (default shard count 24 to 4) and the why (fewer runner-seconds, fewer queued jobs, wall time still under the critical path). It state…
Full details: Title check

Explanation

The title states the main change: the full unit suite default moves from 24 shards to 4, which matches the workflow default and the FULL_SHARD_COUNT change in the summaries. The 'ci:' prefix fits a CI-only change. It is specific and concise.

Full details: Description check

Explanation

The description is detailed and data-backed. It explains the what (default shard count 24 to 4) and the why (fewer runner-seconds, fewer queued jobs, wall time still under the critical path). It states the required repo-variable follow-up and lists verification steps. It also includes a Performance section. Several template sections are missing: ELI5, Visual Proof (or an explicit N/A), a Linked Issue (the description cites #46786 but has no 'Fixes #' line), Testing checkboxes, Risk level, and the Review and Agent skill upstream boundary sections. The Risk section also lacks a rollback note. Because the core of the description is complete and the missing items are mostly non-critical for a small CI config change, the check passes.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93ead0b9-b05b-4ed7-a5b9-feba275abf45
Commits

Reviewing files that changed from the base of the PR and between 97b0e1c and 00d0f50.

Files selected for processing: 2

  • .github/workflows/unit-plan.yml
  • config/scripts/ci/unit-selection/ci-unit-matrix.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@nwparker
nwparker merged commit 6a47bf9 into main Nov 22, 2026
52 of 53 checks passed
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.

1 participant