From 1fb4cc123ea376cae5c3b3207d2e532783451f24 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Mon, 14 Oct 2024 00:47:44 -0700 Subject: [PATCH] upgrade go version to 1.23.2 and update build image (#6262) --- .github/workflows/test-build-deploy.yml | 14 +++++++------- .golangci.yml | 3 +++ CHANGELOG.md | 1 + Makefile | 2 +- go.mod | 4 +--- pkg/ring/kv/dynamodb/dynamodb.go | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml index 83e4a6cc11..1b9232906f 100644 --- a/.github/workflows/test-build-deploy.yml +++ b/.github/workflows/test-build-deploy.yml @@ -17,7 +17,7 @@ jobs: lint: runs-on: ubuntu-20.04 container: - image: quay.io/cortexproject/build-image:master-582c03a76 + image: quay.io/cortexproject/build-image:master-ac7827fa9 steps: - name: Checkout Repo uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 @@ -46,7 +46,7 @@ jobs: test: runs-on: ubuntu-20.04 container: - image: quay.io/cortexproject/build-image:master-582c03a76 + image: quay.io/cortexproject/build-image:master-ac7827fa9 steps: - name: Checkout Repo uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 @@ -89,7 +89,7 @@ jobs: build: runs-on: ubuntu-20.04 container: - image: quay.io/cortexproject/build-image:master-582c03a76 + image: quay.io/cortexproject/build-image:master-ac7827fa9 steps: - name: Checkout Repo uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 @@ -148,7 +148,7 @@ jobs: - name: Upgrade golang uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2.2.0 with: - go-version: 1.22.5 + go-version: 1.23.2 - name: Checkout Repo uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - name: Install Docker Client @@ -224,14 +224,14 @@ jobs: run: | touch build-image/.uptodate MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations - make BUILD_IMAGE=quay.io/cortexproject/build-image:master-582c03a76 TTY='' configs-integration-test + make BUILD_IMAGE=quay.io/cortexproject/build-image:master-ac7827fa9 TTY='' configs-integration-test deploy_website: needs: [build, test] if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex' runs-on: ubuntu-20.04 container: - image: quay.io/cortexproject/build-image:master-582c03a76 + image: quay.io/cortexproject/build-image:master-ac7827fa9 steps: - name: Checkout Repo uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 @@ -273,7 +273,7 @@ jobs: if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex' runs-on: ubuntu-20.04 container: - image: quay.io/cortexproject/build-image:master-582c03a76 + image: quay.io/cortexproject/build-image:master-ac7827fa9 steps: - name: Checkout Repo uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 diff --git a/.golangci.yml b/.golangci.yml index 77d8f8cab6..dbfe02e837 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -21,6 +21,9 @@ linters-settings: local-prefixes: "github.com/cortexproject/cortex" revive: severity: error # We only want critical issues. + govet: + disable: + - printf depguard: rules: diff --git a/CHANGELOG.md b/CHANGELOG.md index 69e340bbf0..23094f9fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ * [ENHANCEMENT] StoreGateway: Implement metadata API limit in queryable. #6195 * [ENHANCEMENT] Ingester: Add matchers to ingester LabelNames() and LabelNamesStream() RPC. #6209 * [ENHANCEMENT] Ingester/Store Gateway Clients: Introduce an experimental HealthCheck handler to quickly fail requests directed to unhealthy targets. #6225 #6257 +* [ENHANCEMENT] Upgrade build image and Go version to 1.23.2. #6261 #6262 * [BUGFIX] Runtime-config: Handle absolute file paths when working directory is not / #6224 ## 1.18.0 2024-09-03 diff --git a/Makefile b/Makefile index c3666f7af3..2704ee35b6 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ build-image/$(UPTODATE): build-image/* SUDO := $(shell docker info >/dev/null 2>&1 || echo "sudo -E") BUILD_IN_CONTAINER := true BUILD_IMAGE ?= $(IMAGE_PREFIX)build-image -LATEST_BUILD_IMAGE_TAG ?= master-582c03a76 +LATEST_BUILD_IMAGE_TAG ?= master-ac7827fa9 # TTY is parameterized to allow Google Cloud Builder to run builds, # as it currently disallows TTY devices. This value needs to be overridden diff --git a/go.mod b/go.mod index d547704003..6c7651cb9f 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/cortexproject/cortex -go 1.22.0 - -toolchain go1.22.5 +go 1.23.0 require ( github.com/Masterminds/squirrel v1.5.4 diff --git a/pkg/ring/kv/dynamodb/dynamodb.go b/pkg/ring/kv/dynamodb/dynamodb.go index 1e783189a5..f54e5fe55b 100644 --- a/pkg/ring/kv/dynamodb/dynamodb.go +++ b/pkg/ring/kv/dynamodb/dynamodb.go @@ -237,7 +237,7 @@ func (kv dynamodbKV) Batch(ctx context.Context, put map[dynamodbKey][]byte, dele totalCapacity += getCapacityUnits(consumedCapacity) } - if resp.UnprocessedItems != nil && len(resp.UnprocessedItems) > 0 { + if len(resp.UnprocessedItems) > 0 { return totalCapacity, fmt.Errorf("error processing batch request for %s requests", resp.UnprocessedItems) } }