Skip to content

Fix: Prevent Docker 'latest' tag regression on older maintenance releases#2598

Merged
meteorcloudy merged 1 commit into
bazelbuild:masterfrom
deepalak56:patch-8
May 4, 2026
Merged

Fix: Prevent Docker 'latest' tag regression on older maintenance releases#2598
meteorcloudy merged 1 commit into
bazelbuild:masterfrom
deepalak56:patch-8

Conversation

@deepalak56
Copy link
Copy Markdown
Contributor

@deepalak56 deepalak56 commented May 2, 2026

Problem:

The Docker tagging logic was blindly following GitHub's "latest" redirect. When an older maintenance patch (e.g., 8.7.0) was released after a newer major version (e.g., 9.1.0), the Docker latest tag would incorrectly regress to the older version.

Solution:

Introduced a semantic version check using sort -V. The script now compares the current build version against the GitHub "latest" version and only updates the Docker latest tag if the current build is semantically greater than or equal to the version on GitHub.

Impact:

  • bazel:latest is guaranteed to point to the highest version number.
  • Maintenance releases for older branches will no longer "hijack" the latest tag.
  • Eliminates manual tag corrections after legacy branch updates.

PR #2598 (Continuous-integration): Fixes the Docker Registry (bazel:latest tag).
PR bazelbuild/bazel#29452 (Bazel): Fixes the GitHub Releases Page (the green "Latest" badge).

@meteorcloudy meteorcloudy enabled auto-merge (squash) May 4, 2026 13:43
@meteorcloudy meteorcloudy merged commit 9681263 into bazelbuild:master May 4, 2026
2 checks passed
copybara-service Bot pushed a commit to bazelbuild/bazel that referenced this pull request May 12, 2026
…#29452)

Problem:

  GitHub automatically marks the most recently created release as "Latest." When a maintenance patch (e.g., 8.7.0) is released after a newer major version (e.g., 9.1.0), the "Latest" badge incorrectly regresses to the older version.

  Solution:

  Updated scripts/ci/build.sh to perform a semantic version check using sort -V. If the new release is semantically older than an existing one, the script now explicitly calls the GitHub API to set make_latest: false, ensuring the badge stays on the true highest version.

  Impact:

   - Guarantees the "Latest" badge always points to the highest semantic version.
   - Prevents legacy branch updates from hijacking the project's "Latest" status.
   - Syncs GitHub UI state with the fix introduced in bazelbuild/continuous-integration#2598.

   PR #[2598](bazelbuild/continuous-integration#2598) (Continuous-integration): Fixes the Docker Registry (bazel:latest tag).
   PR #29452 (Bazel): Fixes the GitHub Releases Page (the green "Latest" badge).
   PR #[2692](bazelbuild/continuous-integration#2602) (Continuous-integration): Buildkite pipeline for Github CLI migration.

Closes #29452.

PiperOrigin-RevId: 914121481
Change-Id: Ic725b3e49105b3d25c54545740e289a6f13f1aa0
secondsun pushed a commit to secondsun/bazel that referenced this pull request May 13, 2026
…bazelbuild#29452)

Problem:

  GitHub automatically marks the most recently created release as "Latest." When a maintenance patch (e.g., 8.7.0) is released after a newer major version (e.g., 9.1.0), the "Latest" badge incorrectly regresses to the older version.

  Solution:

  Updated scripts/ci/build.sh to perform a semantic version check using sort -V. If the new release is semantically older than an existing one, the script now explicitly calls the GitHub API to set make_latest: false, ensuring the badge stays on the true highest version.

  Impact:

   - Guarantees the "Latest" badge always points to the highest semantic version.
   - Prevents legacy branch updates from hijacking the project's "Latest" status.
   - Syncs GitHub UI state with the fix introduced in bazelbuild/continuous-integration#2598.

   PR #[2598](bazelbuild/continuous-integration#2598) (Continuous-integration): Fixes the Docker Registry (bazel:latest tag).
   PR bazelbuild#29452 (Bazel): Fixes the GitHub Releases Page (the green "Latest" badge).
   PR #[2692](bazelbuild/continuous-integration#2602) (Continuous-integration): Buildkite pipeline for Github CLI migration.

Closes bazelbuild#29452.

