Derive OCI publish mode from trigger to end twin-publish race #48
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 the
vervain-appsOCI build workflow as part of the GOV-15 per-repo rollout.Why
A release commit is simultaneously a push to
mainand thev*tag push, sobuild-oci-image.ymlfired on both events. The oldci-build/get-tags.nuresolved its tag set fromgit describe, returning the identical[vX.Y.Z, latest]pair on both runs, so the two builds raced to write the same destinations: a 409 on immutable generic-package files and an overwrite race on the mutable OCIlatesttag.How
The publish mode is now derived from the workflow trigger, never from
git describe. Av*tag push resolves to thereleasetrain and publishes only the immutablevX.Y.Ztag; amainpush resolves to thelatesttrain and publishes only the rollinglatesttag; aworkflow_dispatchresolves todry-run, building locally and mutating nothing. The two real runs now write disjoint tag sets and never collide.ci-build/get-tags.nuis replaced with the canonical--modeversion returning a{ mode, train, tag, describe }record. The workflow gains aworkflow_dispatchtrigger withdry_runandsimulate_taginputs, a resolve step that maps the trigger to a mode, a single-tag dry-run-aware build-and-push step, and a dry-run-aware print step. Image name (vervain-web), registry wiring, gha cache strategy, build-args, and Dockerfile path are unchanged. The companionbuild-desktop-linux.ymlis not touched.Verification
YAML parses,
nu-checkreturns true on the helper, all four functional modes resolve the expected tag (release ->v9.9.9, latest ->latest, dry-run+simulate ->v9.9.9, dry-run default ->latest), and both error paths (bogus mode, release with no version) exit non-zero.A release commit is simultaneously a push to main and the v* tag push, so the build-oci-image workflow fired on both events. The old get-tags.nu resolved its tag set from git describe, returning the identical [vX.Y.Z, latest] pair on both runs, so the two builds raced to write the same destinations: a 409 on immutable generic-package files and an overwrite race on the mutable OCI latest tag. Derive the publish mode from the trigger instead. A v* tag push resolves to the release train and publishes only the immutable vX.Y.Z tag; a main push resolves to the latest train and publishes only the rolling latest tag; a workflow_dispatch resolves to dry-run, building locally and mutating nothing. The two real runs now write disjoint tag sets and never collide. get-tags.nu is replaced with the canonical --mode version returning a { mode, train, tag, describe } record. The workflow gains a workflow_dispatch trigger with dry_run and simulate_tag inputs, a resolve step that maps the trigger to a mode, a single-tag dry-run-aware build-and-push step, and a dry-run-aware print step. Image name, registry wiring, gha cache strategy, build-args, and Dockerfile path are unchanged. #GOV-15 #GOV-13