Repository navigation
Publishing a release runs again only what no passing CI run checked - #2913
Merged
Merged
Conversation
The release gate now looks for a commit whose CI passed and whose tree differs from the release commit's only in the release files and tests: the release commit itself, its first parents, or main's. The same tree runs nothing again; release files alone run their checks; changed tests run on their own, in each engine CI runs them in; anything else, or anything unreadable, runs the full suite. A revert back to a tree that passed is that tree, and a final reuses its candidate's publish checks. v1.2.10's last release PR changed one test on top of a revert, and each of its publishes ran the whole suite while a flaky WebKit crash failed it.
davidmckayv
marked this pull request as ready for review
December 4, 2026 03:22
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 4, 2026 03:22
This was referenced Dec 5, 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.
What this changes
Publishing a release no longer runs the same tests again on code that already passed them.
The
checks neededjob (scripts/release-ci-gate.ts) used to have one small path: when the release PR changed nothing but the release files on a commit whose CI passed, it skipped the suite. Any other diff ran everything. v1.2.10's release PRs carried a revert (#2903) and a one-test change (#2905), so each publish ran the whole suite again, and the same flaky WebKit renderer crash failed it four times.Now the gate looks for a commit whose CI passed and whose tree differs from the release commit's only in what a run would check differently, and runs only that difference:
CHANGELOG.md,release-policy.json,backend-images.env, Cargo): the release-file checks, as before.bun test, Chromium, WebKit for a file onci.yml's WebKit list or one that asks for it, and the desktop setup window), in a newrelease testsjob. The release-file checks and a type check run in the gate.app/src,shared/,desktop/src-tauri, server-facing code, workflows), fixtures, Python or TypeScript-engine tests, docs, a deleted test, a version file that changed beyond its version, and anything it cannot read.The commits it compares with are the release commit itself, its first parents (main or the release branch), and main's first parents, 50 of each. It compares trees, not history, so a revert back to a green tree counts as that tree. A run counts only if it finished with every job succeeded or skipped: main's push run or main's merge queue at exactly that commit, or a Publish release run whose own
checksran and passed. That last kind lets a final reuse its candidate's checks. Pull request runs and the deciding run never count. It fails closed: an unreadable diff, an unreadable API, or an engine list it cannot find means the full suite.imagespublishes only aftercheckspassed, or after the gate passed and, when it said tests run,release testspassed.byEngineinscripts/ci-changes.tsis the existing engine sort, pulled out so the gate uses the same rules. Its two call sites are unchanged in behaviour (ci-changes.test.tspasses).docs/releasing.md("What has to be green" and "What merging does") describes the new rules.How others do it
The design follows the common pattern: key a pass on the code's content, not the commit, reuse only passes, and rerun a test only when it or what it depends on changed.
--cache_test_results=auto) reruns a test only if "Bazel detects changes in the test or its dependencies", or "the test failed". Otherwise it replays the cached pass (user manual). Here, a changed test file reruns and unchanged tests on unchanged code do not.git rev-parse $commit^{tree}, and skipped a job when "the same tree has already been built and tested successfully before" (ci/lib.sh, v2.35.4). It was removed in 2022, partly because a tree could be marked good even when a later step such asmake coccicheckfailed (patch). That is why a run counts here only when every job succeeded or was skipped. A tree-keyed, pass-only cache for Actions also exists as an action (pleo-io/s3-cache-action).GitHub Actions has no built-in way to reuse a pass across commits with the same tree, since required checks attach to a commit SHA. So the gate reads past runs from the Actions API, as Git's file and the S3 action read their stores. The one place it is coarser than Bazel or Nx is that it has no per-test dependency graph. Any change outside the release files and tests runs the whole suite, rather than guessing which tests the change reaches.
Where it runs
publish-release.yml,release tests, which runs only on a release.Boundary and audit
API and database
api/, no app's requests, no database change and norelease-policy.json.Changelog
none
Proof
Red before, green after.
scripts/release-ci-gate-script.test.tsruns the script itself, the waychecks neededruns it, on a real git history in a temp repo, with aghon PATH that answersgh apifrom runs and jobs in the Actions API's shapes. Its regression test replays v1.2.10: the last green commit, Cedar, the first release PR, the revert, and the last release PR changingapp/tests/sidebar-current-row.test.tsx, with main's push run of the release commit still in progress.git restore --source=origin/main scripts/release-ci-gate.ts scripts/ci-changes.ts), it fails withExpected: "false" Received: "true"onfull_checks. The old gate ran the full suite.mode=tests,baseline= the last green commit,tests=["app/tests/no-fixed-settle-waits.test.ts"],browser_testsandwebkit_tests=["app/tests/sidebar-current-row.test.tsx"].The five cases, against real git histories in temp repos (
scripts/release-ci-gate.test.ts):They also cover runs marked success with a job that did not pass, PR, fork and other-workflow runs, the deciding run itself, waiting and the 10-minute cap, an unreadable API, picking the tree that leaves least to run, a final reusing its candidate's publish checks, and a release branch carrying main's tree.
Live, read-only, against this repository's real history and Actions API:
1884dbd71(v1.2.10's last release commit):mode=reuse. main's push run of that exact commit has since passed (run 47223608122), so a re-run of that publish runs nothing again. While that run was still in progress, the tree comparison picks7bb2df5eb(green on push and in the queue), and only the changed test and the one that names it run.158ed37d0(the first v1.2.10 release commit):mode=reuseon main's passing run of that commit (47216728184).Checks run locally:
bun run format:check,bun run lint,bun run typecheck, a stricttscover the gate's files,actionlint(only the existing$/notices) andzizmor(no findings) onpublish-release.yml, plus every test that reads the changed workflows or scripts (release-ci-gate,release-ci-gate-script,release-publish-order,ci-changes,ci-runners,ci-budgets,workflow-concurrency,stop-on-failure,signing-workflows,release-latest,release-rerun,release-chartsand others): all green.No screen changes. This is the release workflow and its script, so there is nothing to show in Chrome or Safari.