Skip to content

Release: skip the CI gate when the same tree already passed CI (port of drivine#431) - #271

Merged
jasperblues merged 1 commit into
mainfrom
release-gate-trust
Oct 29, 2026
Merged

jasperblues merged 1 commit into
mainfrom
release-gate-trust

Conversation

@jasperblues

Copy link
Copy Markdown
Member

Closes #254. Port of liberation-data/drivine#431 (PR #432).

A trust job 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 in tests/unit/test_ci_trust.py port every case of the original's.

Checks:

  • pytest: 93 passed.
  • ruff and pyright: clean.
  • Two review passes, both clean.

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.

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
jasperblues merged commit 7e2998e into main Oct 29, 2026
13 checks passed
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
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.

Release: skip the CI gate when the same tree already passed CI (port of drivine#431)

1 participant