Skip to content

fix: prevent stale rolling tags when refreshing older patch releases#3

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-docker-image-publishing-workflow
Draft

fix: prevent stale rolling tags when refreshing older patch releases#3
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-docker-image-publishing-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 26, 2026

Refreshing images for an older release (e.g. v3.18.0) would overwrite rolling tags 3 and 3.18 even if v3.19.0 had already been published, causing those tags to regress to an older fcli version.

Changes

New step: Check whether rolling semantic tags should be published (in generate-metadata)

  • Uses skopeo list-tags to fetch all published tags for the target image
  • Compares existing X.Y.* and X.*.* tags against the version being built using sort -V
  • Sets publish_minor_tag / publish_major_tag to true only when the current version is ≥ the highest published patch in that series
  • Defaults both to true (with a ::warning:: annotation) when the registry is unreachable or the image has no tags yet
  • Short-circuits to false/false for non-semantic versions (dev_*)

Two new job outputs on generate-metadata

publish_major_tag, publish_minor_tag — consumed by the tags step below.

docker-linux tags generation step

X.Y and X rolling tags are now emitted conditionally:

if [[ "${{ needs.generate-metadata.outputs.publish_minor_tag }}" == "true" ]]; then
  TAGS="${TAGS},${{ env.IMAGE_NAME }}:${MAJOR}.${MINOR}${SUFFIX}"
fi
if [[ "${{ needs.generate-metadata.outputs.publish_major_tag }}" == "true" ]]; then
  TAGS="${TAGS},${{ env.IMAGE_NAME }}:${MAJOR}${SUFFIX}"
fi

Immutable X.Y.Z and X.Y.Z-timestamp tags are always emitted, unchanged.

Copilot AI added 2 commits May 26, 2026 22:43
Add a 'Check whether rolling semantic tags should be published' step to
the generate-metadata job. It queries Docker Hub (using skopeo, already
available on ubuntu-latest) for all existing X.Y.Z-style tags and only
sets publish_minor_tag / publish_major_tag to true when the version
being built is the highest published patch for its major.minor / major
series respectively.

The tags generation step in docker-linux now conditionally emits the
X.Y and X rolling tags based on those two outputs, preventing a refresh
of e.g. v3.18.0 from overwriting the '3' or '3.18' tags after v3.19.0
has already been published.
- Use ::warning:: annotation when registry fetch fails so the
  fallback is visible in the workflow log
- Rename HIGHER to HIGHER_MINOR / HIGHER_MAJOR to avoid ambiguity
Copilot AI changed the title fix: skip rolling semantic tags when refreshing an older patch release fix: prevent stale rolling tags when refreshing older patch releases May 26, 2026
Copilot AI requested a review from rsenden May 26, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants