Repository navigation
perf(ci): select affected tests and reduce build and deployment overhead - #1031
Merged
Merged
Conversation
athvin
marked this pull request as ready for review
November 9, 2026 08:18
This was referenced Nov 9, 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.
Closes #648
What
Reduce CI setup overhead, select affected Rust suites, and avoid unchanged observability upgrades. Add release compiler caching and an opt-in archive-build experiment.
Why
Recent runs spent 1–3½ minutes per job deleting SDKs and up to 8m43 downloading nextest. Ordinary UI changes also ran backend integration suites.
Proof
Full
make checkpassed; the CI regression suites, workflow lint, and shell-budget checks pass. All 15 required hosted contexts passed (Rust, frontend); both image builds passed. The API image completed in 3m44 with a populated compiler cache. The final documentation-only commit also passed (Rust, images); its warm API image build completed in 3m23.Risk & rollback
Selection errors can hide coverage; unknown inputs select the full gate and required aggregates reject classification failures and unexpected skips. Revert this PR to restore prior scheduling. Deployment health/migration/cutover checks remain in place.
Post-merge ledger
Closed by: Codex · session
Codex:01a1bef1-8627-7c21-8a86-6c4743d8906fonMac-26· 2026-11-09T09:34:56+00:00mainis green with this change on it —4998a58a7971543384f5d3cfa15ef1654c5cf26fcontains both changes. Rust run 42590148101, frontend 42590148224, infra 42590148650, images 42590148445, devcontainer 42590148323, and deploy 42590174746 all succeeded. Original mergece3fd01balso passed Rust 42586199942, frontend 42586200014, infra 42586199982, devcontainer 42586199900 and images 42586200002.images— Original images run 42586200002 succeeded. Cold main dependency cooking took 26m33, application compilation 2m01, with zero cache read/write errors. Actions cache API confirms newsccache/objects onrefs/heads/main. The fix-only image run 42590148445 correctly skipped both builds and reused these images.deployconverged — Deploy run 42590174746 succeeded for both environments and logsdeploying 4998a58a7971543384f5d3cfa15ef1654c5cf26f. At verification of that deployment, both services selected dev green / prod blue. The serving API processes emitteder-server listeningat 09:04:35.648292 UTC (dev podweb-api-green-78d6f787fc-5prb4) and 09:03:58.074266 UTC (prod podweb-api-blue-5b6b4f7c49-4w4j2); both containers in both pods are ready with zero restarts. The original dev attempt 42590105679 stopped before application cutover on the diagnosed Fluent Bit label mismatch; fix(ci): recognize the deployed Fluent Bit instance label #1038 fixed it.Doneautomatically — re-tune the CI gate now that compute is free and runners are 4-vCPU #648 closed by PullRequest perf(ci): select affected tests and reduce build and deployment overhead #1031; Product Roadmap status Done, verified through issue timeline/project fields..claude/skills/ci-and-supply-chain/references/build-cost.mdrecords the measurements, rejected archive experiment, compiler pin/cache design, and observed Fluent Bit chart label. This ledger records the live rollout evidence.Specific to this change
Live observability verification — deploy logged
observability: reconciled and verifiedat 09:04:00 UTC and created ConfigMaper-observability-applied. A subsequent probe ran the exact wrapper against live AWS/Helm/Kubernetes reads with all mutation calls replaced by a failing guard; it printedobservability: unchanged and healthy; skipping reconciliationwithout invoking the guard.Main compiler-cache writes verified through zero write errors and new main-scoped cache objects; subsequent hit rates and 20-run median/p95 measurements are deferred — Measure CI and deployment latency over 20 post-rollout runs #1036.
Completed the observation window — no further failures after the diagnosed dev failure at 09:01:35 UTC through 09:34:56 UTC. The subsequent marketing release also passed all main checks and deployed successfully.
Subsequent real release — marketing merge
8c9111b0retains both changes and passed Rust 42593494870, frontend 42593494701, infra 42593494824, devcontainer 42593494793 and images 42593494737. Deploy 42593707865 succeeded for dev and prod and loggedobservability: unchanged and healthy; skipping reconciliationat 09:29:24 UTC (15-second step). The web image job took 1m27; merge-to-prod was 3m47 (09:26:53–09:30:40), one warm frontend-release sample rather than a percentile. Live services now select dev blue / prod green; ready API processes emitteder-server listeningat 09:29:58.946332 UTC and 09:29:17.836392 UTC respectively, with zero container restarts.Context — plan, discoveries, measurements, files
Plan
Discoveries
ECR trusts a branch-based OIDC subject. Attaching the protected R2 cache environment to its job would break authentication, so release compilation uses branch-scoped GHA cache via BuildKit secrets; Rust CI remains on R2. Archive reuse was rejected: five comparisons had identical test identities and all 45 jobs passed, but including producer/transfer time made it 7.33% slower.
Measurements
python3 scripts/ci/archive-verdict.py 42575743751: baseline median 464s, archive median 498s; do not adopt. Experiment run.First implementation run: disk cleanup 0s; pinned tool setup 1–2s; er-match test job 3m20. This is not an overall five-minute claim. Repeated warm-run results and release cache behavior still need post-merge measurements.
rustrun42577766444: 8m54, longest jobpg m-z7m56, comprising 137s compilation + 306.31s test execution; disk cleanup 0s, tool installation 2s. The final er-match job was 2m47. The complete backend gate is still over five minutes: affected-suite selection avoids unrelated work, but it does not make a full integration pass fit the target. The remaining slow tests cover mass updates, merge/unmerge, master protection, record suppression, and the complete pipeline; they remain correctness gates.The API image's warm validation took 3m44, with dependency cooking 57.15s (100% Rust/C/C++/assembler cache hits, zero cache errors) and the application build 1m11. The earlier cold attempt cooked in 24m23 and then rebuilt Rust dependencies in 8m56 after switching from Rust 1.99.0 to floating stable 1.99.1. Pinning the compiler consistently prevents that rebuild. These are PR image measurements, not a deployed production percentile. Main must populate its own branch-scoped cache.
Two image attempts failed downloading sccache inside Docker (HTTP 504); image builds now use the verified CI archive through a named context. The final Rust audit also needed one retry because the unchanged third-party cargo-deny action downloaded an invalid archive. No correctness test failed in those runs.
Selection examples
Using the real Cargo metadata graph: an
er-serversource change selects one affected application package and the server tier; aner-matchsource change selects three affected application packages and both integration tiers; a lockfile change selects all 32 packages. Every Rust change also selects theer-errors,er-schema, ander-entity-genrepository-wide guard suites, which inspect source files without Cargo dependency edges. Ordinary UI changes skip Rust compilation; embedded API contracts and generated entity bindings retain their backend checks.Files