Skip to content

Update to Go 1.26 and pin the CI toolchain - #126

Merged
hrak merged 3 commits into
developfrom
go_1_26
Aug 27, 2026
Merged

Update to Go 1.26 and pin the CI toolchain#126
hrak merged 3 commits into
developfrom
go_1_26

Conversation

@hrak

@hrak hrak commented Aug 27, 2026

Copy link
Copy Markdown
Member

What this does

Moves the project to Go 1.26. Builds on the toolchain pinning already in develop, so CI picks the new version up from make go-version automatically.

chore(ci): Ubuntu runners 22.04 → 24.04

ubuntu-22.04 is deprecated. 24.04 is what ubuntu-latest currently points at. 26.04 is still marked preview by actions/runner-images, so this holds off on it.

chore(deps): Go 1.26.7, golangci-lint v2.13.1

  • go directive → 1.26.0 in all three modules (root, hack/tools, test/e2e); pinned toolchain → 1.26.7.
  • make modules now also tidies test/e2e, which was previously skipped — that module's go directive would otherwise drift.
  • golangci-lint v2.13.1 ships a staticcheck that prints package paths without quotes and reports deprecated struct fields by type ((…v1beta2.ClusterV1Beta1DeprecatedStatus).Conditions) rather than by expression. Both existing SA1019 exclusions for the CAPI v1beta1 deprecations stopped matching as a result, surfacing 18 pre-existing deprecation warnings as failures. The regexes now accept either form.
  • One genuine new prealloc finding fixed: crdMigratorSkipPhases in main.go.

Verification

make build, make lint (0 issues), and make test all pass under go1.26.7, plus go vet -tags e2e ./... in the test/e2e module and a build of hack/tools. No go.sum churn — the bump is the go directive only.

Note for reviewers

If you have an existing checkout, run rm -f hack/tools/bin/* before building. Stale tool binaries compiled with go1.25 fail with package requires newer Go version go1.26mockgen in particular. CI builds tools fresh, so it is unaffected.

🤖 Generated with Claude Code

@hrak
hrak changed the base branch from main to develop August 27, 2026 14:29
hrak and others added 3 commits August 27, 2026 17:16
ubuntu-22.04 is deprecated. Move to 24.04, which is what ubuntu-latest
currently points at. 26.04 is still marked preview by
actions/runner-images, so hold off on it for now.
Bump the go directive to 1.26.0 in all three modules (root, hack/tools,
test/e2e) and the pinned toolchain to 1.26.7.

Also make `make modules` tidy the test/e2e module, which was previously
left out.

golangci-lint v2.13.1 ships a staticcheck that prints package paths
without quotes and reports deprecated struct fields by type rather than
by expression, so both existing SA1019 exclusions for the CAPI v1beta1
deprecations stopped matching. Widen the regexes to accept either form.
Preallocate crdMigratorSkipPhases for the new prealloc finding.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
make's `export` does not reach $(shell ...) calls evaluated at parse
time, so `go list -m` (via get_go_version) and the `go env` lookups ran
with GOTOOLCHAIN=auto rather than the pinned GOTOOLCHAIN. With the go
directive now at 1.26.0, that made every make invocation download a
go1.26.0 toolchain into GOMODCACHE.

In CI this broke the Lint job: `make go-version` runs before
actions/setup-go, so the stray toolchain landed in GOMODCACHE first and
setup-go's cache restore then failed with `tar: Cannot open: File
exists`. Without a warm module cache, building golangci-lint from source
re-downloaded and sumdb-verified its whole dependency tree, which kept
hitting sum.golang.org HTTP/2 INTERNAL_ERROR.

These lookups do not need the module's own toolchain, so pin them to
GOTOOLCHAIN=local.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hrak
hrak merged commit edb8578 into develop Aug 27, 2026
3 checks passed
@hrak
hrak deleted the go_1_26 branch August 27, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants