ci: disable golangci-lint cache to avoid stale-cache lint failures#5488
Open
martinconic wants to merge 1 commit into
Open
ci: disable golangci-lint cache to avoid stale-cache lint failures#5488martinconic wants to merge 1 commit into
martinconic wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-actioncache (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(thecreateWindowsEventLoggerSA4023),pkg/manifest/mantaray/marshal_test.go, andpkg/p2p/libp2p/mock/mock_certmagic_test.go— none of which were touched by that PR (its diff was limited tostart.go+resolve_node_mode_test.go).Diagnosis on #5431:
go.mod, including Go 1.26.3) reported 0 issues.Cache hit for: golangci-lint.cache-Linux-....This sets
skip-cache: trueso 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.