Skip to content

Commit 5eecbca

Browse files
fpetkovskijnyi
authored andcommitted
Update go to 1.23 in the CI
This commit updates the go version to 1.23 in the CI, including unit, e2e tests and promu crossbuild. It also bumps bingo dependencies where needed. Signed-off-by: Filip Petkovski <[email protected]>
1 parent 5419ead commit 5eecbca

20 files changed

+3985
-37
lines changed

.bingo/Variables.mk

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ GO ?= $(shell which go)
1717
# @echo "Running alertmanager"
1818
# @$(ALERTMANAGER) <flags/args..>
1919
#
20-
ALERTMANAGER := $(GOBIN)/alertmanager-v0.24.0
20+
ALERTMANAGER := $(GOBIN)/alertmanager-v0.27.0
2121
$(ALERTMANAGER): $(BINGO_DIR)/alertmanager.mod
2222
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
23-
@echo "(re)installing $(GOBIN)/alertmanager-v0.24.0"
24-
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=alertmanager.mod -o=$(GOBIN)/alertmanager-v0.24.0 "github.com/prometheus/alertmanager/cmd/alertmanager"
23+
@echo "(re)installing $(GOBIN)/alertmanager-v0.27.0"
24+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=alertmanager.mod -o=$(GOBIN)/alertmanager-v0.27.0 "github.com/prometheus/alertmanager/cmd/alertmanager"
2525

2626
BINGO := $(GOBIN)/bingo-v0.9.0
2727
$(BINGO): $(BINGO_DIR)/bingo.mod
@@ -95,23 +95,23 @@ $(MDOX): $(BINGO_DIR)/mdox.mod
9595
@echo "(re)installing $(GOBIN)/mdox-v0.9.1-0.20220713110358-25b9abcf90a0"
9696
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=mdox.mod -o=$(GOBIN)/mdox-v0.9.1-0.20220713110358-25b9abcf90a0 "github.com/bwplotka/mdox"
9797

98-
MINIO := $(GOBIN)/minio-v0.0.0-20220720015624-ce8397f7d944
98+
MINIO := $(GOBIN)/minio-v0.0.0-20241014163537-3da7c9cce3de
9999
$(MINIO): $(BINGO_DIR)/minio.mod
100100
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
101-
@echo "(re)installing $(GOBIN)/minio-v0.0.0-20220720015624-ce8397f7d944"
102-
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=minio.mod -o=$(GOBIN)/minio-v0.0.0-20220720015624-ce8397f7d944 "github.com/minio/minio"
101+
@echo "(re)installing $(GOBIN)/minio-v0.0.0-20241014163537-3da7c9cce3de"
102+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=minio.mod -o=$(GOBIN)/minio-v0.0.0-20241014163537-3da7c9cce3de "github.com/minio/minio"
103103

104104
PROMDOC := $(GOBIN)/promdoc-v0.8.0
105105
$(PROMDOC): $(BINGO_DIR)/promdoc.mod
106106
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
107107
@echo "(re)installing $(GOBIN)/promdoc-v0.8.0"
108108
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=promdoc.mod -o=$(GOBIN)/promdoc-v0.8.0 "github.com/plexsystems/promdoc"
109109

110-
PROMETHEUS := $(GOBIN)/prometheus-v0.37.0
110+
PROMETHEUS := $(GOBIN)/prometheus-v0.54.1
111111
$(PROMETHEUS): $(BINGO_DIR)/prometheus.mod
112112
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
113-
@echo "(re)installing $(GOBIN)/prometheus-v0.37.0"
114-
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=prometheus.mod -o=$(GOBIN)/prometheus-v0.37.0 "github.com/prometheus/prometheus/cmd/prometheus"
113+
@echo "(re)installing $(GOBIN)/prometheus-v0.54.1"
114+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=prometheus.mod -o=$(GOBIN)/prometheus-v0.54.1 "github.com/prometheus/prometheus/cmd/prometheus"
115115

116116
PROMTOOL := $(GOBIN)/promtool-v0.47.0
117117
$(PROMTOOL): $(BINGO_DIR)/promtool.mod

.bingo/alertmanager.mod

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
22

3-
go 1.14
3+
go 1.21
44

5-
require github.com/prometheus/alertmanager v0.24.0 // cmd/alertmanager
5+
toolchain go1.23.1
6+
7+
require github.com/prometheus/alertmanager v0.27.0 // cmd/alertmanager

.bingo/alertmanager.sum

+758
Large diffs are not rendered by default.

.bingo/minio.mod

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
22

3-
go 1.14
3+
go 1.22
44

5-
require github.com/minio/minio v0.0.0-20220720015624-ce8397f7d944
5+
toolchain go1.23.1
6+
7+
require github.com/minio/minio v0.0.0-20241014163537-3da7c9cce3de

