Skip to content

ci: reduce redundant runner admissions and preserve main caches - #4284

Merged
yannickmonney merged 2 commits into
mainfrom
fix/preserve-main-build-cache
Oct 4, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/preserve-main-build-cache

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Ordinary CI workflows previously waited for a hosted runner just to echo their already-known event commit, then queued again for useful work. The seven workflows now reserve the standalone source resolver for release candidates. All 33 ordinary job definitions explicitly handle the intentional skip while preserving cancellation, dependency, draft, fork and path decisions. Pull requests and merge groups retain their event merge commit; manual CLI publication retains its resolved release tag.

Main Build runs now continue when another main push arrives, so they can finish publishing their reusable layer cache. Newer pushes coalesce in the pending slot. PR and merge-group cancellation remains unchanged; release candidates retain their separate groups and validation.

Candidate SHA validation, current-attempt receipts, all eight image digest checks, runner permissions, test commands and timeout budgets remain unchanged. Failed integration-scope detection still admits Backend integration so its existing first step reports the failure; it does not run a guessed scope or report a successful skip.

Validation:

  • Pinned Bun 1.4.2: 324 tests passed, 2,394 assertions across the existing workflow/deployment/release-gate suites. Seven old-source causal failures prove the removed ordinary resolver admission; the final matrix covers all 33 ordinary job definitions and failure/cancel/skipped/missing dependencies.
  • Scoped strict TypeScript, actionlint with ShellCheck, declared lint/format, manual register gate and normal commit hooks passed. Scoped SAST ran 5 TypeScript rules on 1 file with zero findings; actionlint owns YAML validation.
  • Parsed comparison of the resolver commit against the preceding main-cache commit preserves all seven candidate gates, concurrency policies and every other workflow value outside the intended predicates and Build's event-SHA fallback. Shared candidate resolver, receipt and gate source remain byte-identical.

Fresh hosted CI is still required. Local expression checks cover the current supported predicates, not GitHub's scheduler implementation. Hosted ordinary runs must confirm skipped resolver jobs without runner assignment, useful checks actually executing on the expected source, and complete normal gates. No release-candidate dispatch, CI cancellation, runner-policy change or paid capacity change was performed; no measured queue improvement is claimed yet.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review — main Build non-preemption

Accepted source for normal publication; no blocking finding. Exact commit a05e2b1f14d7fee5a7c4ce7d1b17699f551c6325, tree 5e11b2635072f4b513d6a24c88d263dc2b98ce99, base ffa15e019c3b6453bfb82dc44231abef2b8be0de. Root owns publication, fresh hosted gates and merge. No tests, services, source edits or remote mutations were performed by this reviewer.

Independently verified manifest SHA 9137e171e696afe36397e0062939622f4bae38e12dd5bf756f0cc51b6426b359, both copied source SHA/Git blobs against exact commit, ten receipt hashes, full candidate.patch SHA 5e062f76adf2477f7fb274cd55d7e9b1dd00eab0fffc2a9a8957de56c3a95f06 against Git's exact base-to-head diff, tree and clean worktree. Initial path assumption source/ was wrong; the snapshot uses files/; corrected verification passed without changing files.

The only functional workflow delta is cancel-in-progress: false for ordinary push at refs/heads/main, true for PR/merge_group supersession, and still false for both candidate dispatch types. The concurrency group expression is byte-identical. After removing comments/blank lines and that one setting, the complete workflow functional bytes equal base. Thus candidate SHA isolation, permissions, checkout pins, image build/cache settings, all eight matrix images, digest receipts, image-validate/smoke checks and Candidate gate remain unchanged. There is no selective-image shortcut or mutable tag substitution.

The new test evaluates the parsed workflow's actual expression, not a second handwritten policy. For its six bounded lowercase event/ref inputs and equality/boolean-only expression, Node vm and Actions yield the same booleans. GitHub's case-insensitive string equality and broader coercion rules differ generally; the test explicitly limits its equivalence claim and the existing exact-expression assertion prevents unnoticed unsupported syntax. All actual supported events are represented; the other-push row is an extra boundary although the workflow only triggers pushes to main. GitHub expression semantics

Actual supplied Bun1.4.2 744846f84 red receipt is causal: old policy fails only main-push expectation, with five negative/control rows passing. Corrected receipt has83/83 tests and739 assertions, covering deployment-ci and release-candidate-workflows. Existing tests still reject missing/foreign-source/missing-digest image receipts and skipped/failed/cancelled candidate dependencies. The normal-hook commit log is retained. Declared scoped lint/actionlint receipts are clean; the auxiliary type-aware invocation has30 diagnostics, and I independently normalized/compared the baseline and candidate logs to confirm all30 identities in order are the same. No blanket type-aware-green claim. Supplemental actual SAST hash verifies five rules/one file/zero findings, with one configured exclusion disclosed.

The tradeoff is correctly documented: admitted older-main Build completes before the latest pending main run starts; default concurrency still coalesces pending intermediate commits. This protects an admitted cache producer but does not guarantee every main commit receives a finished Build, cache hits, queue elimination or immediate latest-main proof. Cancellation from another cause remains possible. Candidate dispatch groups remain separate. GitHub concurrency

Postmerge observation should inspect one ordinary completed main producer and subsequent ordinary PR cache reuse before claiming throughput improvement. No rerun/dispatch or scheduling mutation is needed for source acceptance. Current CI capacity and cache retention can remain independent bottlenecks.

@yannickmonney yannickmonney changed the title ci: let admitted main builds finish publishing cache ci: reduce redundant runner admissions and preserve main caches Oct 4, 2026
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Source review disposition for exact head 98159fbb9acb4730f0eeff7aeb7d967aace3555c (tree 39810e0fe4d98433d3fd022e85b1d4a0dbe8f930): two distinct source reviews accepted the frozen combined change with no blocking finding. The normal fast-forward preserves the separate main-cache policy commit a05e2b1f and resolver-admission commit 98159fbb.

The reviewers checked all 33 ordinary job definitions, skipped-needs propagation, cancellation, candidate fail-closed behavior, event merge SHA identity, CLI tag publication, and the existing visible failure when integration-scope detection fails. Parsed comparison preserves the seven candidate gates and all other workflow values outside the intended predicates/source fallback. Shared resolver, receipts and eight-image digest proof remain unchanged.

Observed local proof: pinned Bun 1.4.2, 324 tests / 2,394 assertions; seven causal old-source resolver-admission failures; scoped strict types, actionlint with ShellCheck, lint/format, manual register, scoped SAST and normal hooks. Frozen manifest SHA-256: e3d5db079ddd0793709edbf496f019bd81dd040f2f16d7f490f1aa568ed38d4f.

Publication was guarded against public main 43f29ec53713823dfb6a7358783e1128bd1c3ca7; the conflict-free composed tree is 78e428691ef27b3967df71463de8f96846e176d0. CI/tool/dependency inputs are unchanged by those independent incoming application changes; ten proposed blobs remain exact and the manual register combines both sides.

This is source acceptance, not merge or runtime acceptance. The new ordinary hosted run must demonstrate skipped resolver/no runner, actual useful-job execution on the expected commit, and complete fresh checks. No manual candidate dispatch, retry, cancellation, runner-policy change or paid-capacity change was made. Local checks do not establish measured queue improvement.

@yannickmonney
yannickmonney merged commit b77a452 into main Oct 4, 2026
@yannickmonney
yannickmonney deleted the fix/preserve-main-build-cache branch October 4, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant