fix(release): Wait only for CI's own checks, not the release job's #41
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/release-ci-wait"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was wrong
scripts/release.pyskips the tests and lint when CI already passed them on the release commit (#28), waiting up to 15 minutes (CI_WAIT_SECONDS) while CI is still running. It read the commit's combined status. That includes the release job's own check, which stays "pending" for as long as the release runs. So every release waited the full 15 minutes and then ran the tests and lint itself.v0.4.0 showed it: CI passed on
fcc766dat 02:51:56 UTC, the release started at 02:52:01, and it then waited until about 03:07 before building. The script's output didn't appear in the CI log until exit, because Python buffers stdout when it's piped, so the wait wasn't visible.What changed
ci_stateinrelease.pyreads only the CI workflow's checks: statuses whose context starts withCI /(the workflow is named "CI"). Any failure or error is "failure", all success is "success", otherwise "pending". Other checks, such as the release job's, are ignored. With no CI check at all it returns None, as before.mainline-buffers stdout, so the "release: …" progress lines show in the CI log as they happen.Verified
fcc766dwhile v0.4.0's release was still running: the old code saw "pending", the new code sees "success".ci_state: CI success plus a pending release check gives "success"; CI pending gives "pending"; CI failure or error gives "failure"; only a release check, or no statuses, gives None.release.py. I didn't run a release with this change; the next release is the real test.