Skip to content

Commit a3159b7

Browse files
authored
chore: upgrade golang + claude config (#2338)
Signed-off-by: Miguel Martinez <[email protected]>
1 parent d8889a4 commit a3159b7

File tree

13 files changed

+381
-12
lines changed

13 files changed

+381
-12
lines changed

.claude/golang-upgrade-process.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Go Version Upgrade Process
2+
3+
This document outlines the comprehensive process for upgrading Go versions across the Chainloop project.
4+
5+
NOTE
6+
7+
- do not upgrade dagger module
8+
9+
## Overview
10+
11+
The Chainloop project uses Go in multiple components requiring updates across:
12+
- Source code (go.mod files)
13+
- Docker images
14+
- CI/CD pipelines (GitHub Actions)
15+
- Documentation
16+
17+
## Step-by-Step Process
18+
19+
### 1. Get Latest Go Version and Docker Image Digest
20+
21+
```bash
22+
# Check latest Go version at https://go.dev/doc/devel/release
23+
# Get Docker image SHA256 digest
24+
docker pull golang:1.24.6
25+
# Note the SHA256 from output: sha256:2c89c41fb9efc3807029b59af69645867cfe978d2b877d475be0d72f6c6ce6f6
26+
```
27+
28+
### 2. Update Source Code
29+
30+
Update all `go.mod` files in the project:
31+
- `./go.mod` - Main project
32+
- `./extras/dagger/go.mod` - Dagger module
33+
34+
Change the `go` directive to new version:
35+
```go
36+
go 1.24.6
37+
```
38+
39+
### 3. Update Docker Images
40+
41+
Update all Dockerfiles with new version and SHA256:
42+
- `./app/artifact-cas/Dockerfile`
43+
- `./app/artifact-cas/Dockerfile.goreleaser`
44+
- `./app/controlplane/Dockerfile`
45+
- `./app/controlplane/Dockerfile.goreleaser`
46+
- `./app/cli/Dockerfile.goreleaser`
47+
48+
Replace `FROM` lines with:
49+
```dockerfile
50+
FROM golang:1.24.6@sha256:2c89c41fb9efc3807029b59af69645867cfe978d2b877d475be0d72f6c6ce6f6 AS builder
51+
```
52+
53+
### 4. Update GitHub Actions
54+
55+
Update go-version in all workflow files:
56+
- `./.github/workflows/lint.yml`
57+
- `./.github/workflows/test.yml`
58+
- `./.github/workflows/release.yaml`
59+
- `./.github/workflows/codeql.yml`
60+
- `./docs/examples/ci-workflows/github.yaml`
61+
62+
Find and replace:
63+
```yaml
64+
go-version: "1.24.4" # old version
65+
```
66+
with:
67+
```yaml
68+
go-version: "1.24.6" # new version
69+
```
70+
71+
### 5. Update Documentation
72+
73+
Update version reference in `./CLAUDE.md` - "Key Technologies" section:
74+
```markdown
75+
- **Language**: Go 1.24.6
76+
```
77+
78+
### 6. Test and Verify
79+
80+
```bash
81+
make test # Ensure compatibility
82+
make lint # Check code quality
83+
```
84+
85+
## Important Notes
86+
87+
1. **SHA256 Verification**: Always use SHA256 digests for Docker images for security and reproducibility
88+
2. **Test Thoroughly**: Go upgrades can introduce breaking changes
89+
3. **Multiple Components**: CLI, Control Plane, and Artifact CAS all use Go
90+
4. **Dagger Module**: Has separate go.mod that needs updating
91+
5. **Development Environment**: Compose files use pre-built images, don't need Go updates
92+
93+
## Files Updated in This Process
94+
95+
### Source Code
96+
- `./go.mod`
97+
98+
### Docker Images
99+
- `./app/artifact-cas/Dockerfile`
100+
- `./app/artifact-cas/Dockerfile.goreleaser`
101+
- `./app/controlplane/Dockerfile`
102+
- `./app/controlplane/Dockerfile.goreleaser`
103+
- `./app/cli/Dockerfile.goreleaser`
104+
105+
### CI/CD Workflows
106+
- `./.github/workflows/lint.yml`
107+
- `./.github/workflows/test.yml`
108+
- `./.github/workflows/release.yaml`
109+
- `./.github/workflows/codeql.yml`
110+
- `./docs/examples/ci-workflows/github.yaml`
111+
112+
### Documentation
113+
- `./CLAUDE.md`

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Set up Go
4949
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3.6.1
5050
with:
51-
go-version: "1.24.4"
51+
go-version: "1.24.6"
5252

5353
# Initializes the CodeQL tools for scanning.
5454
- name: Initialize CodeQL

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3.6.1
2828
with:
29-
go-version: "1.24.4"
29+
go-version: "1.24.6"
3030

3131
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3232

@@ -67,7 +67,7 @@ jobs:
6767
6868
- uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3.6.1
6969
with:
70-
go-version: "1.24.4"
70+
go-version: "1.24.6"
7171

7272
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7373

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
- name: Set up Go
7979
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3.6.1
8080
with:
81-
go-version: "1.24.4"
81+
go-version: "1.24.6"
8282

8383
# install qemu binaries for multiarch builds (needed by goreleaser/buildx)
8484
- name: Setup qemu

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2828
- uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3.6.1
2929
with:
30-
go-version: "1.24.4"
30+
go-version: "1.24.6"
3131
cache: true
3232
cache-dependency-path: go.sum
3333

0 commit comments

Comments
 (0)