Skip to content

Commit 621c889

Browse files
authored
Merge pull request #259 from vmercierfr/go1.24
Golang 1.24
2 parents 857f875 + ba8f973 commit 621c889

File tree

6 files changed

+124
-7
lines changed

6 files changed

+124
-7
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
- uses: actions/setup-go@v5
3838
with:
39-
go-version: stable
39+
go-version: '1.24'
4040

4141
- name: Set up QEMU for ARM64 build
4242
uses: docker/setup-qemu-action@v3

.github/workflows/linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v4
1717
- uses: actions/setup-go@v5
1818
with:
19-
go-version: '1.22'
19+
go-version: '1.24'
2020
cache: false
2121
- name: golangci-lint
2222
uses: golangci/golangci-lint-action@v6

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484

8585
- uses: actions/setup-go@v5
8686
with:
87-
go-version: stable
87+
go-version: '1.24'
8888

8989
- name: Set up QEMU for ARM64 build
9090
uses: docker/setup-qemu-action@v3

docs/golang-upgrade.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Go Version Upgrade Guide
2+
3+
This document outlines the process for upgrading the Go version used in the prometheus-rds-exporter project.
4+
5+
## Overview
6+
7+
The prometheus-rds-exporter project uses Go for building the application and relies on specific Go versions defined in multiple configuration files. When upgrading Go, all references must be updated consistently.
8+
9+
## Files to Update
10+
11+
When upgrading Go version, the following files need to be updated:
12+
13+
### 1. go.mod
14+
- Update the `go` directive to specify the new Go version
15+
- Update the `toolchain` directive to match the new Go version
16+
17+
**Example:**
18+
```go
19+
go 1.24.0
20+
21+
toolchain go1.24.0
22+
```
23+
24+
### 2. GitHub Actions Workflows
25+
26+
Update the `go-version` in the `actions/setup-go@v5` step
27+
28+
**Example:**
29+
```yaml
30+
- uses: actions/setup-go@v5
31+
with:
32+
go-version: '1.24'
33+
```
34+
35+
Update the Go version in all workflow files:
36+
- `.github/workflows/build.yaml`
37+
- `.github/workflows/test.yaml`
38+
- `github/workflows/linter.yaml`
39+
40+
### 3. Local development environment
41+
42+
- Update golang base image version (`FROM`) in the `scripts/prometheus/Dockerfile`
43+
44+
## Upgrade Process
45+
46+
1. Check for any deprecated features or breaking changes in the new Go version
47+
2. Update `go.mod` with the new Go version and toolchain
48+
3. Run tests
49+
1. Run local tests to ensure compatibility:
50+
```bash
51+
make test
52+
make lint
53+
make build
54+
```
55+
2. Update Go dependencies if required:
56+
```bash
57+
go mod tidy
58+
go mod download
59+
```
60+
4. Update GitHub Actions workflows with the specific Go version
61+
5. Commit these changes
62+
6. Verify GitHub Actions pass:
63+
- Push changes to a feature branch
64+
- Ensure all CI checks pass (linter, tests, build)
65+
7. Update this document with any new considerations
66+
8. Update README.md if it mentions specific Go version requirements
67+
68+
## Considerations
69+
70+
### Compatibility
71+
72+
- Ensure all dependencies support the new Go version
73+
- Check for any breaking changes in the Go release notes
74+
- Verify that the Docker base images support the new Go version (if using Go-based images)
75+
76+
### Testing
77+
78+
- Run the full test suite locally before pushing
79+
- Monitor CI/CD pipelines for any failures
80+
- Test the built binary in a staging environment
81+
82+
### Rollback Plan
83+
84+
If issues arise after the upgrade:
85+
1. Revert the configuration files to the previous Go version
86+
2. Run tests to ensure stability
87+
3. Investigate and resolve the compatibility issues
88+
4. Retry the upgrade process
89+
90+
## Useful Commands
91+
92+
```bash
93+
# Overrides golang version for test if not installed locally
94+
GOTOOLCHAIN=go1.24.0 make test
95+
96+
# Check current Go version
97+
go version
98+
99+
# Update dependencies
100+
go mod tidy
101+
102+
# Run tests
103+
make test
104+
105+
# Build the application
106+
make build
107+
108+
# Run linter
109+
make lint
110+
111+
# Check for security issues
112+
make checkcov
113+
```
114+
115+
## References
116+
117+
- [Go Release Notes](https://golang.org/doc/devel/release.html)
118+
- [Go Module Reference](https://golang.org/ref/mod)
119+
- [GitHub Actions Go Setup](https://github.com/actions/setup-go)

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/qonto/prometheus-rds-exporter
22

3-
go 1.23.0
4-
5-
toolchain go1.23.2
3+
go 1.24.0
64

75
require (
86
github.com/aws/aws-sdk-go-v2 v1.32.5

scripts/prometheus/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23 AS builder
1+
FROM golang:1.24 AS builder
22
ARG GOPROXY=direct
33

44
WORKDIR /build

0 commit comments

Comments
 (0)