Emit latest flag from bakery ci matrix - #770
Open
bschwedler wants to merge 1 commit into
Open
Conversation
Test Results2 271 tests 2 271 ✅ 8m 19s ⏱️ Results for commit 1ee8321. ♻️ This comment has been updated with latest results. |
Add a `latest` boolean to each `bakery ci matrix` entry, alongside the existing `dev` field, so CI workflows can gate per-version steps on whether a version is the latest release of its image. Without it, a workflow whose matrix has already pinned one version has no way to express "only act on the latest one" except by passing --latest to the pinned command. Those two filters intersect to nothing on every non-latest version, which bakery reports as an error rather than as the intentional no-op the caller meant. The value comes from ImageVersion.is_latest_release, which is also what the --latest filter calls via matches_latest_filter. A workflow gating on the field and a command using the filter always select the same versions; there is no second copy of the rule that could drift. is_latest_release is a plain property rather than a computed_field: ImageVersion is round-tripped into bakery.yaml via model_dump, and a computed field would write a derived key into the user's config.
bschwedler
force-pushed
the
feat/ci-matrix-latest-field
branch
from
August 28, 2026 19:26
4bef9bd to
1ee8321
Compare
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.
Add a
latestboolean to eachbakery ci matrixentry alongside the existingdevfield. CI workflows that need to act only on the latest version of each image can gate onmatrix.img.latestrather than passing--latestto a command already pinned to one version by the matrix — those two filters intersect to nothing on every non-latest version.The value comes from
ImageVersion.is_latest_release, a new plain property thatgenerate_image_targetsalso calls viamatches_latest_filter. The field and the filter share one predicate; they cannot drift.Closes #769