Skip to content

Pin golangci-lint to avoid nilness panic on main - #6393

Merged
samuv merged 2 commits into
mainfrom
t3code/fix-nilness-linter-panic
Aug 20, 2026
Merged

Pin golangci-lint to avoid nilness panic on main#6393
samuv merged 2 commits into
mainfrom
t3code/fix-nilness-linter-panic

Conversation

@samuv

@samuv samuv commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

CI on main is failing: golangci-lint panics during the staticcheck /
nilness fact analysis with internal error: unhandled builtin recover
while analyzing github.com/getsentry/sentry-go (a dependency of
pkg/sentry). See the failing run:
https://github.com/stacklok/toolhive/actions/runs/32346960123/job/96357620328

Root cause: .github/workflows/lint.yml used to pin
golangci-lint-action's version input (v2.0.1), but that pin was
silently dropped when the action was bumped to v8.0.0. Since then, CI
floats to golangci-lint's latest release. v2.13.0 (released
2026-08-19) bundles a release-candidate build of staticcheck
(honnef.co/go/tools@v0.8.0-rc.1), which crashes on this codebase.
This is an upstream bug — pkg/sentry/sentry.go itself never calls
recover().

  • Pin golangci-lint-action's version input back to v2.12.2, the
    last stable release before the regression, until upstream ships a
    fix.

Fixes #

Type of change

  • Bug fix

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

Confirmed via gh release list that v2.12.2 (2026-05-06) predates
the v2.13.0 (2026-08-19) release that introduced the staticcheck RC
dependency, and that this repo has no replace directive affecting
github.com/getsentry/sentry-go. This is a CI-only config change;
correctness will be confirmed by this PR's own lint job running
against the pinned version.

Special notes for reviewers

Once golangci-lint ships a release with a fixed honnef.co/go/tools
version, the version: v2.12.2 pin (and its explanatory comment)
should be removed so CI floats to latest again.

Generated with Claude Code

golangci-lint v2.13.0 bundles honnef.co/go/tools v0.8.0-rc.1, whose
nilness fact analyzer panics with "unhandled builtin recover" while
analyzing github.com/getsentry/sentry-go, breaking CI on main. Pin to
the last known-good release until upstream ships a fix.

Signed-off-by: Samuele Verzi <samu@stacklok.com>
@samuv
samuv requested a review from JAORMX as a code owner August 20, 2026 08:25
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Aug 20, 2026
rdimitrov
rdimitrov previously approved these changes Aug 20, 2026
golangci-lint 2.12.2's bundled type-checker cannot parse a
generic-method signature in Go 1.27's math/rand/v2, which 'stable'
now resolves to. Run the lint job on the Go version go.mod actually
targets so the pinned golangci-lint release can type-check the stdlib.

Signed-off-by: Samuele Verzi <samu@stacklok.com>
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.73%. Comparing base (b6aa047) to head (3a9126a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6393      +/-   ##
==========================================
+ Coverage   77.66%   77.73%   +0.06%     
==========================================
  Files         748      748              
  Lines       71826    71826              
==========================================
+ Hits        55787    55836      +49     
+ Misses      16034    15985      -49     
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samuv
samuv merged commit 39a85c8 into main Aug 20, 2026
45 checks passed
@samuv
samuv deleted the t3code/fix-nilness-linter-panic branch August 20, 2026 08:51
@github-actions github-actions Bot mentioned this pull request Aug 26, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants