Repository navigation
improve(ci): cut hosted test import time with warm caches - #123465
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 1:28 AM ET / 05:28 UTC. ClawSweeper reviewWhat this changesThe PR adds a default-off shared CI setup input so selected GitHub-hosted Linux Vitest lanes restore existing transform and test-scope Node compile caches. Merge readinessKeep this maintainer-authored, maintainer-labeled CI improvement open for exact-head workflow completion and human review. The supplied diff and prior review show a focused cache-reader expansion, but sandbox failure prevented the required source, history, scoped-policy, and current-main inspection. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s shared CI setup action prepares Node and cache state for workflow jobs. Selected Linux test jobs pass an input to that action, which decides whether existing cache readers are enabled before Vitest runs. flowchart LR
A[Hosted CI job] --> B[Shared Node setup]
B --> C{Restore test caches enabled?}
C -->|Yes| D[Restore transform cache]
C -->|Yes| E[Restore Node compile cache]
C -->|No| F[Cold test startup]
D --> G[Vitest test run]
E --> G
Decision needed
Why: The PR is maintainer-authored and maintainer-labeled, while the changed shared action governs CI cache behavior across many jobs. Before merge
Agent review detailsSecurityNone. PR surfaceTests +104, Docs 0, Config +10. Total +114 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land only after exact-head hosted CI confirms the selected jobs are restore-only consumers and a maintainer verifies that the writer election and backend-specific cache behavior remain unchanged. Do we have a high-confidence way to reproduce the issue? Not applicable: this is CI performance work, so the relevant proof is exact-head hosted workflow behavior and timing rather than a user-facing bug reproduction. Is this the best way to solve the issue? Unclear: the proposed shared input appears to preserve a single reader path, but full source and workflow inspection was blocked before that architecture could be independently compared with current alternatives. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 1ea149910703. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…23465) * perf(ci): restore hosted test caches across lanes * perf(ci): restore caches in remaining Vitest lanes
What Problem This Solves
GitHub-hosted outage-mode CI had a warm Vitest transform cache and test-scope Node compile cache, but only the
checks-node-*matrix restored them. Other Vitest-running Linux lanes repeated cold import/transform work against the same immutable protected cache generation.Why This Change Was Made
The shared setup action now exposes one default-off, restore-only
restore-test-cachesinput that enables both existing reader paths without changing either key family. GitHub backend routing flips that input only at audited Linux Vitest call sites; mixedchecks-fast-corerows are task-gated so non-Vitest checks do not pay restore cost. Blacksmith behavior is unchanged, and the existing elected Node shard plus the warmer remain the only transform-cache writers.This is AI-assisted work, reviewed with the repository autoreview workflow.
User Impact
There is no product behavior change. Hosted CI lanes can reuse transform and orchestration bytecode instead of independently paying cold import cost, reducing outage-mode feedback time while every newly added consumer remains restore-only.
The tradeoff is explicit: the pruned transform archive can reach 2 GiB. At roughly 125 MB/s, restoring it costs about 16.4 seconds, or 15–20 seconds with overhead. Actual hosted contract-lane measurements show roughly 21 seconds of transform work against roughly 8 seconds of restore cost, while broader cold Vitest imports reached 99.52–142.93 seconds. The single default-off input keeps rollback localized if measured savings fall below restore cost.
Evidence
Hosted cache wiring audit
checks-node-*test shardschecks-uisetup-node-env.checks-ui-e2echeck-sqlite-session-lifecyclesetup-node-env, thenscripts/run-vitest.mjsfor the built-CLI lifecycle proof.checks-fast-plugin-contracts-*pnpm test:contracts:plugins, which routes throughscripts/run-vitest.mjs. Audit measured about 21 seconds of transform work versus about 8 seconds of restore.checks-fast-channel-contracts-*pnpm test:contracts:channels, which routes throughscripts/test-projects.mtsand preserves the filesystem cache environment.checks-fast-core:bundled-protocol,contracts-plugins-ci-routing,ci-routing,bun-launcherchecks-fast-core:coercion-helpers,max-lines-ratchetnative-i18nscripts/native-app-i18n.tsinventory/parity commands and never invokes Vitest.control-ui-i18nscripts/control-ui-i18n*.tsverification/parity commands and never invokes Vitest.checks-ui-e2e-real-gatewaybuild-artifactsbuildcompile-cache namespace and writer policy; the combined test-cache input would not restore the required test-scope namespace.Validation
sqlite-session-lifecyclebecause the input was absent; it passed after the workflow change.node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts— 120 passed, 2 skipped.node --import tsx scripts/check-workflows.mts— passedzizmorand reported no direct composite run-block input interpolation../node_modules/.bin/oxfmt --check .github/workflows/ci.yml docs/ci.md test/scripts/ci-workflow-guards.test.ts— passed.node scripts/docs-list.jsandgit diff --check— passed.