Skip to content

Encode release stream in image target UID#554

Merged
bschwedler merged 1 commit into
mainfrom
uid-encode-release-stream
May 28, 2026
Merged

Encode release stream in image target UID#554
bschwedler merged 1 commit into
mainfrom
uid-encode-release-stream

Conversation

@bschwedler
Copy link
Copy Markdown
Contributor

Why

ImageTarget.uid combined only image, version, variant, and OS, so a dev-stream build (daily/preview) and a release build of the same version got identical UIDs. Build metadata is matched to targets by UID, so when 2026.05.0 shipped while the daily stream still resolved to 2026.05.0, the dev build's artifacts matched the release target and bakery ci merge pushed them to the release registries (Docker Hub and GHCR) without the -preview suffix.

What

  • Append the stream to the UID for dev streams only. Release UIDs are unchanged, so temp-image/cache names and published tags are unaffected.
  • Fail fast on any duplicate UID in generate_image_targets.
  • Regression tests for both.

Covers AC1 to AC3 from the issue. AC4 (end-to-end matrix/build/merge test) is not yet included.

Related

@bschwedler bschwedler requested a review from ianpittwood as a code owner May 28, 2026 19:20
@bschwedler bschwedler force-pushed the uid-encode-release-stream branch from 01ef17a to af42bcc Compare May 28, 2026 19:25
@github-actions
Copy link
Copy Markdown

Test Results

1 570 tests  +2   1 570 ✅ +2   8m 6s ⏱️ +16s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit af42bcc. ± Comparison against base commit f3b6b78.

Build metadata is keyed by an image target's UID and matched back
onto targets in `bakery ci merge`. The UID combined only the image
name, version, variant, and OS, so a development-stream build
(daily or preview) and a release build of the same version produced
an identical UID. A dev-only build's artifacts then matched the
release target and were pushed to the release registries
(Docker Hub + GHCR) without the -preview suffix.

Append the release stream to the UID for development streams so dev
and release builds of the same version no longer collide. Release
UIDs are left unsuffixed to keep existing temp-image and cache names
stable. Add a guard that fails target generation on any duplicate
UID rather than silently merging.

Refs: #553
@bschwedler bschwedler force-pushed the uid-encode-release-stream branch from af42bcc to b90dd5b Compare May 28, 2026 19:53
@bschwedler bschwedler merged commit 7caf423 into main May 28, 2026
20 checks passed
@bschwedler bschwedler deleted the uid-encode-release-stream branch May 28, 2026 20:02
Copy link
Copy Markdown
Contributor

@ianpittwood ianpittwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +909 to +913
f"Duplicate image target UID '{target.uid}': two targets resolve to the same "
f"image, version, variant, OS, and release stream ({target.release_stream.value}). "
"Check for a duplicate version definition or multiple development streams "
"resolving to the same version."
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smort

Comment on lines +299 to +300
if self.release_stream != ReleaseStreamEnum.RELEASE:
u += f"-{self.release_stream.value}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smort

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