Skip to content

fix(ci): unbreak the golangci-lint benchmark row - #3773

Merged
KuSh merged 4 commits into
rtk-ai:developfrom
KuSh:fix/golangci-lint-benchmark
Sep 4, 2026
Merged

KuSh merged 4 commits into
rtk-ai:developfrom
KuSh:fix/golangci-lint-benchmark

Conversation

@KuSh

@KuSh KuSh commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

The benchmark job 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 run 32325235750, first red 32343365031).

Cause

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.

Under Go 1.27 that 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 — 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 /v2 path alone does not fix CI. On the old fixture a working golangci-lint prints 0 issues. (3 tokens) while rtk prints golangci-lint: No issues found (8), which scores NEG and 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 SKIP for as long as it was green, so this row has never actually exercised the filter.

Measured in golang:1.27 against v2.13.2, on 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.

Also here

  • The synthetic golangci_v2_json.txt fixture 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 with estimate_tokens, which puts the real figure at 95.3%.
  • parse_major_version required a bare integer, so a version reported as v2.13.2 fell through to the v1 fallback and rtk would send v2 --out-format=json, a flag v2 removed. 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. 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.

KuSh and others added 4 commits August 30, 2026 14:58
`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]>
@aeppling

aeppling commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Hey @KuSh , ci green and implementation is correct, thanks :)

@KuSh
KuSh merged commit 84f629d into rtk-ai:develop Sep 4, 2026
10 checks passed
@KuSh
KuSh deleted the fix/golangci-lint-benchmark branch September 4, 2026 16:50
@rtk-release-bot rtk-release-bot Bot mentioned this pull request Sep 4, 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.

2 participants