Skip to content

Unbreak the lint job under Go 1.27 - #237

Merged
myasnikovdaniil merged 2 commits into
mainfrom
fix/ci-lint-go127
Sep 7, 2026
Merged

myasnikovdaniil merged 2 commits into
mainfrom
fix/ci-lint-go127

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

The lint job fails on every run:

panic: file requires newer Go version go1.27 (application built with go1.26)

go-version: stable now 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 green pr.yml run 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:

  • exhaustruct is disabled in .golangci.yml, but v2.13 ships the v5 rewrite under exhaustruct_v5 and matches only the new name, so the entry silently stopped applying and 50 findings appeared. Both names are listed now, the way gomodguard already handles the same situation.
  • The goconst half of the nolint directive on replaceSemanticPaths no longer suppresses anything, so it is gone.
  • pkg/engine/helm/doc.go carries upstream's canonical-import-path comment, which Go ignores in module mode. The package is excluded from modernize rather than edited, since staying close to upstream is the point of that copy.

The second commit moves the go directive 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

  • Chores
    • Updated the Go toolchain language version.
    • Updated the linting workflow to use a newer patch release.
    • Refined linting rules and exclusions to improve compatibility with maintained upstream code.
  • Refactor
    • Simplified an internal lint directive without changing runtime behavior.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 613ee01a-5370-46e7-b9d7-aa3fd88e308e

📥 Commits

Reviewing files that changed from the base of the PR and between 7d48e60 and a6e7dc9.

📒 Files selected for processing (4)
  • .github/workflows/pr.yml
  • .golangci.yml
  • go.mod
  • pkg/engine/engine.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • go.mod
  • pkg/engine/engine.go
  • .golangci.yml

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR updates the Go and golangci-lint versions. It adjusts linter compatibility settings and exclusions. It also removes an obsolete lint suppression.

Changes

Lint and toolchain alignment

Layer / File(s) Summary
Toolchain and linter versions
go.mod, .github/workflows/pr.yml
The module requires Go 1.27.1. The PR workflow uses golangci-lint v2.13.2.
Linter compatibility and exclusions
.golangci.yml, pkg/engine/engine.go
The configuration disables both exhaustruct generations, excludes modernize for copied Helm code, and removes the goconst suppression from replaceSemanticPaths.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to a6e7d

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: restoring lint job compatibility with Go 1.27.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-lint-go127

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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>

@myasnikovdaniil myasnikovdaniil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@myasnikovdaniil
myasnikovdaniil merged commit 1d571ba into main Sep 7, 2026
8 checks passed
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