[Bug] latest points at main, not at a release #561
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
technical improvement
UX Improvement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
local-it/mitgliederverwaltung#561
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Description
Two related problems, both about knowing which version an instance runs.
latestpoints at main, not at a release. Every push tomainpublisheslatestplus the commit sha, while the tag pipeline usesauto_tag, which produces1,1.3and1.3.0but neverlatest. Solatestonly ever means "current main", and no released version ever carries it. That inverts what operators expect:latestis the implicit default (docker pull <image>resolves to:latest), so the least experienced operators receive our least stable build. Together with an auto-updater such as Watchtower it becomes unattended deployment of unreleased code, which is how #559 reached a production instance. There is currently no tag at all that means "newest stable release", so someone who simply wants to stay current has no correct choice unless they happen to know they should pin1.3.Our own CD needs a stable pointer to the tip of main. Today it would have to use
latest, which is exactly the tag that should stop meaning that. We need a tag that is explicitly the moving tip ofmain, so continuous deployment can follow it without competing with the meaning oflatest.Nothing reports the running version.
mix.exsstill declares0.1.0while the changelog is at1.3.0, the image carries no version metadata, and the UI shows nothing. When an operator reports a problem we have to ask what they run, and they have no place to look it up.Proposed tagging scheme
mainmain, published on every push<sha>1.3.01.3,1latestmainis the conventional name for a moving pointer at a branch tip: it is self-documenting, matches the branch it is built from, and generalises if we ever add release branches.edgeis the other established convention (Alpine, some Docker images) and would be an acceptable alternative, but it says less about where the build comes from.nightlywould be wrong, since it implies a schedule rather than every push, anddevis ambiguous between "development build" and "development environment".Worth stating in the deployment docs, because it is the part that is easy to get wrong: a moving tag makes the deployed digest ambiguous, so push-based CD should deploy the immutable sha it just built rather than
main.mainexists for pull-based updaters and for manual testing, not as the preferred deployment target.Note on changing the meaning of
latestThis flips an existing tag. Anyone tracking
latesttoday runs main and will move to a release afterwards, which can be an older commit than what they currently run. It needs an entry in the changelog and a line in the release notes; it must not be rolled out silently.Version reporting
Make the version in
mix.exsthe real one, or derive it at build time from the git tag, so thatApplication.spec(:mv, :vsn)is meaningful. Pass the commit sha into the image and set the usual OCI labels (org.opencontainers.image.version,org.opencontainers.image.revision). Then surface it read-only in/settings(GlobalSettingsLive) as its own section below the existing ones, showing the version and, when available, the short commit sha.Which side owns the version is an open question worth deciding before implementation:
mix.exsas the source of truth with the git tag required to match, or the git tag as the source with the version injected at build time. The second prevents the two from drifting, which is what already happened here.Acceptance criteria
latestin the registry points at the newest released versionmainis published on every push tomainand always points at the tip of that branch1.3.0,1.3and1tagsApplication.spec(:mv, :vsn)returns the real version, and the image carriesorg.opencontainers.image.versionandorg.opencontainers.image.revisionlatestis announced inCHANGELOG.mdExternal or internal Dependencies
auto_tagtogether with an explicittagsentry; if it does not, the tag pipeline needs a second publish step instead.we could also evaluate publishing packages for pull requests so we could easily test them on our staging instance. security-aware of course.
and a release script should also consider updating the version in the publiccode.yml