fix(foreman): gate Job downloads the go.mod toolchain (GOTOOLCHAIN=auto)#1019
Merged
Merged
Conversation
The clean-room gate Job runs on golang:1.26 with GOTOOLCHAIN=local (baked into the official image). After go.mod's toolchain floor rose to go>=1.26.5 (defilantech#1016), the node's IfNotPresent-cached golang:1.26 (1.26.4) could no longer satisfy it, so make fmt/vet/lint failed for every change with "go.mod requires go >= 1.26.5 (running go 1.26.4; GOTOOLCHAIN=local)" -- blocking every coder GO, including an examples-only diff. Set GOTOOLCHAIN=auto in the gate env so the gate downloads whatever toolchain go.mod requires into the persistent GOMODCACHE PVC (one-time per version). Immune to future go.mod patch bumps; no base-image chasing. Fixes defilantech#1018 Signed-off-by: Christopher Maher <chris@mahercode.io>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Set
GOTOOLCHAIN=autoin the clean-room gate Job env (gate_job_template.yaml).Why
The gate runs
make fmt/vet/lintongolang:1.26, which bakesGOTOOLCHAIN=local. After thego.modtoolchain floor rose togo >= 1.26.5(#1016, GO-2026-5856), the gate node'sIfNotPresent-cachedgolang:1.26(1.26.4) could no longer satisfy it, so every gate check failed:This blocked every coder GO at the gate, regardless of the change — an examples-only diff (#699) GATE-FAILed identically because the gate runs
go fmt ./...over the whole module.How
GOTOOLCHAIN=autolets the gate download whatever toolchaingo.modrequires into the existing persistentGOMODCACHEPVC (one-time per version). The Job already has egress (it downloads golangci-lint). This is immune to futurego.modpatch bumps and needs no base-image chasing.Testing
go build+go test ./pkg/foreman/agent/tools/...(gate template render) pass.0.9.1-main.gaa969ed(logTail showed the toolchain refusal on an examples-only change).Checklist
GOMODCACHEPVC (no new persistence)Fixes #1018
Assisted-by: Claude Code (root-caused the gate toolchain failure from lab logs and wrote the fix; human-reviewed and DCO-signed by the maintainer)