Skip to content

ci(e2e): run the conformance jobs on the repository's Go pin (#1283) - #1294

Merged
bpalermo merged 1 commit into
mainfrom
upgrade/e2e-pinned-go
Oct 6, 2026
Merged

bpalermo merged 1 commit into
mainfrom
upgrade/e2e-pinned-go

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Bottom of a two-PR stack: this PR, then the composite-action refactor (#1286) on top.

Problem

gateway-http and mesh-http in e2e.yaml ran go install sigs.k8s.io/[email protected] and go test on whatever Go the runner image carried. Nothing tied that Go to the repository's pin, so a runner image update silently changed the toolchain the conformance suites were built with.

Other jobs: I checked every workflow, every composite action and every script they call. These two jobs were the only places a bare go runs. Everything else uses Bazel's SDK: bazel run @rules_go//go (deps-audit, go get) or rules_go builds.

Which pin is authoritative

MODULE.bazel go_sdk.download(version = "1.27.1"). It is the SDK rules_go downloads, and it builds and tests everything Bazel ships. scripts/go-deps-audit.sh already treats it that way and calls go.mod's go line a language floor. go.mod's go 1.27.1 matches it today, with no toolchain line. A workflow cannot read MODULE.bazel, so setup-go reads go.mod (go-version-file: go.mod), and the new test keeps the two files equal.

Change

  • Both jobs get actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with go-version-file: go.mod and cache: false. The cache is off because the suite builds from the gateway-api checkout, which this repository's go.sum does not describe; that also keeps it out of the repository-cache quota. setup-go v7 exports GOTOOLCHAIN=local (src/main.ts setGoToolchain). As a result, neither gateway-api v1.6.2's nor cloud-provider-kind v0.12.0's go.mod (both go 1.26.0) can switch to a downloaded toolchain.
  • //e2e:go_pin_test is a new sibling of kind_pin_test and is hermetic: it reads only MODULE.bazel, go.mod, the workflows and the composite actions. It fails when:
    1. go.mod's effective version is not a full X.Y.Z equal to go_sdk.download. A toolchain goX.Y.Z line counts first, because setup-go prefers it; otherwise the go line.
    2. an actions/setup-go step is not SHA-pinned, does not read go-version-file: go.mod, sets a literal go-version, or sets check-latest: true.
    3. a workflow job or composite action runs go <cmd> without a setup-go step before its first such command.
  • //:MODULE.bazel and //:go.mod are exported to //e2e. Runbook section "Bumping Go".

Proof

Before the workflow change, on unchanged main workflows:

pin: go_sdk.download 1.27.1; go.mod go directive 1.27.1
checked 0 actions/setup-go step(s)
FAIL: .github/workflows/e2e.yaml:163: gateway-http runs go with the runner's preinstalled toolchain; add actions/setup-go with go-version-file: go.mod before it
FAIL: .github/workflows/e2e.yaml:405: mesh-http runs go with the runner's preinstalled toolchain; add actions/setup-go with go-version-file: go.mod before it

Every check driven red once, one break per run, then restored:

=== gomod-differs-from-sdk:   FAIL: go.mod: go directive '1.27.0' != MODULE.bazel go_sdk.download '1.27.1' (setup-go installs the go.mod version; bump both together)
=== gomod-no-patch:           FAIL: go.mod: go directive '1.27' is not X.Y.Z (setup-go would resolve the newest matching release, not the pin)
=== gomod-toolchain-differs:  FAIL: go.mod: toolchain directive '1.27.2' != MODULE.bazel go_sdk.download '1.27.1' (...)
=== sdk-bumped-alone:         FAIL: go.mod: go directive '1.27.1' != MODULE.bazel go_sdk.download '1.27.0' (...)
=== literal-go-version:       FAIL: .github/workflows/e2e.yaml:137: setup-go must read 'go-version-file: go.mod' (got '<unset>')
                              FAIL: .github/workflows/e2e.yaml:137: setup-go sets 'go-version: 1.27'; use go-version-file: go.mod ...
=== check-latest:             FAIL: .github/workflows/e2e.yaml:137: setup-go 'check-latest: true' resolves past the pin
=== tag-not-sha:              FAIL: .github/workflows/e2e.yaml:137: actions/setup-go@v7 is not pinned to a full commit SHA
=== setup-go-after-go:        FAIL: .github/workflows/e2e.yaml:169: gateway-http runs go before its actions/setup-go step (line 298)
=== setup-go-removed:         FAIL: .github/workflows/e2e.yaml:169: gateway-http runs go with the runner's preinstalled toolchain; ...
                              FAIL: .github/workflows/e2e.yaml:417: mesh-http runs go with the runner's preinstalled toolchain; ...

All of these pass locally:

  • make actionlint: clean.
  • bazel test //e2e/... //bazel/...: 12/12.
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...
  • make format-check

The nightly dispatch is reported on the top PR of the stack, which carries the same Go setup inside run-conformance.

Closes #1283

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

@bpalermo
bpalermo added this pull request to stack #1296 October 5, 2026 23:56
@bpalermo
bpalermo force-pushed the upgrade/e2e-pinned-go branch 2 times, most recently from eadd249 to a71a701 Compare October 6, 2026 00:42
`gateway-http` and `mesh-http` ran `go install sigs.k8s.io/cloud-provider-kind`
and `go test` on whatever Go the runner image carried; a runner image
update silently changed the toolchain the conformance suites built with.
They were the only CI steps running a bare `go`: everything else goes
through Bazel's SDK (`bazel run @rules_go//go`).

- Both jobs set Go up with actions/setup-go v7.0.0 (SHA-pinned),
  `go-version-file: go.mod`, cache off. setup-go also exports
  GOTOOLCHAIN=local, so neither gateway-api's nor cloud-provider-kind's
  go.mod (both `go 1.26.0`) can switch to a downloaded toolchain.
- Authoritative pin: MODULE.bazel `go_sdk.download` (the SDK that builds
  and tests everything Bazel ships; scripts/go-deps-audit.sh already treats
  it that way). go.mod's `go 1.27.1` equals it today, and setup-go reads
  go.mod, so the new //e2e:go_pin_test keeps the two equal.
- //e2e:go_pin_test (a sibling of kind_pin_test). It fails when go.mod's
  effective version (a `toolchain` line, which setup-go prefers, else the
  `go` line) is not a full X.Y.Z equal to go_sdk.download. It fails when a
  setup-go step is not SHA-pinned, does not read go.mod, sets a literal
  `go-version`, or sets `check-latest: true`. It fails when a workflow job
  or composite action runs `go <cmd>` without a setup-go step before it.
  Every check was seen red on a deliberate drift.
- Runbook: "Bumping Go".

Closes #1283

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo force-pushed the upgrade/e2e-pinned-go branch from a71a701 to 8556721 Compare October 6, 2026 01:04
@bpalermo
bpalermo merged commit 330dba1 into main Oct 6, 2026
25 checks passed
@bpalermo
bpalermo deleted the upgrade/e2e-pinned-go branch October 6, 2026 01:21
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.

ci: e2e conformance jobs use the runner's preinstalled Go (no pinned toolchain)

1 participant