Skip to content

ci: bump golangci-lint to v2.14.0 - #262

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
ci/golangci-lint-v2.14
Oct 15, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
ci/golangci-lint-v2.14

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Lint is red on every pull request right now, main included. setup-go's stable moved from Go 1.27.1 to 1.27.2, and golangci-lint v2.13.2 can't read the export data Go 1.27.2 writes for the standard library:

could not load export data: internal error in importing "internal/goarch" (cannot decode "internal/goarch", export data version 5 is greater than maximum supported version 4)

I reproduced it with the v2.13.2 release binary under Go 1.27.2 on a clean main. The v2.14.0 release binary reads it and reports 0 issues, on Linux and with GOOS=windows.

The new version also adds the modernize stringscut check. It flags one strings.LastIndex in the image tag parser in pkg/commands/preflight_upgrade_verify.go, which now uses strings.CutLast. Behaviour is the same, and the existing parser tests pass.

Closes #236

Summary by CodeRabbit

  • Chores
    • Updated the linting tool version used in the project’s automated checks.
  • Refactor
    • Simplified how upgrade verification extracts the final component of a target version path.

Lint fails on every pull request since the `stable` Go of setup-go
moved from 1.27.1 to 1.27.2. golangci-lint v2.13.2 cannot read the
export data Go 1.27.2 writes for the standard library ("export data
version 5 is greater than maximum supported version 4"), so typecheck
fails on the first import of testing or bytes. v2.14.0 reads it.

v2.14.0 also adds the modernize stringscut check, which flags the one
strings.LastIndex in the image tag parser; it now uses strings.CutLast.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6158e427-f02b-453a-b1ab-e94ed0fdd5a6
📥 Commits

Reviewing files that changed from the base of the PR and between 61d9e7a and 61d9e7a.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 413fdb5c-e422-4157-94d3-ed09f201ae04
📥 Commits

Reviewing files that changed from the base of the PR and between b08c591 and 61d9e7a.

📒 Files selected for processing: 2
  • .github/workflows/pr.yml
  • pkg/commands/preflight_upgrade_verify.go

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

📝 Walkthrough

The pull request updates the golangci-lint action version in the PR workflow and changes how parseTargetVersion isolates the final path component.

Changes: Lint version update

Layer / File(s) Summary
Update lint action version
.github/workflows/pr.yml
The workflow now uses golangci-lint v2.14.0 instead of v2.13.2.

Target version parsing

Layer / File(s) Summary
Isolate the final path component
pkg/commands/preflight_upgrade_verify.go
parseTargetVersion now uses strings.CutLast instead of LastIndex and slicing. Tag parsing is unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 61d9e

The parser refactor preserves the prior behavior checked, and no material regression is identified. The PR is mergeable subject to normal checks.

Pre-merge checks: Passed 5
Passed 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 primary change: updating golangci-lint to v2.14.0.
Linked Issues check Passed Issue [#236] requires the lint pin to avoid the failures introduced by golangci-lint v2.13.2. .github/workflows/pr.yml changes the pin to v2.14.0. The PR description reports that v2.14.0 reads Go …
Out of Scope Changes check Passed The version change directly addresses issue [#236]. The strings.CutLast change supports the new modernize check from the updated linter and preserves parser behavior, according to the PR descripti…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@lexfrei
Aleksei Sviridkin (lexfrei) marked this pull request as ready for review October 15, 2026 15:54

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM.

Verified strings.CutLast (added in Go 1.27.0, available under the module's go 1.27.1) is behavior-preserving here: after equals the previous image[lastSlash+1:], and the not-found branch leaves tail = image exactly as lastSlash == -1 did. Walked the cases (no slash, registry-with-port, digest pins rejected earlier, trailing colon) and the result matches the old code. The modernize stringscut rewrite is a pure simplification.

Root cause of the red lint is correct and this is a real fix, not a workaround: setup-go stable moved to Go 1.27.2 (export data v5) and golangci-lint v2.13.2 only reads up to v4; v2.14.0 reads v5. Bumping the linter targets the actual incompatibility.

Live CI on the PR head is green for lint and test on both ubuntu and windows. The only red check is FOSSA License Compliance, which is pinned to the main branch and concerns dependency licenses; this PR changes no dependencies, so it is pre-existing and unrelated.

@lexfrei
Aleksei Sviridkin (lexfrei) added this pull request to stack #263 October 15, 2026 19:49
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit cfc5a95 into main Oct 15, 2026
9 of 10 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.

golangci-lint 2.13 fails on files 2.12.2 passes

2 participants