Encode release stream in image target UID#554
Merged
Conversation
01ef17a to
af42bcc
Compare
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
af42bcc to
b90dd5b
Compare
ianpittwood
reviewed
May 28, 2026
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." | ||
| ) |
Comment on lines
+299
to
+300
| if self.release_stream != ReleaseStreamEnum.RELEASE: | ||
| u += f"-{self.release_stream.value}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ImageTarget.uidcombined 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 when2026.05.0shipped while the daily stream still resolved to2026.05.0, the dev build's artifacts matched the release target andbakery ci mergepushed them to the release registries (Docker Hub and GHCR) without the-previewsuffix.What
generate_image_targets.Covers AC1 to AC3 from the issue. AC4 (end-to-end matrix/build/merge test) is not yet included.
Related
bakery ci merge#553