Derive OCI publish mode from trigger, not git describe #75
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?
Ports the GOV-13 twin-trigger publish-mode fix into this repo's OCI build workflow as part of the GOV-15 rollout.
The
build-oci-image.ymlworkflow triggered 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 at once a main push and av*tag push, so both events fired, both built the same image, and both raced to overwrite the mutable:latesttag (a 409 on immutable artifacts, an overwrite race on the OCIlatesttag).This change derives the publish MODE from the trigger instead of from
git describe: av*tag push resolves thereleasetrain and publishes only the immutablevX.Y.Ztag, a main push resolves thelatesttrain and publishes only the rollinglatesttag, and a manualworkflow_dispatchresolves a dry-run that builds and prints but mutates nothing. The two real triggers now write disjoint tag sets, so the two runs never race to the same destination.Scope is a minimal port: the helper
oci-build/get-tags.nuis replaced with the canonical--modeinterface, aworkflow_dispatchtrigger with dry-run/simulate-tag inputs is added, and the build, push and print steps now use the single resolved tag with the push and--cache-togated on dry-run. The image name (vervain-server), registry/secret wiring, type=gha cache strategy, Dockerfile path, and push paths are all left untouched.Verification: YAML parses,
nu-checkon the helper returns true, all four functional modes resolve the correct tag/train (release -> v9.9.9, latest -> latest, dry-run simulate -> release/v9.9.9, dry-run plain -> latest/latest), and both error paths (bogus mode, release without a version) exit non-zero. The repojust pre-commitsuite (compile, clippy, fmt, 437 tests) passed before commit.