.bingo/minio.sum

+1,720
Large diffs are not rendered by default.

.bingo/prometheus.mod

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
22

3-
go 1.14
3+
go 1.21.0
4+
5+
toolchain go1.23.1
46

57
replace k8s.io/klog => github.com/simonpasquier/klog-gokit v0.3.0
68

7-
replace k8s.io/klog/v2 => github.com/simonpasquier/klog-gokit/v3 v3.0.0
9+
replace k8s.io/klog/v2 => github.com/simonpasquier/klog-gokit/v3 v3.3.0
810

911
exclude github.com/linode/linodego v1.0.0
1012

1113
exclude github.com/grpc-ecosystem/grpc-gateway v1.14.7
1214

1315
exclude google.golang.org/api v0.30.0
1416

15-
require github.com/prometheus/prometheus v0.37.0 // cmd/prometheus
17+
require github.com/prometheus/prometheus v0.54.1 // cmd/prometheus

.bingo/prometheus.sum

+1,454
Large diffs are not rendered by default.

.bingo/variables.env

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ -z "$GOBIN" ]; then
88
fi
99

1010

11-
ALERTMANAGER="${GOBIN}/alertmanager-v0.24.0"
11+
ALERTMANAGER="${GOBIN}/alertmanager-v0.27.0"
1212

1313
BINGO="${GOBIN}/bingo-v0.9.0"
1414

@@ -34,11 +34,11 @@ JSONNETFMT="${GOBIN}/jsonnetfmt-v0.18.0"
3434

3535
MDOX="${GOBIN}/mdox-v0.9.1-0.20220713110358-25b9abcf90a0"
3636

37-
MINIO="${GOBIN}/minio-v0.0.0-20220720015624-ce8397f7d944"
37+
MINIO="${GOBIN}/minio-v0.0.0-20241014163537-3da7c9cce3de"
3838

3939
PROMDOC="${GOBIN}/promdoc-v0.8.0"
4040

41-
PROMETHEUS="${GOBIN}/prometheus-v0.37.0"
41+
PROMETHEUS="${GOBIN}/prometheus-v0.54.1"
4242

4343
PROMTOOL="${GOBIN}/promtool-v0.47.0"
4444

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ orbs:
88
executors:
99
golang:
1010
docker:
11-
- image: cimg/go:1.22-node
11+
- image: cimg/go:1.23-node
1212
golang-test:
1313
docker:
14-
- image: cimg/go:1.22-node
14+
- image: cimg/go:1.23-node
1515
- image: quay.io/thanos/docker-swift-onlyone-authv2-keystone:v0.1
1616

1717
jobs:

.github/workflows/docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install Go
2424
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
2525
with:
26-
go-version: 1.22.x
26+
go-version: 1.23.x
2727

2828
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
2929
with:

.github/workflows/go.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install Go
2525
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
2626
with:
27-
go-version: 1.22.x
27+
go-version: 1.23.x
2828

2929
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
3030
with:
@@ -51,7 +51,7 @@ jobs:
5151
- name: Install Go
5252
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
5353
with:
54-
go-version: 1.22.x
54+
go-version: 1.23.x
5555

5656
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
5757
with:
@@ -145,7 +145,7 @@ jobs:
145145
check_filenames: false
146146
check_hidden: true
147147
skip: ./pkg/ui/*,./pkg/store/6545postingsrepro,./internal/*,./mixin/vendor/*,./.bingo/*,go.mod,go.sum
148-
ignore_words_list: intrumentation,mmaped,nd,ot,re-use,ser,serie,sme,sudu,tast,te
148+
ignore_words_list: intrumentation,mmaped,nd,ot,re-use,ser,serie,sme,sudu,tast,te,ans
149149

150150
e2e:
151151
strategy:
@@ -164,7 +164,7 @@ jobs:
164164
- name: Install Go.
165165
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
166166
with:
167-
go-version: 1.22.x
167+
go-version: 1.23.x
168168

169169
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
170170
with:

.go-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.22
1+
1.23

.promu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
go:
2-
version: 1.22
2+
version: 1.23
33
repository:
44
path: github.com/thanos-io/thanos
55
build:

Dockerfile.e2e-tests

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Taking a non-alpine image for e2e tests so that cgo can be enabled for the race detector.
2-
FROM golang:1.23 as builder
2+
FROM golang:1.23.2 as builder
33

44
WORKDIR $GOPATH/src/github.com/thanos-io/thanos
55

Dockerfile.multi-stage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# By default we pin to amd64 sha. Use make docker to automatically adjust for arm64 versions.
22
ARG BASE_DOCKER_SHA="14d68ca3d69fceaa6224250c83d81d935c053fb13594c811038c461194599973"
3-
FROM golang:1.22-alpine3.18 as builder
3+
FROM golang:1.23.2-alpine3.20 as builder
44

55
WORKDIR $GOPATH/src/github.com/thanos-io/thanos
66
# Change in the docker context invalidates the cache so to leverage docker

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,7 @@ go-lint: check-git deps $(GOLANGCI_LINT) $(FAILLINT)
395395
$(call require_clean_work_tree,'detected not clean work tree before running lint, previous job changed something?')
396396
@echo ">> verifying modules being imported"
397397
@# TODO(bwplotka): Add, Printf, DefaultRegisterer, NewGaugeFunc and MustRegister once exception are accepted. Add fmt.{Errorf}=github.com/pkg/errors.{Errorf} once https://github.com/fatih/faillint/issues/10 is addressed.
398-
@$(FAILLINT) -paths "errors=github.com/pkg/errors,\
399-
github.com/prometheus/tsdb=github.com/prometheus/prometheus/tsdb,\
398+
@$(FAILLINT) -paths "github.com/prometheus/tsdb=github.com/prometheus/prometheus/tsdb,\
400399
github.com/prometheus/prometheus/pkg/testutils=github.com/thanos-io/thanos/pkg/testutil,\
401400
github.com/prometheus/client_golang/prometheus.{DefaultGatherer,DefBuckets,NewUntypedFunc,UntypedFunc},\
402401
github.com/prometheus/client_golang/prometheus.{NewCounter,NewCounterVec,NewCounterVec,NewGauge,NewGaugeVec,NewGaugeFunc,\

pkg/rules/manager_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func TestManager_Rules(t *testing.T) {
359359
thanosRuleMgr.Run()
360360
thanosRuleMgr.Stop()
361361
}()
362-
testRulesAgainstExamples(t, filepath.Join(curr, "../../examples/alerts"), thanosRuleMgr)
362+
testRulesAgainstExamples(t, filepath.Join(curr, "../../examples/alerts"), thanosRuleMgr, false)
363363
}
364364

365365
func TestManagerUpdateWithNoRules(t *testing.T) {

pkg/rules/prometheus_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ rule_files:
4545
promRules := NewPrometheus(u, promclient.NewDefaultClient(), func() labels.Labels {
4646
return labels.FromStrings("replica", "test1")
4747
})
48-
testRulesAgainstExamples(t, filepath.Join(root, "examples/alerts"), promRules)
48+
testRulesAgainstExamples(t, filepath.Join(root, "examples/alerts"), promRules, true)
4949
}

pkg/rules/rules_test.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
"testing"
1111
"time"
1212

13+
"golang.org/x/exp/slices"
14+
1315
"github.com/efficientgo/core/testutil"
1416
"github.com/gogo/protobuf/proto"
1517
"github.com/prometheus/prometheus/model/labels"
@@ -25,7 +27,7 @@ func TestMain(m *testing.M) {
2527
}
2628

2729
// testRulesAgainstExamples tests against alerts.yaml and rules.yaml examples.
28-
func testRulesAgainstExamples(t *testing.T, dir string, server rulespb.RulesServer) {
30+
func testRulesAgainstExamples(t *testing.T, dir string, server rulespb.RulesServer, removeEmptyGroups bool) {
2931
t.Helper()
3032

3133
// We don't test internals, just if groups are expected.
@@ -158,7 +160,9 @@ func testRulesAgainstExamples(t *testing.T, dir string, server rulespb.RulesServ
158160
}
159161
testutil.Ok(t, err)
160162

161-
expectedForType := expected
163+
expectedForType := make([]*rulespb.RuleGroup, len(expected))
164+
copy(expectedForType, expected)
165+
162166
if tcase.requestedType != rulespb.RulesRequest_ALL {
163167
expectedForType = make([]*rulespb.RuleGroup, len(expected))
164168
for i, g := range expected {
@@ -180,6 +184,13 @@ func testRulesAgainstExamples(t *testing.T, dir string, server rulespb.RulesServ
180184
}
181185
}
182186

187+
// The Prometheus API does not return groups with no rules.
188+
if removeEmptyGroups {
189+
expectedForType = slices.DeleteFunc(expectedForType, func(group *rulespb.RuleGroup) bool {
190+
return len(group.Rules) == 0
191+
})
192+
}
193+
183194
got := groups.Groups
184195

185196
// We don't want to be picky, just check what number and types of rules within group are.

pkg/testutil/e2eutil/prometheus.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242
)
4343

4444
const (
45-
defaultPrometheusVersion = "v0.37.0"
45+
defaultPrometheusVersion = "v0.54.1"
4646
defaultAlertmanagerVersion = "v0.20.0"
4747
defaultMinioVersion = "RELEASE.2022-07-30T05-21-40Z"
4848

0 commit comments

Comments
 (0)