Derive OCI publish mode from trigger to stop twin-publish race #44
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GOV-15-twin-trigger-publish-mode"
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
Ports the GOV-13 twin-trigger publish-mode fix into this repo's OCI build workflow. Part of the GOV-15 per-repo rollout.
The bug
build-oci-image.ymltriggers on push to BOTHbranches: [main]andtags: [v*], and resolved its tag set fromgit describeviaoci-build/get-tags.nu --joined, which returned[vX.Y.Z, latest]on a tagged commit. A release commit is simultaneously a main push and av*tag push, so both events fire, both build the same image, and both race to overwrite the mutable:latesttag while colliding on immutable artifacts.The fix
The publish mode is now derived from the workflow trigger instead of
git describe. A tag ref resolves to thereleasetrain and publishes only the immutablevX.Y.Z; a push tomainresolves to thelatesttrain and publishes only the rollinglatest; aworkflow_dispatchresolves todry-run, building locally (--load) and mutating nothing. The two real triggers now emit disjoint tag sets, so the runs never race for the same destination.oci-build/get-tags.nuis replaced with the canonical--modeversion (release / latest / dry-run, with--simulate-tagto exercise the release path from a manual run). The workflow gains aworkflow_dispatchtrigger withdry_run(default true) andsimulate_taginputs, a resolve step that maps the trigger to a single tag, a dry-run-aware build-and-push step, and a single-tag print step.Preserved
The matrix (
imagerus / rus-saas,build_modestandalone / saas), build-args, inline cache strategy, registry auth wiring, andoci-build/Dockerfilepath are unchanged. The resolve step runs once per matrix job and produces the same trigger-derived tag, which is correct. A dry-run exports no cache.Verification
YAML parses,
nu-checkpasses on the helper, all four functional modes return the expected tag (release v9.9.9, latest, dry-run+simulate release v9.9.9, dry-run latest), and both error paths (unknown mode, release with no version) exit non-zero. The pre-commit hook passed (fmt, clippy, 111 tests).