feat(ci): compile only shard-assigned packages in unit test shards - #9440
Merged
quirogas merged 2 commits intoSep 30, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request optimizes the CI workflow by introducing shard-specific Turborepo caching and compiling only the packages assigned to each shard within ci/run_conditional_tests.sh. It also increases the page size for fetching workflow jobs and refines OS and path matching for Windows environments. Feedback highlights two key improvements: first, correcting the Turborepo filter syntax from ./${d%/}... to ..../${d%/} to ensure that local monorepo dependencies are compiled first; second, replacing the use of ls in a bash loop with direct shell globbing to make the script more robust and idiomatic.
quirogas
marked this pull request as draft
September 23, 2026 23:33
quirogas
added this pull request to stack #9441
September 23, 2026 23:39
quirogas
force-pushed
the
ci/shard-compile/2-shard-aware-compilation
branch
from
September 23, 2026 23:49
df0e73d to
894910f
Compare
quirogas
marked this pull request as ready for review
September 24, 2026 01:03
quirogas
force-pushed
the
ci/shard-compile/2-shard-aware-compilation
branch
from
September 24, 2026 01:06
894910f to
dc1746b
Compare
bshaffer
reviewed
Sep 24, 2026
bshaffer
reviewed
Sep 24, 2026
quirogas
force-pushed
the
ci/shard-compile/2-shard-aware-compilation
branch
from
September 29, 2026 00:11
dc1746b to
385965c
Compare
bshaffer
reviewed
Sep 29, 2026
quirogas
force-pushed
the
ci/shard-compile/2-shard-aware-compilation
branch
from
September 29, 2026 22:51
385965c to
8c17855
Compare
bshaffer
approved these changes
Sep 29, 2026
quirogas
force-pushed
the
ci/shard-compile/2-shard-aware-compilation
branch
from
September 30, 2026 00:12
8c17855 to
b8e832d
Compare
quirogas
force-pushed
the
ci/shard-compile/2-shard-aware-compilation
branch
2 times, most recently
from
September 30, 2026 17:36
af80a50 to
02b8eba
Compare
quirogas
force-pushed
the
ci/shard-compile/2-shard-aware-compilation
branch
from
September 30, 2026 20:27
02b8eba to
5383dcf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now, every unit test shard runs
pnpm run compile(turbo run compile --filter='...[HEAD^1]') before startingci/run_conditional_tests.sh. On large PRs, that means all 15 shards compile every changed package in the repo, even though each shard only tests a fraction of them. On the flip side, if a PR only touchesci/,run_conditional_tests.shruns tests for all packages, but--filter='...[HEAD^1]'sees no changed packages and compiles nothing.This PR moves the
turbo run compilestep intoci/run_conditional_tests.shafter the shard's package list is calculated, so each shard only compiles the packages it is actually going to test.What changed
ci/run_conditional_tests.sh: Calculateshard_dirsfirst and runturbo run compilefiltered only to the directories assigned to that shard (--filter={./<dir>}). Also replacels -din the directory loop with standard bash globbing..github/actions/run-unit-tests/action.yaml&.github/workflows/presubmit-bun.yml: Remove the top-levelpnpm run compilestep (sincerun_conditional_tests.shnow handles it) and include the shard index in the.turbocache key..github/workflows/presubmit.yaml: Skippnpm run compilein thelintjob when no.tsfiles changed in the PR..github/actions/check-shard-status/action.yaml: Addper_page: 100when listing workflow jobs so runs with more than 30 jobs don't miss shard results.