fix(ci): derive binary publish channels from trigger to kill 409 race #19
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GOV-14-trigger-derived-publish-channels"
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?
Background
Each of the three binary build workflows (
build-binary.ymlLinux glibc,build-binary-static.ymlstatic musl,build-binary-windows.yml) triggers onpushto bothbranches: [main]andtags: [v*]. A release commit is simultaneously a push to main and thev*tag push, so both events fire for the same SHA. Each run resolved its publish tag set fromgit describeviaoci-build/get-tags.nu --joined, which yields the overlappinglatestand<sha>channels for both events. The two runs then race to DELETE-then-PUT the same immutable generic-package files at those channels, producing intermittent409 package file already existsand red release CI. Tracked as GOV-14; the same failure mode was seen in CLAUDE-122 / GOV-13.Fix
Resolve the publish channels from the workflow trigger (
github.ref_type/github.ref_name) instead ofgit describe, so the two events publish disjoint channels:github.ref_type == 'tag') publishes only the<version>channel.latestplus the per-commit<sha>channel.Neither event writes a channel the other writes, so there is no concurrent writer on any immutable generic-package file and the 409 cannot occur.
lateststill tracks the release because the release tag sits on the same SHA already pushed to main. This mirrors the trigger-derived approach proven in CI on the monkey repo (PR #51).Deviation from monkey #51
monkey's
git describeset was[<version>, latest]with no per-commit<sha>channel, so its main-push branch resolved tolatestonly. This repo'sget-tags.nuadditionally emits a<sha>channel, so the main-push branch here keepslatestplus<sha>(notlatestonly) to preserve<sha>availability for normal non-release main pushes. The change stays minimal and surgical: the three "Get artifact tags" steps now resolve tags inline from the trigger and no longer calloci-build/get-tags.nu; that script is left in place untouched (no Rust/Python touched, YAML-only).Files changed
.forgejo/workflows/build-binary.yml.forgejo/workflows/build-binary-static.yml.forgejo/workflows/build-binary-windows.ymlRefs GOV-14, GOV-13, CLAUDE-122.