Repository navigation
Release: skip the CI gate when the same tree already passed CI (port of drivine#431) - #271
Merged
Merged
Conversation
Port of liberation-data/drivine#431 (#432). release.yml's new trust job runs scripts/ci_trust.py, which asks the GitHub API, reading only, for a push or pull_request run of ci.yml on the tree being released whose every job passed, waiting for one still going. The gate then runs only when none did; a run on the tree that it waited for and that failed fails the release. ci.yml's first job records the tree it tested, so a pull request's run of its merge ref can be matched. build, publish and github-release check their upstream results explicitly, so a skipped gate doesn't skip them. Closes #254.
jasperblues
added a commit
to liberation-data/drivine4j
that referenced
this pull request
Oct 29, 2026
…of drivine#431) (#431) * Skip the release gate when CI has already passed on the same tree A port of drivine-python's release-gate trust (liberation-data/drivine-python#271). release.yml's new trust job runs scripts/ci_trust.py, identical to drivine-python's, which looks for a push or pull_request run of ci.yml that passed on the git tree being released, waiting for one still going, and the gate is skipped when it finds one. ci.yml's new first job records the tree each run tests. build, publish and github-release check their upstream results, with !cancelled(), so a skipped gate doesn't skip them. The script's tests, scripts/test_ci_trust.py, are drivine-python's on unittest, run with the runner's python3 by CI's release-version job and by trust before it uses the script. No job in ci.yml has a condition. Closes #405. * Say that build relies on the gate, or the CI run trust found, for the tests
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 #254. Port of liberation-data/drivine#431 (PR #432).
A
trustjob runs before the release gate. If a ci.yml run from push or pull_request has already passed on the same git tree, the gate is skipped. If such a run is still going, the job waits for it. Otherwise the full gate runs, as before. ci.yml gets a first job,tree, that records the tree its run tested. A pull_request run counts only when its head commit's tree also matches the release tree. build, publish and github-release check their upstream jobs' results explicitly, so a skipped gate never skips a publish.How this differs from the original: it's
scripts/ci_trust.py, standard library only, run on the runner's own python3. The action pins follow this ci.yml (@v4). Its unit tests intests/unit/test_ci_trust.pyport every case of the original's.Checks:
Read-only run against this repo: the v0.3.1 release commit (4cf6083) and four main commits before it would each trust their push run. The schedule run was ignored, as it should be.