Skip to content

Emit latest flag from bakery ci matrix - #770

Open
bschwedler wants to merge 1 commit into
mainfrom
feat/ci-matrix-latest-field
Open

Emit latest flag from bakery ci matrix#770
bschwedler wants to merge 1 commit into
mainfrom
feat/ci-matrix-latest-field

Conversation

@bschwedler

Copy link
Copy Markdown
Contributor

Add a latest boolean to each bakery ci matrix entry alongside the existing dev field. CI workflows that need to act only on the latest version of each image can gate on matrix.img.latest rather than passing --latest to 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 that generate_image_targets also calls via matches_latest_filter. The field and the filter share one predicate; they cannot drift.

Closes #769

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Test Results

2 271 tests   2 271 ✅  8m 19s ⏱️
    1 suites      0 💤
    1 files        0 ❌

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
bschwedler force-pushed the feat/ci-matrix-latest-field branch from 4bef9bd to 1ee8321 Compare August 28, 2026 19:26
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.

Emit latest from bakery ci matrix so CI can gate per-version scan steps

1 participant