Skip to content

fix(foreman): gate Job downloads the go.mod toolchain (GOTOOLCHAIN=auto)#1019

Merged
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:fix/gate-gotoolchain-auto
Jul 9, 2026
Merged

fix(foreman): gate Job downloads the go.mod toolchain (GOTOOLCHAIN=auto)#1019
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:fix/gate-gotoolchain-auto

Conversation

@Defilan

@Defilan Defilan commented Jul 9, 2026

Copy link
Copy Markdown
Member

What

Set GOTOOLCHAIN=auto in the clean-room gate Job env (gate_job_template.yaml).

Why

The gate runs make fmt/vet/lint on golang:1.26, which bakes GOTOOLCHAIN=local. After the go.mod toolchain floor rose to go >= 1.26.5 (#1016, GO-2026-5856), the gate node's IfNotPresent-cached golang:1.26 (1.26.4) could no longer satisfy it, so every gate check failed:

go: go.mod requires go >= 1.26.5 (running go 1.26.4; GOTOOLCHAIN=local)

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=auto lets the gate download whatever toolchain go.mod requires into the existing persistent GOMODCACHE PVC (one-time per version). The Job already has egress (it downloads golangci-lint). This is immune to future go.mod patch bumps and needs no base-image chasing.

Testing

  • go build + go test ./pkg/foreman/agent/tools/... (gate template render) pass.
  • Root-caused from a live lab gate failure on 0.9.1-main.gaa969ed (logTail showed the toolchain refusal on an examples-only change).

Checklist

  • One-line env change; no behavior change beyond toolchain resolution
  • Uses the existing GOMODCACHE PVC (no new persistence)
  • AI assistance disclosed below

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)

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>
@Defilan Defilan requested a review from joryirving July 9, 2026 07:23
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Defilan Defilan merged commit 5f4c51c into defilantech:main Jul 9, 2026
24 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 9, 2026
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.

[BUG] Foreman gate Job fails on go.mod toolchain floor (golang:1.26 + GOTOOLCHAIN=local can't satisfy go>=1.26.5)

1 participant