Skip to content

Commit 7370255

Browse files
authored
ci: shorten command jobs and avoid unused runtime builds (#135039)
Prepare runtime artifacts from each reader's effective test selection and keep the update dry-run process proof in the isolated CLI process catalog. Preserve runner capacity through semantic workload ownership instead of bin ordinals. Split the two longest Doctor SQLite files into complete-file owners that cannot share a compact job. Keep coverage, worker limits, and runner caps unchanged.
1 parent a0866b5 commit 7370255

11 files changed

Lines changed: 451 additions & 86 deletions

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,12 @@ jobs:
14111411
...changedExtensionFallbackShards,
14121412
]
14131413
: [];
1414+
const goToolingConfig = "test/vitest/vitest.tooling.config.ts";
1415+
const knownToolingConfigs = new Set([
1416+
goToolingConfig,
1417+
"test/vitest/vitest.tooling-isolated.config.ts",
1418+
"test/vitest/vitest.tooling-docker.config.ts",
1419+
]);
14141420
// The same capped matrix owns compact and plugin work; admit its longest rows first.
14151421
const nodeTestShards = rawNodeTestShards
14161422
.toSorted((a, b) => (b.predictedSeconds ?? 0) - (a.predictedSeconds ?? 0))
@@ -1433,11 +1439,15 @@ jobs:
14331439
targets: shard.targets,
14341440
requires_go: (shard.groups ?? [shard]).some((plan) => {
14351441
const patterns = plan.targets ?? plan.includePatterns;
1436-
// Explicit stripes own their prerequisites; historical whole-config
1437-
// plans retain the original tooling setup when selection is unknown.
1438-
return patterns
1439-
? patterns.some((pattern) => matchesGlob("test/scripts/docs-i18n.test.ts", pattern))
1440-
: (plan.shard_name ?? plan.shardName).startsWith("core-tooling");
1442+
if (patterns) {
1443+
return patterns.some((pattern) => matchesGlob("test/scripts/docs-i18n.test.ts", pattern));
1444+
}
1445+
if (plan.configs?.length && plan.configs.every((config) => knownToolingConfigs.has(config))) {
1446+
return plan.configs.includes(goToolingConfig);
1447+
}
1448+
// Unknown historical configs retain their original Go setup;
1449+
// current isolated and Docker catalogs exclude the Go owner.
1450+
return (plan.shard_name ?? plan.shardName).startsWith("core-tooling");
14411451
}),
14421452
requires_ripgrep:
14431453
shard.targets?.includes("src/agents/sessions/tools/index.test.ts") ||

‎docs/ci.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,15 @@ The slowest Node test families are split or balanced so each job stays small wit
278278
- Core unit fast/support lanes run separately; unit-src, Control UI, and gateway-core each use three deterministic file-weighted stripes, while the security and media/UI companion configs retain their scoped whole-config support groups; core runtime infra splits into process, shared, hooks, secrets, and three cron domain shards.
279279
- Auto-reply runs as balanced workers, with the reply subtree split into agent-runner, commands, dispatch, session, and state-routing shards; dispatch further isolates core, delivery, and lifecycle entrypoints.
280280
- Agentic gateway/server (control-plane) configs split across chat, auth, model, HTTP/plugin, runtime, and startup lanes instead of waiting on built artifacts.
281-
- Normal CI packs only isolated infra include-pattern shards into deterministic bundles of at most 64 test files, reducing the Node matrix without merging non-isolated command/cron, stateful agents-core, or gateway/server suites. Heavy fixed suites stay on 8 vCPU while most bundled and lower-weight lanes use 4 vCPU. Compact-small bins 2, 5, and 8 use existing 8-vCPU capacity because recent hosted runs showed they repeatedly owned the critical path while the 4-vCPU queue was materially longer; routing happens after packing, so group ownership, coverage, and the existing registration count do not change.
281+
- Normal CI packs only isolated infra include-pattern shards into deterministic bundles of at most 64 test files, reducing the Node matrix without merging non-isolated command/cron, stateful agents-core, or gateway/server suites. Heavy fixed suites stay on 8 vCPU while most bundled and lower-weight lanes use 4 vCPU. Previously promoted compact workloads retain 8-vCPU capacity through their semantic owners and selected files before packing. Timing or build-ownership changes cannot transfer that capacity to an unrelated row. Hosted stripes inherit their parent owner's capacity; whole named manual and release plans retain their existing routing.
282282
- Pull requests on the canonical repository reuse the changed-test resolver against the synthetic merged-tree diff. Precise changes run one targeted Node job; each selected test file gets its own process so stateful suite isolation remains intact. The planner combines sibling tests with import-graph dependents and falls back to a metadata-complete compact plan for workspace package, package/lockfile, shared harness, split-config, renamed, or deleted changes, public extension-contract changes, tests with special shard setup, partially resolved or empty targets, oversized path or target plans, and planner errors. Nondist descriptors run as Node jobs; dist descriptors fold into the built-artifact boundary. The number of compact jobs follows the current measured weights. That PR fallback retains all sixteen tooling stripes, the isolated tooling shard, and the TUI PTY shard because scripts and PTY owners intentionally require their Go, dist, and environment metadata. Those timing-sensitive groups remain isolated in concurrency-one exclusive bins. Targeted plans always retain the full boundary gate because its repository scanners cannot be derived from imports.
283283
- When canonical pull requests fall back to compact planning, directly changed, existing tests owned by the release-only plugin shard remain as exact-file selections in the existing compact jobs. Canonical Vitest routing keeps unit-fast, contract, bundled, and E2E tests with their own suites; source files, directories, deleted tests, and live tests do not widen plugin coverage. The broad `agentic-plugins` sweep remains release-only, and push and manual CI plans are unchanged.
284-
- Canonical `main` pushes use a Blacksmith integration compact with nondist Node jobs plus the dist boundary descriptor. Former multi-config walls (CLI plus CLI-process, isolated plus fake-timers unit fast, and the logging/process/runtime-config trio) are split into per-config shards so no single group floors a lane. They omit the low-signal-per-push tooling and TUI PTY groups while retaining all product-runtime groups, including three file-weighted stripes apiece for unit-src, Control UI, and gateway-core. The Blacksmith 8-vCPU admission target is 200 seconds; the small-runner class retains its measured 276-second admission to balance runner registrations against group work. Manual dispatches and Full Release Validation retain the full named per-shard matrix. No scheduled workflow currently runs that full Node suite; this is a known coverage-timing gap, not coverage supplied by this compact plan.
284+
- Canonical `main` pushes use a Blacksmith integration compact with nondist Node jobs plus the dist boundary descriptor. Former multi-config walls (CLI plus CLI-process, isolated plus fake-timers unit fast, and the logging/process/runtime-config trio) are split into per-config shards so no single group floors a lane. The update dry-run process proof belongs to the isolated CLI-process config, so ordinary CLI tests no longer prepare a runtime. CLI owners use the existing 150-second serial-group admission, and the canonical file splitter partitions oversized whole-config runtime consumers on Blacksmith as well as expanded profiles. Only the child containing the consumer prepares its runtime; both CLI configs retain their two-worker limit. They omit the low-signal-per-push tooling and TUI PTY groups while retaining all product-runtime groups, including three file-weighted stripes apiece for unit-src, Control UI, and gateway-core. The Blacksmith 8-vCPU admission target is 200 seconds; the small-runner class retains its measured 276-second admission to balance runner registrations against group work. Manual dispatches and Full Release Validation retain the full named per-shard matrix. No scheduled workflow currently runs that full Node suite; this is a known coverage-timing gap, not coverage supplied by this compact plan.
285+
- Doctor session and cron tests keep the two longest SQLite files in separate shards, with the remaining files together. Each shard runs complete files under the commands config's existing execution policy. The three owners cannot share a compact job; Blacksmith gives them 8-vCPU placement and its 200-second admission target. The two new owners charge the observed file body plus the full group overhead until the canonical timing refit has two successful main-run samples. Fixture sizes, assertions, and process isolation are unchanged.
285286
- Direct measurements for generated hosted stripes own their packing weights just like native groups. GitHub runs use hosted measurements and hybrid attempt-one runs use Blacksmith measurements; only unmeasured children divide the parent estimate. This keeps an expensive measured child from being packed beside extra work under an artificially small estimate while preserving its test partition and serial execution.
286287
- Changed-plugin config jobs declare their single outer plan as serial, including configs whose inner process chunks run sequentially. The existing worker policy can then use the detected CPU budget without reserving capacity for overlapping plans; multi-target jobs retain their separate concurrency policy.
287288
- The full Node matrix admits the consistently slow serial tooling, auto-reply command shards, and broad core-fast cache writer first. This keeps the 28-job concurrency cap while preventing critical-path work and the next run's transform seed from slipping into a later wave.
288-
- The sixteen tooling stripes use measured file weights to keep the Git owner, managed-process, worker-artifact, and transform-cache proofs in separate jobs. The shard containing the unified declaration compiler fixture uses the existing larger runner because the full-build guard needs a 4,352 MB heap after earlier tooling graphs; hosted splits resolve that resource requirement from each child's selected files before packing. Git owner cases each own an isolated checkout and process tree, so their real timeout and cleanup checks overlap at most two cases per runner. Worker transform proofs use a separate suite with its own fixture lifetime; late child cleanup cannot remove another suite's inputs. These changes preserve the test cases, deadlines, and process isolation; measured admission determines the job count within the existing hybrid row cap.
289+
- The sixteen tooling stripes use measured file weights to keep the Git owner, managed-process, worker-artifact, and transform-cache proofs in separate jobs. Go setup follows explicit selected files first. For whole-config tooling plans, only the ordinary tooling config owns the docs i18n Go tests; isolated and Docker catalogs do not. Unknown historical configs retain their original Go setup. The shard containing the unified declaration compiler fixture retains the existing larger runner; hosted splits carry that placement through each child's selected files before packing. Its synthetic compiler graph uses the existing 1,024 MB heap override, while production full builds keep their resource guard. Git owner cases each own an isolated checkout and process tree, so their real timeout and cleanup checks overlap at most two cases per runner. Worker transform proofs use a separate suite with its own fixture lifetime; late child cleanup cannot remove another suite's inputs. These changes preserve the test cases, deadlines, and process isolation; measured admission determines the job count within the existing hybrid row cap.
289290
- Serial Control UI browser shards greedily pack discovered test files using committed per-file timings, then cold-start basename hints, then source byte size. A measured per-file overhead accounts for fork, import, and setup time. Timing keys supply weights only: discovery still determines the complete test inventory, including new files and files without measurements.
290291
- Broad browser, QA, media, and miscellaneous plugin tests use their dedicated Vitest configs instead of the shared plugin catch-all. Include-pattern shards record timing entries using the CI shard name, so `.artifacts/vitest-shard-timings.json` can distinguish a whole config from a filtered shard.
291292
- The browser-extension Chromium bootstrap command prepares `build:ci-artifacts`, the same runtime profile used by CI dist consumers. It builds the native-host and relay JavaScript, runtime assets, Control UI, and canonical plugin SDK declarations without the full package declaration sweep. The real Chromium flow and its assertions are unchanged.
@@ -557,7 +558,7 @@ The shared plugin catch-all, QA and provider suites use native Vitest sharding,
557558

558559
The final Node matrix admits longer estimated jobs first across both compact and plugin descriptors. Plugin estimates reuse the extension batch cost owner, including existing process boundaries; runtime preparation is charged separately from the same prerequisite table used by compact jobs. Equal estimates and historical descriptors without estimates keep their original order. The 96-job concurrency cap is unchanged. In run `33449014227`, all 96 slots were occupied when the late QA job started; that dependency delay was matrix admission, not evidence of runner-registration throttling.
559560

560-
Actual workflow replay at `0060198` emits 74 nondist compact rows and 77 plugin fallback rows for broad hybrid PRs, with up to 86 other potential job rows across backends. QA/provider partitioning adds five fallback rows, and the Mac split adds two other rows. Conservatively count all 86 other rows as Blacksmith admissions, including hosted and skipped rows. This gives a broad-PR bound of `96 + 77 + 86 = 259` against the compact cap; canonical main has no PR fallback descriptors, giving a bound of 182. Two active main slots plus both pending successors and the previously observed peak of fourteen non-skipped PR arrivals, including superseded heads, give `4 × 182 + 14 × 259 = 4,354` registrations in five minutes. The live bucket rechecked on 2026-09-01 was 10,000; the 6,000 operating target leaves 1,646 for adjacent repositories and burst overlap. This is an arrival-envelope estimate, not an organization-wide admission cap: re-evaluate emitted rows, adjacent repositories and queued-run overlap before increasing fanout. An unused registration bucket does not prove physical runner capacity.
561+
The current planner emits 82 nondist compact rows for broad hybrid PRs and 107 for the GitHub planner profile, plus 78 plugin fallback rows. Trusted contributor forks select the GitHub planner profile but can still run those rows on Blacksmith, so their unchanged 112-row cap owns the conservative PR bound. The workflow has 86 other potential job rows across backends: 15 nonmatrix rows and 71 matrix rows. Count all 86 as Blacksmith admissions, including hosted and skipped rows. This gives a broad-PR bound of `112 + 78 + 86 = 276`; canonical main uses the 96-row hybrid cap without PR fallback descriptors, giving a bound of 182. The command splits fit inside those caps, so their rows are not added again. Two active main slots plus both pending successors and the observed peak of nineteen PR arrivals, including superseded heads, give `4 × 182 + 19 × 276 = 5,972` registrations in five minutes. The live bucket rechecked on 2026-09-01 was 10,000; this is just 28 below the 6,000 operating target. Further fanout needs reductions elsewhere or a narrower, evidenced arrival bound. This is an arrival-envelope estimate, not an organization-wide admission cap: re-evaluate emitted rows, adjacent repositories and queued-run overlap before increasing fanout. An unused registration bucket does not prove physical runner capacity.
561562

562563
`checks-ui-e2e` is sized against its per-shard floor rather than its packing slack. The lane is serial Chromium work: roughly 2,114s of measured test body across 286 control-UI files, and a median 116s that every row pays before and around that body (about 25s checkout, about 44s Node setup dominated by `pnpm install`, about 27s of Vitest transform/import, with a p90 of 143s). Duration-weighted packing already lands the tallest row within about 10% of ideal on held-out runs, so the tallest row falls only by splitting the body further. The hosted-planner count is 14 rows — 13 control-UI shards plus the browser-extension row — which models to a 4:52 median and 5:20 p90 tallest row against 5:28/5:56 at the previous twelve. Two extra registrations per run is negligible against the operating target; the fixed floor, not the bucket, is what bounds further splitting.
563564

0 commit comments

Comments
 (0)