Skip to content

ci: disable golangci-lint cache to avoid stale-cache lint failures#5488

Open
martinconic wants to merge 1 commit into
masterfrom
ci/golangci-skip-stale-cache
Open

ci: disable golangci-lint cache to avoid stale-cache lint failures#5488
martinconic wants to merge 1 commit into
masterfrom
ci/golangci-skip-stale-cache

Conversation

@martinconic
Copy link
Copy Markdown
Contributor

@martinconic martinconic commented Jun 3, 2026

Description

The CI Lint job intermittently fails with staticcheck errors (SA4023, SA5011) in files that are not part of the PR diff. These are phantom findings from a restored, stale golangci-lint-action cache (skip-cache: false, cache-invalidation-interval: 7).

This was reproduced and diagnosed on #5431: the Lint job failed with 8 staticcheck issues — in cmd/bee/cmd/cmd.go (the createWindowsEventLogger SA4023), pkg/manifest/mantaray/marshal_test.go, and
pkg/p2p/libp2p/mock/mock_certmagic_test.go — none of which were touched by that PR (its diff was limited to start.go + resolve_node_mode_test.go).

Diagnosis on #5431:

  • Reproducing locally with the exact CI versions (golangci-lint v2.11.3, Go from go.mod, including Go 1.26.3) reported 0 issues.
  • The failing job log showed Cache hit for: golangci-lint.cache-Linux-....
  • After deleting the cache entries and re-running, Lint passed on the same commit with no code change.

This sets skip-cache: true so the linter always runs a fresh analysis and cannot resurrect stale results. The full lint run is fast enough that the correctness trade-off is worth it.

A restored golangci-lint-action cache produced phantom staticcheck
findings (SA4023, SA5011) in files unrelated to the PR diff. Reproduced
and diagnosed on #5431: local runs with the exact CI versions reported 0
issues, the job log showed a golangci cache hit, and re-running after
deleting the cache passed on the same commit. Disable the cache so the
linter always analyzes fresh.

Refs: #5431
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.

1 participant