Unbreak the lint job under Go 1.27 - #237
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR updates the Go and golangci-lint versions. It adjusts linter compatibility settings and exclusions. It also removes an obsolete lint suppression. ChangesLint and toolchain alignment
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The lint workflow updates golangci-lint to restore compatibility with the required Go toolchain. No current merge-readiness risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
golangci-lint v2.12.2 is built with go1.26 and panics while typechecking the Go 1.27 standard library: panic: file requires newer Go version go1.27 (application built with go1.26) The workflow installs `stable`, which now resolves to 1.27.1, so the job fails before it reaches any of this repository's code. Bump the pin to v2.13.2, which is built with go1.27. That version renames one linter and surfaces two issues the old one did not: - exhaustruct ships its v5 rewrite under a new name, and only the new name matches from v2.13 on, so the existing disable entry silently stopped applying. List both, the way gomodguard already is. - The goconst half of the nolint directive on replaceSemanticPaths no longer suppresses anything. Drop it, keep the gochecknoglobals half. - pkg/engine/helm carries upstream's canonical-import-path comment, which Go ignores in module mode. Exclude the package from modernize rather than editing a file whose whole point is staying close to upstream. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
CI already builds and tests with `stable`, which resolves to 1.27.1, so the go directive was the last thing still naming 1.26. Building from source now needs a 1.27 toolchain. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
b37a9d6 to
a6e7dc9
Compare
myasnikovdaniil
left a comment
There was a problem hiding this comment.
APPROVE. I checked the diff and CI results for this commit. Lint and tests pass on Linux and Windows, and the Go 1.27.1 build requirement is documented.
The
lintjob fails on every run:go-version: stablenow resolves to Go 1.27.1, and the pinned golangci-lint v2.12.2 is built with go1.26, so it dies while typechecking the standard library, before it reaches any code in this repository. The last greenpr.ymlrun was 2026-08-04; nothing triggered the workflow between then and Go 1.27 becoming stable, so this went unnoticed.Bumping the pin to v2.13.2 clears the panic and turns up three things:
exhaustructis disabled in.golangci.yml, but v2.13 ships the v5 rewrite underexhaustruct_v5and matches only the new name, so the entry silently stopped applying and 50 findings appeared. Both names are listed now, the waygomodguardalready handles the same situation.goconsthalf of the nolint directive onreplaceSemanticPathsno longer suppresses anything, so it is gone.pkg/engine/helm/doc.gocarries upstream's canonical-import-path comment, which Go ignores in module mode. The package is excluded frommodernizerather than edited, since staying close to upstream is the point of that copy.The second commit moves the
godirective to 1.27.1, which is what CI has been building and testing with anyway. Building from source now needs a 1.27 toolchain.Worth merging before #235, which is blocked by the same red job.
Summary by CodeRabbit