You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 52e98fb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .claude/skills/upgrading-golang/SKILL.md
+47-15Lines changed: 47 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: upgrading-golang
3
-
description: Upgrades Go version across the entire Chainloop codebase including source files, Docker images, CI/CD workflows, and documentation. Use when the user mentions upgrading Go, golang version, or updating Go compiler version.
3
+
description: Upgrades Go version across the entire Chainloop codebase including source files, Docker images, golangci-lint, CI/CD workflows, and documentation. Use when the user mentions upgrading Go, golang version, or updating Go compiler version, or when CI lint fails because golangci-lint was built with an older Go than the one targeted in go.mod.
4
4
---
5
5
6
6
# Upgrading Golang Version
@@ -12,7 +12,7 @@ This skill automates the comprehensive Go version upgrade process across all com
12
12
### 1. Confirm Target Versions
13
13
14
14
Ask the user:
15
-
1. What Go version they want to upgrade to (e.g., "1.25.3")
15
+
1. What Go version they want to upgrade to (e.g., "1.25.3"). If they give only a minor version (e.g., "1.27"), use the latest patch from `curl -s 'https://go.dev/dl/?mode=json'`.
16
16
2. Whether they also want to upgrade Atlas migrations Docker image (if yes, ask for target Atlas version, e.g., "0.38.0")
17
17
18
18
### 2. Get Docker Image Digest
@@ -25,6 +25,16 @@ docker pull golang:X.XX.X
25
25
26
26
Extract the SHA256 digest from the output (format: `sha256:abc123...`).
27
27
28
+
If the Docker daemon is not running, read the multi-arch index digest from the registry instead:
Update all Dockerfiles with the new version and SHA256 digest. See [files-to-update.md](files-to-update.md) for the complete list.
@@ -51,26 +63,50 @@ With:
51
63
FROM golang:X.XX.X@sha256:NEW_DIGEST AS builder
52
64
```
53
65
54
-
### 5. Update Documentation
66
+
### 5. Update golangci-lint
67
+
68
+
golangci-lint refuses to run when it was built with a Go version older than the `go` directive in `go.mod` ("the Go language version (goX.YY) used to build golangci-lint is lower than the targeted Go version"). On a Go minor upgrade, bump it to a release that supports the new Go version.
69
+
70
+
1. Find the first golangci-lint release that adds support for the new Go minor (its changelog has a "goX.YY support" entry): `gh release list -R golangci/golangci-lint`. Prefer the latest release.
71
+
2. Update every `version:` of `golangci/golangci-lint-action` in `.github/workflows/lint.yml`.
72
+
3. Update the install version in the `init` target of `./common.mk` to the same version.
73
+
4. Verify locally the way CI runs it (CI uses `only-new-issues`), from the repo root and from `app/cli`, `app/controlplane` and `app/artifact-cas`:
74
+
75
+
```bash
76
+
GOBIN=<scratch-dir> go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@vX.Y.Z
77
+
<scratch-dir>/golangci-lint run --new-from-rev=<upstream>/main
78
+
```
79
+
80
+
For a Go patch upgrade, the golangci-lint bump is not required.
81
+
82
+
### 5b. Regenerate Protobuf Code
83
+
84
+
The protoc plugins (`protoc-gen-go`, etc.) format their output with the `go/format` of the Go toolchain that built them. A new Go minor can change how comments in generated `.pb.go` files are formatted, and the CI `Test (main-module)` job fails with "The Git repository is dirty" when the committed files do not match.
85
+
86
+
1. Rebuild the codegen tools with the new Go: `make init-api-tools`.
87
+
2. Run `make api` (the openapi step needs Docker running) and `make config`.
88
+
3. Commit the regenerated `.pb.go` files. The changes are expected to be comment-only; investigate anything else.
89
+
90
+
### 6. Update Documentation
55
91
56
92
Update the version reference in `./CLAUDE.md` under "Key Technologies":
57
93
```markdown
58
-
-**Language**: Go X.XX.X. To know how to upgrade go version, see docs/runbooks
94
+
-**Language**: Go X.XX.X
59
95
```
60
96
61
-
### 6. Update Atlas Docker Image and CLI (Optional)
97
+
### 7. Update Atlas Docker Image and CLI (Optional)
62
98
63
99
If the user requested an Atlas upgrade:
64
100
65
-
**6a. Pull the Atlas Docker image and extract its SHA256 digest:**
101
+
**7a. Pull the Atlas Docker image and extract its SHA256 digest:**
66
102
67
103
```bash
68
104
docker pull arigaio/atlas:X.XX.X
69
105
```
70
106
71
107
Extract the SHA256 digest from the output (format: `sha256:abc123...`).
0 commit comments