Repository navigation
fix(tests-runner): install go.mod's toolchain release, resolved in the Go job - #309
Merged
Merged
Conversation
…e Go job tests-runner.yml had the go-line-only resolver coverage-floor.yml had, so a repo pinning `toolchain go1.26.10` over `go 1.26.1` would run its Go tests on go1.26.1: setup-go exports GOTOOLCHAIN=local, which skips the toolchain line. No fleet repo calls this reusable with Go yet. Port coverage-floor's resolver (#308): the newer of the toolchain pin and the go line, compared in Go's order; comments and CR stripped; release candidates in setup-go's spelling; a toolchain line that names no Go release fails. It runs in run-go, just before setup-go, not in detect: a failure in detect would skip run-go, and a skipped required check passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Risk class: This PR touches one of the blocked path categories from Auto-merge is refused by (This is a policy notice, not a code-quality failure. The classify job itself does not fail — required CI checks remain authoritative for "is the code green.") |
|
The review is complete. The logic is sound:
No issues found. Fix is correct, well-scoped, and pinned by a self-test that will catch future drift. Claude Review · workflow run |
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 was wrong
tests-runner.yml'sdetectjob resolved the Go version the same waycoverage-floor.ymldid. It read only go.mod'sgodirective and gave it toactions/setup-go, which then exportsGOTOOLCHAIN=local, sogoskips go.mod'stoolchainline. A Go repo that pins a patched toolchain would run its tests on the unpatched floor, green and with no warning.Reproduced against this branch's base: on techrecon's go.mod (
go 1.26.1+toolchain go1.26.10), the shippeddetectstep outputsgo_version=1.26.1. #308 fixes the same code in coverage-floor.yml, where it measured techrecon's coverage on go1.26.1. This PR ports that fix.The fix
go_versioninput wins, used as given.toolchain goVpin and thegoline, compared in Go's order (1.27rc2 < 1.27.0).//comments and CR are stripped first.1.27.0-rc.2, the only spelling setup-go matches.::error::quoting the line.toolchain default, or no toolchain line, installs thegoline; no go.mod installs1.23.run-go, in a new step between checkout and setup-go, not indetect. If the step failed indetect,run-gowould be skipped throughneeds, and a skipped required check passes. Today a line liketoolchain bananareachesgo test, which rejects go.mod and turns the Go check red. Failing indetectwould make that a skip. Inrun-go, the failure lands on the Go check itself.detectloses itsgo_versionoutput, itsINPUT_GO_VERSIONenv and its go.mod read. Nothing else consumed them:run-gowas the only reader, andworkflow_callexposes no outputs.go_versioninput's description now states the default.The resolver is copied, not shared. A shared action would have to be pinned by SHA and land in a separate merge first, as
pinned-gate-testsis. If #308 changes in review, keep the two copies in step.Fleet repos whose behavior changes
None.
tests-runner.yml. That comes from a tree survey of all 145 non-archived repos intopcoder1andwhois-api-llc.run-gonever runs, anddetectonly drops an output they cannot read.Tests
selftest/test_tests_runner_go_version.pyruns the shipped resolver step, in its working directory, against hand-written go.mod files. Every expected version is a literal. It has 22 cases:1.26.10,go1.26.10x,banana.// toolchain, a misspelledtoolchianand arequire …/toolchainpath must not move the version. A positive control through the same harness then finds a real directive.run-go, after checkout and before setup-go.inputs.working_directoryandinputs.go_version.Results:
main: 22 failed, becauserun-gohas no resolver step. The olddetectstep separately reproduced1.26.1on techrecon's go.mod./bin/bash3.2, and with GNUsortfirst on PATH.detect's old output, noworking-directory,go_versionnot wired, the resolver moved after setup-go, and the resolver moved back intodetect.test_tests_runner_pinned_gates.py, which drivesdetect, still passes (24 tests).detect.2c49b0c: 1302 passed, 1 skipped, in 9m56s. The skip is environmental and predates this change.Auto-merge rationale: manual merge. PRs to topcoder1/ci-workflows are always click-merged, and this changes a reusable that fleet repos call for their required test lanes.
Codex rounds: 2, run in parallel on
2c49b0c. Both were clean. The resolver itself already went through 8 rounds on #308.An independent code-reviewer agent approved
2c49b0cwith no finding over the bar:needs.detect.outputs.go_versionremains, and actionlint would flag a dangling one.🤖 Generated with Claude Code