Repository navigation
ci: make CI fast and reliable — every job under 20 minutes, recurring flake removed - #12247
Merged
Merged
Conversation
The Linux package job failed on main (EAI_AGAIN github.com) and on PRs (read ECONNRESET) because electron-builder re-downloads its packaging tools on every run. Cache the tool and Electron archives so steady-state builds never depend on those endpoints, on both the Linux and Windows packaging jobs. Co-Authored-By: Claude Fable 5 <[email protected]>
… sync stack readiness The merge gate ran under always() and failed hard on 'cancelled' upstream results whenever cancel-in-progress superseded a run — 3 of the last 4 re-run-to-green cycles on this workflow were exactly that. Gate now goes neutral on cancellation and defers to the superseding run. The sync Cloud Tasks stack's one genuine flake: scenarios run back-to-back, a dying child of the previous stack can still answer a TCP probe, and the authoritative health check had the tightest budget (20s) while the weak port probe had the generous one. close() now drains the stack's ports and health gets 60s. Co-Authored-By: Claude Fable 5 <[email protected]>
…ry run Desktop Swift CI's tail (p90 150 min, max 218 min) was queue time: the repo's only macos-15 consumers demanded ~4.9 concurrent runners against a cap of ~5. Cut the demand instead of the deadline: - Run the release-mode UserNotifications regression inside the Release Compile job, next to the release build it consumes, instead of paying a second from-scratch release build (~31 min) on the verify runner. The planner still requires the Release Compile check by exact name, and the Build & Tests aggregate now hard-fails on the release job's result, so release tagging and PR merges both still gate on it (#11373/#11374 protection preserved). - Cache SwiftPM dependencies and the release Desktop/.build in the Release Compile job, saved from main pushes so every ref can restore it, and drop the forced rm -rf that guaranteed a ~20-min cold build. - Run launcher script tests 3-way parallel with per-test logs (9.3 min serial p50), and widen the build-lock recovery budgets that saturated runners pushed past 4s. - blob:none the verify checkout; full history stays for diffing. Co-Authored-By: Claude Fable 5 <[email protected]>
…ulable burns Mobile and Web Checks' p90-to-max tail was almost entirely actions/checkout pulling all blobs of a ~1.25GB repo with fetch-depth: 0 (a 53-minute checkout-only Web run happened); history-needing jobs now use blob:none and worktree-only jobs go shallow, with timeout caps so no job can idle unbounded again. The Android compile smoke paid a ~700s cold Gradle build every run because the default cache policy never wrote from main; main now seeds the cache PRs read, and the build_runner cache keys drop the run_id suffix that guaranteed a miss on every single run. Parakeet GPU tests have failed nightly since 08-03 burning exactly 45 min each with zero logs: the pod is unschedulable (L4 pool at capacity) and the workflow neither noticed nor captured pod events. Gate on PodScheduled within 5 minutes with the real cause in the error, stream pod logs live so deadline kills keep evidence, and include pod events in diagnostics. The capacity fix itself (NLLB squatting the parakeet pool's second GPU) is a cluster change tracked separately. Co-Authored-By: Claude Fable 5 <[email protected]>
…ft; pin uv 13 of the last 17 Repo Checks failures were the line-count ratchet, and the nondeterministic ones shared one cause: the check demanded byte-exact absolute counts against a synthetic merge with origin/main, which moves under every open PR (~90 pushes/hr). A correct declaration went stale with no author action, in both directions (drifted endpoints, and previously- mandatory exceptions turning fatally 'unused' when main absorbed an edit). The declaration now approves a growth *allowance* — the delta is a property of the PR alone — and an exception the diff no longer needs warns instead of failing. Growth beyond the allowance, duplicates, malformed lines, and unsupported paths still fail. Also pin setup-uv's resolved version (matching backend/Dockerfile's UV_VERSION) so it stops fetching the astral-sh 'latest' manifest, which hard-failed a run. Co-Authored-By: Claude Fable 5 <[email protected]>
Every unpinned astral-sh/setup-uv call resolves 'latest' by fetching the astral-sh/versions manifest from raw.githubusercontent.com at job start — one observed Repo Checks failure was exactly that fetch dying. Pin the same 0.11.13 the backend Dockerfiles already use, which the action resolves locally with no network call. repo-checks.yml was pinned in the previous commit; this covers the remaining call sites and the release-eligibility action (with its byte-exact contract fixture). Co-Authored-By: Claude Fable 5 <[email protected]>
…back The debug suite spawned one 'xcrun swift test' process per discovered suite — 674 SwiftPM startups at ~5.1s each, ~28.7 min of the verify job's wall clock, dwarfing actual test execution. Workers now run suites in batches of 25 through one SwiftPM process (repeated --filter flags), with batching kept strictly optimistic: a batch that exits non-zero or times out is discarded and every member re-runs through the untouched per-suite path, so isolation semantics, per-suite budgets, and failure attribution are unchanged for anything red. The serial shared-auth cluster is never batched, and OMI_SWIFT_TEST_SUITE_BATCH_SIZE=1 restores the old behavior bit-for-bit. Also fixes a pre-existing bash-3.2 set -u break (empty build_args expansion) that made OMI_SWIFT_TEST_PREBUILD=0 kill every suite, and restores the case-pattern skip list in the workflow's launcher step that check-launcher-test-skips.py parses. Co-Authored-By: Claude Fable 5 <[email protected]>
…unner verdicts The suite's recurring 'flake' was one deterministic trap: a module-scope sys.modules['utils'] stub with __path__ = [] turned every new import in routers/conversations.py into a ModuleNotFoundError for whoever ran CI next — main broke twice on 2026-08-25 and four unrelated PRs inherited the red. The stub package now carries the real package __path__, so unlisted submodules resolve to the real module instead of raising (explicit stubs still stub; verified by reproducing the incident against both versions). Checkout p90 was 267s and max 786s from full-blob clones; blob:none keeps the merge-base history scripts/changed-files needs. timeout 45→30 so a hang stops burning a concurrency slot for 25 minutes past the p90. Also two standing runner bugs found while measuring: pytest's exit 5 on total worker death was read as 'no tests selected' and reported green, and the fast-unit duration guard's verdict was silently discarded under xdist (workers now hand offenders to the controller). A single-session xdist partition of the suite was implemented, measured, and disproved on this tree (upb descriptor segfaults, OOM at 815 files, per-worker collection); it ships opt-in via BACKEND_PYTEST_PARALLEL_SESSION=1 with the measurements in the comments, default behavior unchanged. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
…rkers The first PR run of the batched suite exposed one pathology: the batch carrying MemoryAtlasPerformanceHarnessTests (245s of XCTest measure blocks, slower still under contention) blew its 17-minute budget and paid the 25-suite isolated fallback on top — 15 of the step's 40 minutes. Measure suites are now derived from the source (like the serial cluster, so a new one cannot silently join the batch pool) and run in their own SwiftPM process with a doubled per-suite budget. With per-invocation SwiftPM startup gone — the reason two workers were the measured ceiling — workers now match the runner's three cores. This PR's CI runs are the macOS-runner evidence; drop back to two if the performance harness starts timing out. Co-Authored-By: Claude Fable 5 <[email protected]>
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.
Make CI fast and reliable again: every job under 20 minutes, and every recurring source of red that wasn't a real code defect removed. Based on a full audit of the last week of runs (per-workflow histories, job/step timings, and failure logs for every red run on main plus re-run-to-green pairs).
What was broken
always()and turned concurrency cancellations into hard red. 1 of 4: sync-stack health check had a 20s budget while the weak TCP probe had 120sfetch-depth: 0full clones of a 1.25 GB repo; Gradle cache never written (every APK build ~700s cold); build_runner cache key ended inrun_id(guaranteed miss); no job timeoutsWhat this PR does
Desktop Swift CI (demand drops from ~4.9 required concurrent macOS runners to well under 1, so the queue collapses; expected macOS-engaged wall clock 8–15 min):
--filterflags). Strictly optimistic: any red or timed-out batch is discarded and every member re-runs through the untouched per-suite path — isolation semantics, budgets, and failure attribution unchanged for anything red; serial shared-auth cluster never batched;OMI_SWIFT_TEST_SUITE_BATCH_SIZE=1restores old behavior exactly. Full hermetic-fixture coverage added.Desktop/.buildin the release job (saved from main pushes, readable by every ref) and drop the forcedrm -rfcold build.blob:nonecheckout (history kept for diffing).set -ubreak that madeOMI_SWIFT_TEST_PREBUILD=0kill every suite.MemoryAtlasPerformanceHarnessTestsblew its budget and paid the isolated fallback (~15 of the step's 40 min), so measure-block suites are now derived from source and always run solo with a doubled budget; and with per-invocation SwiftPM startup gone, workers go 2→3 to match the runner's cores (this PR's runs are the evidence; revert to 2 if the perf harness times out).Backend Unit Tests: the recurring "flake" was one deterministic trap — a module-scope
sys.modules['utils']stub with__path__ = []turned every new import inrouters/conversations.pyinto aModuleNotFoundErrorfor whoever ran CI next (main broke twice on 08-25; four unrelated PRs inherited the red; the stub list already carried duplicate entries from repeated incident patching). The stub package now carries the real package__path__, so unlisted submodules resolve to the real module — verified by reproducing the incident against both versions. Checkout p90 267s/max 786s fixed withblob:none;timeout-minutes45→30. Two standing runner bugs found while measuring were fixed: pytest's exit 5 on total xdist worker death was read as "no tests selected" and reported green, and the fast-unit duration guard's verdict was silently discarded under xdist. A single-session xdist partition of the suite (the obvious next speedup) was implemented, measured, and disproved on this tree — upb descriptor segfaults when co-collecting stub-heavy files, OOM at 815 files, and xdist collects the full selection per worker — so it ships opt-in (BACKEND_PYTEST_PARALLEL_SESSION=1) with the measurements recorded in comments, defaults unchanged. The real speed ceiling here is interpreter startup ×919 files; a fork-server runner that pre-imports the heavy common set and forks per file would keep per-file isolation exactly and is the recommended follow-up.Repo Checks: the
Line-Count-Exceptiondeclaration now approves a growth allowance (the delta, a property of the PR alone) instead of exact endpoints, making the check invariant under base drift; exceptions the diff no longer needs warn instead of failing. Grammar unchanged; existing PR bodies stay valid. Over-allowance growth, duplicates, malformed lines, unsupported paths still fail.Backend Hermetic E2E: merge gate is
!cancelled()and defers to the superseding run on partial cancellation; the sync Cloud Tasks stack drains its ports between scenarios and gives the authoritative health check 60s (TCP probes kept their generous budgets while the strong check had the tightest one).Desktop Windows CI: cache electron + electron-builder downloads on both packaging jobs so steady-state builds never touch github.com mid-build.
Parakeet GPU Tests: fail in ~6 min with the truth (PodScheduled gate with a 5-min bound, pod
FailedSchedulingevents in the output, live-streamed pod logs that survive deadline kills) instead of a silent 45-min burn.Mobile/Web Checks:
blob:nonewhere history is needed, shallow where it isn't; Gradle cache written from main and read by PRs (org.gradle.caching=true); build_runner cache keys drop therun_idsuffix; timeout caps on every job.Everywhere:
setup-uvpinned to 0.11.13 (matching the backend Dockerfiles) at all 14 call sites — an unpinned version resolves "latest" via a network fetch that has already hard-failed a run.Verified
run_checks.py --lane cimanifest (34 checks) passes on the final tree.actionlintclean (with the repo's-shellcheck ""convention) on every touched workflow; YAML parses everywhere.The honest residual
Every job is now under 20 minutes except two, both with a clear story:
check_runner_cost_policydeliberately blocks) — not CI mechanics.The 150-218 min p90 is gone regardless: it was queueing, and the demand that caused the queue no longer exists.
Not in this PR (needs decisions/permissions beyond the repo)
Parakeet GPU capacity — the actual outage:
dev-nllb-nllb-translation(no node selector beyondnvidia-l4) squats the second L4 inparakeet-pool, whose autoscaler is capped at 1 node/zone, so the CI pod has been unschedulable since 08-03. Fix is a cluster change: give NLLB its own pool or taintparakeet-pool, or raisemaxNodeCountto 2.Branch protection — Repo Checks is not a required status check: both recent main failures were PRs merged red (their PR runs had already failed with the identical error). A settings change, and the highest-leverage reliability fix available.
desktop_codemagic_failure_recovery.yml— itscheck_runtrigger mints a skipped run for every check completing in the repo (~2,300/day, 42k total; the runs API now truncates at its 40k listing cap). Zero billable minutes, but it drowns run history.check_runhas no trigger-level name filter and the producing check is Codemagic's (external app), soworkflow_runcan't replace it; the clean fix is a webhook→workflow_dispatchfilter or a scheduled poll, which changes release-recovery mechanics and deserves its own review.Orphaned FluidAudio pin —
desktop/macos/Desktop/Package.resolvedpins FluidAudio revision19600a485baa, which is no longer reachable from any branch/tag upstream (found while running the pre-push gate: a fresh SwiftPM mirror clone cannot resolve it; only warm caches keep it alive). Any cold-cache CI run or new contributor hitserror: could not find the commit. The pin should be moved to a reachable revision/tag in its own PR.🤖 Generated with Claude Code