CI: parallelize the typescript-validation job#35346
Draft
valentinpalkovic wants to merge 1 commit into
Draft
Conversation
The check task looped ~44 workspaces sequentially, each spawning 'yarn exec jiti' (~0.7s shim + transform overhead per spawn, the same cost the compile task shed in the native-node migration). The whole TypeCheck code step ran 291s on a medium+ executor while using one of its vCPUs. The task now runs the per-package checks through a p-limit pool and launches check-package.ts with native node. The job executor moves to xlarge so eight checks run concurrently; the slowest packages (core, vue3, svelte, angular) are scheduled first so they don't stretch the tail of the run. Per-package output is buffered and only printed on failure so the parallel log stays readable. check-package.ts computes the repo root locally instead of importing scripts/utils/constants.ts, which intentionally uses __dirname (it must stay loadable from CJS-transpiled contexts like the Playwright specs) and therefore cannot load as native ESM. The scripts 'check' script moves from jiti to native node for the same reason the compile launcher did.
Contributor
|
This was referenced Jul 2, 2026
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.
Follow-up to #35343, attacking the downstream job graph. This PR takes the serial typecheck job.
What
scripts/tasks/check.tslooped ~44 workspaces sequentially, each spawningyarn exec jiti scripts/check/check-package.ts(~0.7s shim + transform per spawn - the same overhead the compile task shed in #35343). TheTypeCheck codestep ran 291s on amedium+executor while using one of its 3 vCPUs.p-limitpool (8 wide on CI), scheduling the slowest packages (core, vue3, svelte, angular) first so they don't stretch the tail.check-package.tswith nativenodeinstead ofyarn exec jiti(per the AGENTS.md jiti-to-node migration path).check-package.tsnow computes the repo root locally becausescripts/utils/constants.tsintentionally uses__dirname(it must stay loadable from CJS-transpiled contexts like the Playwright specs) and cannot load as native ESM.typescript-validationjob frommedium+toxlargeso 8 checks actually run concurrently. Roughly cost-neutral: 364s x medium+ (15 credits/min) ≈ 91 credits vs an expected ~140s x xlarge (40 credits/min) ≈ 93 credits - while returning the cancel-on-failure signal (this job gates workflow cancellation) minutes earlier.The
cancelOnFailurebehavior of the job is unchanged.Baseline (workflow
a65d3769-97c8-479f-aaae-39f92a2cb874, job 1697401)This job is not on the workflow critical path (it ends ~10min into an 18.1min wall), so the win here is summed job-time and failure-feedback latency, not wall clock.
Verification
yarn task --task check --no-linkrun locally with the pool: all ~44 workspaces green, including the vue-tsc / svelte-check special cases (exit 0; any failure aggregates and throws).check-package.tssmoke-tested under nativenodedirectly.cd scripts && yarn check(now native node) passes.Measured before/after tables will be updated from the CI run on this PR.