Skip to content

feat(lcm): default retag tag to latest, resolving version from the image - #2090

Merged
santos1709 merged 1 commit into
masterfrom
lcm-retag-latest-default
Jul 29, 2026
Merged

feat(lcm): default retag tag to latest, resolving version from the image#2090
santos1709 merged 1 commit into
masterfrom
lcm-retag-latest-default

Conversation

@santos1709

@santos1709 santos1709 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The retag workflow derived the major version by string-splitting the tag input, so a latest input would have produced Mlatest-<cluster>. This PR resolves the concrete version from the image itself instead: the build stamps LABEL bricks_version from the BRICKS_VERSION build-arg, so crane config | jq .config.Labels.bricks_version is authoritative and independent of mutable tag names.

With that in place, default the tag input to latest.

Summary by CodeRabbit

  • Bug Fixes
    • Improved stable image retagging for explicit versions and the latest tag.
    • Added validation to ensure latest matches the resolved version before retagging.
    • Updated workflow summaries to report the actual resolved version.

@santos1709
santos1709 marked this pull request as draft July 29, 2026 11:29
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The stable retag workflow now accepts explicit versions or latest, resolves versions from image labels, verifies matching digests for latest, retags major cluster aliases, and reports the resolved versions in the workflow summary.

Changes

Stable retag workflow

Layer / File(s) Summary
Input and version resolution
.github/workflows/lcm-stable-retag.yaml
The workflow accepts explicit version tags or latest; image bricks_version labels are validated as semantic versions.
Retagging and summary output
.github/workflows/lcm-stable-retag.yaml
latest digest consistency is checked, M<major>-<cluster> tags are updated, and the summary reports resolved versions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant ContainerRegistry
  participant ImageManifest
  GitHubActions->>ContainerRegistry: Resolve requested image
  ContainerRegistry->>ImageManifest: Read bricks_version label
  ImageManifest-->>GitHubActions: Return resolved X.Y.Z version
  GitHubActions->>ContainerRegistry: Compare latest and resolved digests when requested
  GitHubActions->>ContainerRegistry: Retag M<major>-<cluster> aliases
  GitHubActions-->>GitHubActions: Write resolved workflow summary
Loading

Possibly related PRs

Poem

A bunny found a tag named “latest,”
Then checked its digest—nice and stately.
The version label led the way,
Major cluster tags now hop and stay.
The summary blooms with facts so bright,
Retagging safely through the night. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main workflow change: defaulting the retag target to latest and resolving the version from the image.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@santos1709
santos1709 force-pushed the lcm-retag-latest-default branch from a95fa03 to a74221c Compare July 29, 2026 14:10
The retag workflow derived the major version by string-splitting the tag
input, so a 'latest' input would have produced Mlatest-<cluster>. Resolve
the concrete version from the image itself instead: the build stamps
LABEL bricks_version from the BRICKS_VERSION build-arg, so
`crane config | jq .config.Labels.bricks_version` is authoritative and
independent of mutable tag names.

With that in place, default the tag input to 'latest' — the common case
after a promotion — and retag from the resolved version tag rather than
from latest, so the run is traceable and cannot tear if latest moves
mid-run. When resolving, assert latest and the version tag share a digest;
an explicit tag input (rollback) is exempt, since it is expected to differ.

Major is now computed per image inside the loop, and the summary reports
the requested tag, the resolved version(s), and the clusters actually
retagged instead of recomputing a major that no longer exists.
@santos1709
santos1709 force-pushed the lcm-retag-latest-default branch from a74221c to ba68bde Compare July 29, 2026 14:25
@santos1709
santos1709 marked this pull request as ready for review July 29, 2026 14:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/lcm-stable-retag.yaml:
- Around line 111-122: Update the version-resolution flow around the TAG/latest
branch so every TAG value, including explicit rollback inputs, is passed through
resolve_version using the bricks_version input; only the latest path should
retain the stable-tag digest comparison. Derive major and src from the resolved
concrete version, and ensure summaries use that same resolved value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c6e9815-0af1-481f-a885-923a35be7b63

📥 Commits

Reviewing files that changed from the base of the PR and between 97a77ca and ba68bde.

📒 Files selected for processing (1)
  • .github/workflows/lcm-stable-retag.yaml

Comment thread .github/workflows/lcm-stable-retag.yaml
@santos1709
santos1709 added this pull request to the merge queue Jul 29, 2026
Merged via the queue into master with commit 6be6573 Jul 29, 2026
28 of 29 checks passed
@santos1709
santos1709 deleted the lcm-retag-latest-default branch July 29, 2026 15:11
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