Skip to content

CI fails when a plugin module or workflow disagrees with the root go.mod's Go toolchain - #3021

Open
Grant McCloskey (MushuEE) wants to merge 1 commit into
agent-substrate:mainfrom
MushuEE:build/verify-go-toolchain
Open

Grant McCloskey (MushuEE) wants to merge 1 commit into
agent-substrate:mainfrom
MushuEE:build/verify-go-toolchain

Conversation

@MushuEE

@MushuEE Grant McCloskey (MushuEE) commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

The toolchain directive in the root go.mod pins the Go release that builds what we ship. Plugin modules ship too, and CI sets up Go from go.mod, but nothing checked that they agree. A plugin left on an older toolchain, or a workflow that hard-codes a Go version, would pass CI and build or test with a Go other than the patched one. This is phase 1 of the plan in #3013. Phase 2 is a Renovate config that keeps the pin current.

hack/verify/go-toolchain.sh runs as part of hack/verify-all.sh. It fails when:

  • the root go.mod has no toolchain directive naming a full release, such as go1.27.3
  • a module under internal/plugins/ has a different toolchain line or none. The error includes the go mod edit -toolchain=... command that fixes it.
  • a workflow sets a Go version directly, or reads it from anything other than a go.mod

It does not check the dev-time tools under hack/tools/ and tools/, or the benchmarking Dockerfiles. They don't ship, they need no security patches, and some tools may not build on a newer Go.

Part of #3013

AI use: Yes, written with Claude Code.

  • Tests pass: the check passes on main. Each rule was broken on purpose (partial and missing root pin, plugin pin different and missing, workflow literal version and non-go.mod file), and each made it fail. Changing the hack/tools and tools/ pins still passes. shellcheck 0.9.0 and the license-header check are clean.
  • Docs updated: not needed. The script documents itself, and its errors say how to fix each failure.

@MushuEE
Grant McCloskey (MushuEE) marked this pull request as draft October 20, 2026 22:43
The toolchain directive in the root go.mod pins the Go release that builds
what we ship. Plugin modules ship too, and CI sets up Go from go.mod, but
nothing checked that they agree. A plugin left on an older toolchain, or a
workflow that hard-codes a Go version, would pass CI and build or test
with a Go other than the patched one.

hack/verify/go-toolchain.sh fails when the root go.mod has no full-release
toolchain directive, when a module under internal/plugins has a different
or missing one, or when a workflow takes its Go version from anything but
a go.mod. Dev-time tools under hack/tools and tools/ are not checked: they
need no security patches and may not build on a newer Go.
@MushuEE Grant McCloskey (MushuEE) changed the title CI fails when a Go toolchain pin disagrees with the root go.mod CI fails when a plugin module or workflow disagrees with the root go.mod's Go toolchain Oct 20, 2026
@MushuEE
Grant McCloskey (MushuEE) marked this pull request as ready for review October 20, 2026 22:48
@MushuEE

Copy link
Copy Markdown
Collaborator Author

Drafted #3025 which stages the Renovate config. Will need repo owner to add the app though. Verified the free tier should work fine. It will expose us to some but very minimal availability risk that Mend goes down.

Quentin Bisson (QuentinBisson) added a commit to giantswarm/substrate that referenced this pull request Oct 23, 2026
agent-substrate#2984 added toolchain go1.27.3 to every module, so
the Go pin commit of require-golang-org-x-net-v0-61 and pin-go-1-27-3 are
class 2 and drop at the re-pin onto a commit containing 3c9a3cd. The one-line
toolchain pull request drafted on 2026-10-20 is withdrawn; upstream's own
automation is agent-substrate#3013 (agent-substrate#3021, agent-substrate#3025).
@bowei Bowei Du (bowei) added area/dev-infra kind/feature An enhancement / feature request or implementation labels Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dev-infra kind/feature An enhancement / feature request or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants