Skip to content

[release-3.1] Upgrade Go to 1.26.4#15659

Merged
narqo merged 3 commits into
release-3.1from
vrnkn/push-ppmzwzmtyprt
Jun 12, 2026
Merged

[release-3.1] Upgrade Go to 1.26.4#15659
narqo merged 3 commits into
release-3.1from
vrnkn/push-ppmzwzmtyprt

Conversation

@narqo

@narqo narqo commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

That's a backport for #15566 to release-3.1

This also brings the fixes #15439 to the build-image workflow, which is broken in the release-3.1 and doesn't let this PR pass (doing it in one bundle to cut on PR stamping).

And also backport #15429 for the same reason.


Note

Medium Risk
Changes CI build/push paths, registry, and automated Makefile commits on PRs; security impact is limited but release-branch merge gates depend on the refactored workflow behaving correctly.

Overview
Upgrades the CI build toolchain to Go 1.26.4 for CVE-2026-42507, updates mimir-build-image/Dockerfile, bumps the pinned LATEST_BUILD_IMAGE_TAG in the Makefile, and documents the change in CHANGELOG.md. The vendoring workflow’s setup-go version is aligned to 1.26.4.

Replaces the monolithic push-mimir-build-image job with prepare, a reusable GAR multi-arch build (build-push-multiarch), and a build_and_push job that still satisfies the legacy required check name. Triggers now cover any change under mimir-build-image/ or the workflow file (via paginated PR Files API instead of gh pr diff), image tags hash the whole directory plus workflow, and Makefile updates are committed with ghcommit and digest-aware tag replacement.

Makefile defaults point BUILD_IMAGE at Google Artifact Registry (us-docker.pkg.dev/.../mimir-build-image) and add print-build-image-build-args for the shared build workflow. Org-membership authorization for image builds is removed in favor of GitHub’s fork vs write-access permission model.

Reviewed by Cursor Bugbot for commit 919b700. Bugbot is set up for automated code reviews on this repo. Configure here.

@narqo narqo requested a review from a team as a code owner June 12, 2026 12:11
@narqo narqo force-pushed the vrnkn/push-ppmzwzmtyprt branch from 69448b9 to 1474a82 Compare June 12, 2026 12:31
@github-actions

Copy link
Copy Markdown
Contributor

Building new version of mimir-build-image. After image is built and pushed to the registry, a new commit will automatically be added to this PR with new image version grafana/mimir-build-image:pr15659-257896013f. This can take up to 1 hour.

@narqo narqo force-pushed the vrnkn/push-ppmzwzmtyprt branch from 1474a82 to 6536d46 Compare June 12, 2026 14:30
@github-actions

Copy link
Copy Markdown
Contributor

Building new version of mimir-build-image. After image is built and pushed to the registry, a new commit will automatically be added to this PR with new image version us-docker.pkg.dev/grafanalabs-dev/docker-mimir-build-image/mimir-build-image:pr15659-b89cff175d. This can take a few minutes.

@github-actions

Copy link
Copy Markdown
Contributor

Not building new version of mimir-build-image. This PR modifies the build image or the build image build workflow, but the image us-docker.pkg.dev/grafanalabs-dev/docker-mimir-build-image/mimir-build-image:pr15659-b89cff175d already exists.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Makefile skipped when image exists
    • Decoupled Makefile synchronization from need_to_build flag so the Makefile is always updated when files are modified, even when the image already exists in the registry.

Create PR

Or push these changes by commenting:

@cursor push 3cd14ff2a3
Preview (3cd14ff2a3)
diff --git a/.github/workflows/push-mimir-build-image.yml b/.github/workflows/push-mimir-build-image.yml
--- a/.github/workflows/push-mimir-build-image.yml
+++ b/.github/workflows/push-mimir-build-image.yml
@@ -112,10 +112,12 @@
           IMAGE: ${{ steps.compute_variables.outputs.image_name }}
 
     outputs:
+      modified: ${{ steps.check_if_files_modified.outputs.modified }}
       need_to_build: ${{ steps.check_if_image_is_built.outputs.need_to_build }}
       new_image_tag: ${{ steps.compute_variables.outputs.new_image_tag }}
       main_image_tag: ${{ steps.compute_variables.outputs.main_image_tag }}
       build_args: ${{ steps.compute_variables.outputs.build_args }}
+      image_name: ${{ steps.compute_variables.outputs.image_name }}
 
   build-push-multiarch:
     name: Build image
@@ -159,7 +161,7 @@
           exit 1
 
       - name: Checkout repository
-        if: needs.prepare.outputs.need_to_build == 'true'
+        if: needs.prepare.outputs.modified == 'true'
         uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
         with:
           persist-credentials: false
@@ -170,12 +172,18 @@
       # `changed=false` and no commit will be made.
       - name: Check whether Makefile needs updating, and update it
         id: update_makefile
-        if: needs.prepare.outputs.need_to_build == 'true'
+        if: needs.prepare.outputs.modified == 'true'
         run: |
           set -euo pipefail
+          # If we built a new image, use the digest output; otherwise use the computed tag
+          if [ "$NEED_TO_BUILD" = "true" ]; then
+            NEW_IMAGE="$BUILD_IMAGE_DIGEST"
+          else
+            NEW_IMAGE="$IMAGE_NAME:$NEW_IMAGE_TAG"
+          fi
           NEW_IMAGE_TAG=$(echo $NEW_IMAGE | cut -d ':' -f 2-)
           echo "Current build image tag is $MAIN_IMAGE_TAG"
-          echo "Built image is $NEW_IMAGE, new tag is $NEW_IMAGE_TAG"
+          echo "Target image is $NEW_IMAGE, new tag is $NEW_IMAGE_TAG"
           if [ "$MAIN_IMAGE_TAG" = "$NEW_IMAGE_TAG" ]; then
             echo "Build image tag is already up to date."
             echo "changed=false" >> "$GITHUB_OUTPUT"
@@ -184,7 +192,10 @@
             echo "changed=true" >> "$GITHUB_OUTPUT"
           fi
         env:
-          NEW_IMAGE: ${{ needs.build-push-multiarch.outputs.image-digests }}
+          NEED_TO_BUILD: ${{ needs.prepare.outputs.need_to_build }}
+          BUILD_IMAGE_DIGEST: ${{ needs.build-push-multiarch.outputs.image-digests }}
+          IMAGE_NAME: ${{ needs.prepare.outputs.image_name }}
+          NEW_IMAGE_TAG: ${{ needs.prepare.outputs.new_image_tag }}
           MAIN_IMAGE_TAG: ${{ needs.prepare.outputs.main_image_tag }}
 
       # Generate the app token here (rather than earlier in the job) so we only mint one

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 919b700. Configure here.

# `changed=false` and no commit will be made.
- name: Check whether Makefile needs updating, and update it
id: update_makefile
if: needs.prepare.outputs.need_to_build == 'true'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makefile skipped when image exists

Medium Severity

The Check whether Makefile needs updating step only runs when need_to_build is true. If the registry already has the PR image tag (re-run, failed bot commit, or stale LATEST_BUILD_IMAGE_TAG), the build is skipped but the Makefile is never synced, so the required build_and_push check can pass with an outdated pin.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 919b700. Configure here.

@narqo narqo enabled auto-merge (squash) June 12, 2026 14:50
@narqo narqo merged commit b17117a into release-3.1 Jun 12, 2026
79 checks passed
@narqo narqo deleted the vrnkn/push-ppmzwzmtyprt branch June 12, 2026 14:57
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