PiperOrigin-RevId: 914121481
Change-Id: Ic725b3e49105b3d25c54545740e289a6f13f1aa0
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request May 18, 2026
…releases… (bazelbuild#29541)

… (bazelbuild#29452)

Problem:

GitHub automatically marks the most recently created release as
"Latest." When a maintenance patch (e.g., 8.7.0) is released after a
newer major version (e.g., 9.1.0), the "Latest" badge incorrectly
regresses to the older version.

  Solution:

Updated scripts/ci/build.sh to perform a semantic version check using
sort -V. If the new release is semantically older than an existing one,
the script now explicitly calls the GitHub API to set make_latest:
false, ensuring the badge stays on the true highest version.

  Impact:

- Guarantees the "Latest" badge always points to the highest semantic
version.
- Prevents legacy branch updates from hijacking the project's "Latest"
status.
- Syncs GitHub UI state with the fix introduced in
bazelbuild/continuous-integration#2598.

PR
#[2598](bazelbuild/continuous-integration#2598)
(Continuous-integration): Fixes the Docker Registry (bazel:latest tag).
PR bazelbuild#29452 (Bazel): Fixes the GitHub Releases Page (the green "Latest"
badge).
PR
#[2692](bazelbuild/continuous-integration#2602)
(Continuous-integration): Buildkite pipeline for Github CLI migration.

Closes bazelbuild#29452.

PiperOrigin-RevId: 914121481
Change-Id: Ic725b3e49105b3d25c54545740e289a6f13f1aa0

<!--
Thank you for contributing to Bazel!
Please read the contribution guidelines:
https://bazel.build/contribute.html
-->

### Description
<!--
Please provide a brief summary of the changes in this PR.
-->

### Motivation
<!--
Why is this change important? Does it fix a specific bug or add a new
feature?
If this PR fixes an existing issue, please link it here (e.g. "Fixes
bazelbuild#1234").
-->

### Build API Changes
<!--
Does this PR affect the Build API? (e.g. Starlark API, providers,
command-line flags, native rules)
If yes, please answer the following:
1. Has this been discussed in a design doc or issue? (Please link it)
2. Is the change backward compatible?
3. If it's a breaking change, what is the migration plan?
-->

No

### Checklist

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

<!--
If this is a new feature, please add 'RELNOTES[NEW]: <description>'
here.
If this is a breaking change, please add 'RELNOTES[INC]: <reason>' here.
If this change should be mentioned in release notes, please add
'RELNOTES: <reason>' here.
-->

RELNOTES: None

Commit
bazelbuild@a49b777

Co-authored-by: deepalak56 <deepalakshmib@google.com>
iancha1992 added a commit to bazel-io/bazel that referenced this pull request May 19, 2026
…releases… (bazelbuild#29595)

… (bazelbuild#29452)

Problem:

GitHub automatically marks the most recently created release as
"Latest." When a maintenance patch (e.g., 8.7.0) is released after a
newer major version (e.g., 9.1.0), the "Latest" badge incorrectly
regresses to the older version.

  Solution:

Updated scripts/ci/build.sh to perform a semantic version check using
sort -V. If the new release is semantically older than an existing one,
the script now explicitly calls the GitHub API to set make_latest:
false, ensuring the badge stays on the true highest version.

  Impact:

- Guarantees the "Latest" badge always points to the highest semantic
version.
- Prevents legacy branch updates from hijacking the project's "Latest"
status.
- Syncs GitHub UI state with the fix introduced in
bazelbuild/continuous-integration#2598.

PR
#[2598](bazelbuild/continuous-integration#2598)
(Continuous-integration): Fixes the Docker Registry (bazel:latest tag).
PR bazelbuild#29452 (Bazel): Fixes the GitHub Releases Page (the green "Latest"
badge).
PR
#[2692](bazelbuild/continuous-integration#2602)
(Continuous-integration): Buildkite pipeline for Github CLI migration.

Closes bazelbuild#29452.

PiperOrigin-RevId: 914121481
Change-Id: Ic725b3e49105b3d25c54545740e289a6f13f1aa0

<!--
Thank you for contributing to Bazel!
Please read the contribution guidelines:
https://bazel.build/contribute.html
-->

### Description
<!--
Please provide a brief summary of the changes in this PR.
-->

### Motivation
<!--
Why is this change important? Does it fix a specific bug or add a new
feature?
If this PR fixes an existing issue, please link it here (e.g. "Fixes
bazelbuild#1234").
-->

### Build API Changes
<!--
Does this PR affect the Build API? (e.g. Starlark API, providers,
command-line flags, native rules)
If yes, please answer the following:
1. Has this been discussed in a design doc or issue? (Please link it)
2. Is the change backward compatible?
3. If it's a breaking change, what is the migration plan?
-->

No

### Checklist

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

<!--
If this is a new feature, please add 'RELNOTES[NEW]: <description>'
here.
If this is a breaking change, please add 'RELNOTES[INC]: <reason>' here.
If this change should be mentioned in release notes, please add
'RELNOTES: <reason>' here.
-->

RELNOTES: None

Commit
bazelbuild@a49b777

Co-authored-by: deepalak56 <deepalakshmib@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants