Repository navigation
Releases check that CI passed instead of rerunning the tests, ~5 min faster (#915) - #922
Merged
Merged
Conversation
The release workflows reran cargo test --workspace and the Vitest unit tests that CI had already passed on the same code. A new step, require_ci_passed.py, reads the branch ruleset's required checks and fails the release unless each one passed on the commit or on a commit with the same tree (a dev -> main merge commit has no CI of its own; its PR head does). It waits while a run is still going. Closes #915 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Re-checked 10-22 before the user's call: ran this PR's 🤖 Generated with Claude Code |
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.
Release note: none
Closes #915
The release workflows (
release_stable.yml,release_experimental.yml) no longer reruncargo test --workspaceand the Vitest unit tests that CI already passed on the same code. A new early step, Require passing CI on this commit, runs.github/scripts/require_ci_passed.py:GET /repos/{repo}/rules/branches/{branch}(devfor experimental,mainfor stable), so the list follows the rulesets with no copy to keep in sync. Matches on the exact check name and the app id (integration_id15368, GitHub Actions).commits/{sha}/pulls), each compared bygit/commits/{sha}tree sha.commits/{sha}/check-runs). Per commit only the latest run of a check counts (a re-run replaces a failure). A check passes onsuccess,neutralorskipped, as the rulesets count them.::error::naming the missing or failed ones, and waits (30 s polls, up to 45 min) while a run is still going.Workflow permissions gain
checks: read. The stable workflow gains the same "Record the commit being built" step the experimental one has.--lockedstays on the hook DLL build; its comment moved with it.docs/versioning_and_releases.mdhas a new section on the check.Decisions
dev->mainmerge commit (v0.2.0 =4fa6e97), which has no check runs: CI runs on PRs and on pushes to dev, never on main. Its second parent, dev's tipe9298df, has the identical tree and every required check, includingPR into main comes from devfrom the release PR. The rule "any commit with the identical tree" is sound because both rulesets require an up-to-date branch: the PR head already contains the base, so the merge commit's tree equals the head's, and CI'spull_requestrun (which tests the PR merged into its base) tested exactly that tree. Experimental builds dev's head, which normally has its own push CI; right after a merge, while that push CI is still running, the merged PR's head (same tree) already carries the passes, so the release doesn't wait. A tree no CI run tested (an admin push past the rulesets) fails the release; there is no bypass input, deliberately.mainaddsPR into main comes from dev.Frontend e2e testsjob runsnpm run test:unitfirst, so they were duplicated as well.npm cistays: the Tauri build needs it.Validation (local runs against real release commits)
Unit tests:
python -m unittest discover -s .github/scripts -p "test_*.py"→ 33 tests OK (13 new intest_require_ci_passed.py; CI's "Release notes collector tests" step discovers them). The check took 3.5 s locally.v0.2.0 stable (
4fa6e97, main merge commit, no CI of its own):Last experimental build (
experimental-latest=e9298df, dev merge of #916):A PR head whose Rust tests failed (
15ec6cd, fix/live-bob-889):A commit no CI ever ran on (
7d2da6e, an upstream dod-tools commit): all sixMISSING ... no run on any same-tree commit, exit 1.Job times
Before, from the last seven release runs (seconds; the after column is the same run minus the two removed steps plus ~5 s for the check, since a release can't be run from a PR):
So 2.5-10 min off each release, ~5 min on average over these seven. The rust-cache the release job saves also shrinks, since it no longer holds the test-profile build (~6m49s of compile in the v0.2.0 run).
LTO (measured note only, no change)
[profile.release]islto = true,codegen-units = 1. In the "Build, sign, and publish" step of warm-cache runs, only ~6 crates compile, and thereleasecargo build takes 3m34s / 5m47s / 6m01s (runs 39733994333, 39738971135, 39742006488). Almost all of that is afterCompiling nativestarts:nativecodegen on one codegen unit plus the fat-LTO link ofdesktop-studio(e.g. 06:32:23 → 06:35:53). Vite (~0.2 s) and bundling + signing the MSI/NSIS (~20-50 s) are the rest.lto = "thin"with the default 16 codegen units would spread that over the runner's 4 cores; my estimate, not measured, is 1.5-3 min saved per release, at the cost of a somewhat larger and possibly slightly slower binary. Measuring it properly means two cold release builds plus installer size and a parse / Overviews timing each way; that changes what ships, so it stays the user's call (#915 option 2).🤖 Generated with Claude Code