Repository navigation
perf(ci): reduce queue pressure without paid runners - #23053
Conversation
# Conflicts: # src/renderer/src/components/terminal-pane/terminal-pane-hook-order-parity.test.ts
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — first review of this CI-efficiency pass at 5a26cfa83d.
- Superseded-run cancellation:
pr.yml's reusable unit-test call and the finalverifyaggregate moved fromalways()to!cancelled(), and the Git-termination, Pi-owner, and Pi-provider runtime workflows gained PR-scopedconcurrency(manual runs preserved). - Guards folded into detection:
code_pathsnow runs the root-directory and README-link guards on one sparseblob:nonecheckout; the standaloneroot_directory_guardjob and itsverifydependency are removed, withverifystill the required aggregate. - Free runner labels: small guard/aggregate/API jobs moved to
ubuntu-slimand typechecking toubuntu-24.04-arm. Verified against theubuntu-slimimage README — Node 24.21.0, Git 2.55.0, andgh2.101.0 are present, no moved job needs the unsupported Docker-in-Docker, and every job sets a timeout under the 15-minute container cap. - Cloud secret-scan fetch:
fetch-depth: 0replaced byfetch-depth: 1plusgit fetch --no-tags --unshallow origin "$GITHUB_SHA", keeping theHEAD-rooted gitleaks scope; a real-git fixture proves both merge parents and deleted blobs are still scanned and unrelated refs are not fetched. - Shared main-branch caches: new hourly
ci-cache-warmup.ymlseeds Node 24 native modules, the pinned Git 2.25.5 binary, and TypeScript incremental state on the default branch;prepare-git-compatibilityis extracted into a composite action shared withpr.yml. - Unit shard timing evidence: a Vitest reporter plus importer record per-file environment/import/test durations and reject incomplete, duplicate, mixed, or failed runs;
cloud/pnpm-lock.yamlis dropped from the unit shards' cache key (cloud is a separate pnpm project). - Mobile test dedup: the real bundle and route closures are memoized behind per-assertion copies, and parsed grant references are cached per file + source version, with regressions for both.
I re-ran the changed contract tests (10 files, 149 tests) and pnpm run check:code-quality:changed (0 findings) locally; both pass. The mobile bundling tests skip without mobile/node_modules and are covered by the hosted runs cited in the PR body.
ℹ️ The Cloud secret-scan fetch and its --log-opts are now a coupled pair
cloud-verify.yml now fetches exactly HEAD's ancestry, which is precisely what the gitleaks step scans (--log-opts="HEAD -- cloud ..."), so the scan scope is unchanged today. The two are now load-bearing on each other: if the scanned range is ever widened to a ref or range outside HEAD's ancestry (a base..head range, --all, or tags), the reduced fetch would silently scan an incomplete history and still report success. The new fixture test pins the current --log-opts string, so this is a note for future edits rather than a defect in this change.
Technical details
# Cloud secret-scan fetch/scan coupling
## Affected sites
- `.github/workflows/cloud-verify.yml:38-42` — `git fetch --no-tags --unshallow origin "$GITHUB_SHA"` fetches only HEAD ancestry.
- `.github/workflows/cloud-verify.yml:44-50` — gitleaks `--log-opts="HEAD -- cloud ..."` defines the scanned range.
- `config/scripts/cloud-security-history-workflow.test.mjs` — pins the current log-opts and proves merge-parent and deleted-blob coverage for HEAD.
## Required outcome
- Any future widening of the scanned range must be paired with a fetch that includes those refs, or the secret scan silently under-reports.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
PRs spend too long waiting for runners. Stop superseded tests from occupying the queue, remove repeated setup and mobile-test builds, and reuse caches across PRs. All runner choices remain free for this public repository.
What Changed
verifycheck.always()on unit tests and the final check with!cancelled(). Cancel superseded PR attempts in three additional runtime workflows.Why
A successful full PR used 74.6 runner-minutes, with unit jobs waiting up to 18 minutes and the final three-second check waiting another four minutes. Two superseded runs later held 11 runners and consumed 71.3 extra runner-minutes after replacement pushes. Both obsolete runs were confirmed against current PR heads and cleared.
Removing repeated work reduces shared runner demand. More shards would add setup and allocations; different runner labels do not increase the account's concurrency limit. Shard count, isolation, retries, coverage, platform contracts, and release behavior are preserved.
Linked Issue
Fixes #23050
Visual Proof
N/A — CI configuration, test efficiency, and a verified test snapshot update; no app UI changes.
Testing
Full local typechecking, focused workflow/timing contracts, 103 mobile checks, hook parity, changed-code quality, formatting, and actionlint pass. A real sparse checkout retained the complete index while materializing 12 files (192 KB). Real Git fixtures prove security scanning retains both merge parents and deleted historical content. Independent review checked aggregate failure handling across 110 result combinations and retained mobile assertions.
Hosted observations from 36217238462:
Mobile passed all 450 tests across the same 43 files (448 original tests plus two regressions). Unit artifacts cover all 9,564 discovered files exactly once with zero unhandled errors. Seven shards passed; the only failure was the stale main-branch hook snapshot corrected here. A four-worker experiment reduced aggregate test time from 3,110s to 2,814s, but the repeat run exceeded the palette matcher's existing 180ms performance budget at 235ms. The override was removed. No assertion, time budget, or shard weight was relaxed; no failed timing baseline was imported.
Cloud, Pi matrices, Git termination, warmup, static analysis, Linux/Windows packaging, shell, wire, and browser-provider checks passed. The Git check restored the warmup's binary cache. Default-worker hosted run 36219967348 passed every other changed and platform check and all eight unit shards. Its unchanged mobile terminal-render test failed twice on the existing timing assertion (449/450 mobile tests passed); the failure is documented in the CI report and no assertion or timeout was weakened. General E2E, IME, and WSL retain their existing draft/path gates.
AI Disclosure
Review
Preserves scan history, test assertions, required-check failure handling, and platform boundaries. No paid services or release-policy changes.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
These are observational samples, not controlled benchmarks. Active duration is separate from account-wide queue time. Sharing caches across new PRs requires this producer to land on main; hosted trials verify cache commands and compatible keys, not a completed rollout. See
docs/reference/ci-runner-efficiency.mdfor evidence and no-cost capacity options.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)