Repository navigation
fix(ci): unbreak the golangci-lint benchmark row - #3773
Merged
Merged
Conversation
`go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest` resolves on the unversioned module path, which stops at v1.64.8 (March 2025, the last v1). v2 is published under /v2, so `@latest` never moved. Since runners picked up Go 1.27, that pinned v1.64.8 fails before it lints anything -- its vendored go/types rejects the newer export data: could not load export data: internal error in importing "internal/goarch" (export data version 4 is greater than maximum supported version 2) It writes 628 bytes to stderr, leaves stdout empty and exits 3, which is the 157-token benchmark row that turns the job red. Reproduced in golang:1.27 and verified there: the /v2 path installs v2.13.2 and lints the benchmark fixture cleanly. `@latest` is kept deliberately -- the /v2 in the path is what carries the fix, and a future major would publish under /v3 rather than being picked up silently. This is also the only configuration in which RTK's v2 output branch is exercised at all. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The golangci-lint row has never measured the filter. The fixture is clean Go, so golangci-lint prints an empty report, the raw side counts zero tokens and the row scores as skipped whatever rtk does -- it read 0 -> 8 for as long as it was green. Adds five functions that ignore returned errors, which errcheck reports. Verified in golang:1.27 against golangci-lint v2.13.2, running the fixture exactly as it appears here: golangci-lint 220 -> 35 GOOD (84%) go test 30 -> 8 GOOD (73%) unchanged go build 0 -> 0 SKIP unchanged go vet 0 -> 0 SKIP unchanged go build, go vet and go test stay clean, so the neighbouring rows keep measuring what they measured before. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…xture golangci_v2_json.txt is pretty-printed across 144 lines; golangci-lint emits its JSON on a single line, so the fixture was a shape real output never takes. The savings assertion counted whitespace-separated words, so the indentation was doing the work -- against real single-line output that same helper reads 40 "words" for 4 KB and reports 30% for a filter that is doing its job. Measured with estimate_tokens, the estimator RTK bills with, the real figure is 95.3%. Replaced with output captured from golangci-lint in golang:1.27: a clean v2.13.2 report, a v2.13.2 report carrying 3 errcheck and 3 ineffassign findings, and the 628 bytes v1.64.8 writes to stderr when its vendored go/types cannot read Go 1.27 export data. That last one backs a test the suite had no equivalent of: whatever the filter is handed -- empty, whitespace, error text, truncated JSON, v1 or v2 -- it must say something. Returning an empty string is what let `rtk golangci-lint run` print nothing at all. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`parse_major_version` required the major number to parse as a bare integer, so a version reported as `v2.13.2` fell through to the v1 fallback. RTK would then send v2 `--out-format=json`, a flag v2 removed, and the run would die on an unknown flag instead of linting. The prefix is not stable across builds: a `go install` of v1.64.8 reports `has version v1.64.8` while the same build of v2.13.2 reports `has version 2.13.2`, so neither spelling can be assumed. Today's CI install happens to take the unprefixed form and detects correctly -- this closes the case that does not. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
KuSh
force-pushed
the
fix/golangci-lint-benchmark
branch
from
August 30, 2026 13:06
c54cf90 to
c730255
Compare
Contributor
|
Hey @KuSh , ci green and implementation is correct, thanks :) |
aeppling
approved these changes
Sep 4, 2026
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.
The
benchmarkjob has been the only failing CI job since 2026-08-20. Nothing in the repo changed — GitHub runners moved from go1.26.6 to go1.27.0 in a 4h42m window (last green run32325235750, first red32343365031).Cause
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latestresolves on the unversioned module path, which stops at v1.64.8 (March 2025, the last v1). v2 is published under/v2, so@latestnever moved.Under Go 1.27 that v1.64.8 fails before it lints anything — its vendored
go/typesrejects the newer export data:It writes 628 bytes to stderr, leaves stdout empty and exits 3 — the 157-token row that reddens the job. Reproduced byte-for-byte in
golang:1.27.Why these four commits ship together
Switching to the
/v2path alone does not fix CI. On the old fixture a working golangci-lint prints0 issues.(3 tokens) while rtk printsgolangci-lint: No issues found(8), which scoresNEGand still exits 1. Verified in Docker both symmetrically and asymmetrically.The fixture has to have findings for the row to measure anything. It never did — it read
0 -> 8 SKIPfor as long as it was green, so this row has never actually exercised the filter.Measured in
golang:1.27against v2.13.2, on the fixture exactly as it appears here:go build,go vetandgo teststay clean, so the neighbouring rows keep measuring what they measured before.Also here
golangci_v2_json.txtfixture is pretty-printed across 144 lines; golangci-lint emits its JSON on a single line. Its savings assertion counted whitespace-separated words, so indentation was doing the work — against real single-line output the same helper reads 40 "words" for 4 KB and reports 30% for a filter that is doing its job. Replaced with output captured from v2.13.2 and measured withestimate_tokens, which puts the real figure at 95.3%.parse_major_versionrequired a bare integer, so a version reported asv2.13.2fell through to the v1 fallback and rtk would send v2--out-format=json, a flag v2 removed. The prefix is not stable across builds: ago installof v1.64.8 reportshas version v1.64.8while the same build of v2.13.2 reportshas version 2.13.2. Today's install takes the unprefixed form and detects correctly; this closes the case that does not.cargo test --all: 2925 passing. fmt clean, 0 clippy warnings.