chore(ci): modernize GitHub Actions + migrate golangci-lint to v2 (fixes the go1.25 lint)#24
Merged
Merged
Conversation
Bump five GitHub Actions to the versions requested by the open dependabot PRs, and migrate the golangci-lint config to v2 format, which is the fix for the red "Build & Test > Lint" step. Action bumps (across build-and-release.yml, docs.yml, security.yml): - actions/checkout v4 -> v6 - actions/setup-go v5 -> v6 - golangci/golangci-lint-action v6 -> v9 - goreleaser/goreleaser-action v5 -> v7 - actions/deploy-pages v4 -> v5 The Lint step failed on every PR with "the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.0)". go.mod targets go 1.25.0; golangci-lint v1 (built with go1.24) refuses to lint it. golangci-lint v2 is built with go1.25 and reads a v2-format config, so the action bump to v9 plus a .golangci.yml v2 migration are both required. The .golangci.yml was converted with `golangci-lint migrate`, which preserves the v1 linter intent (errcheck, govet, staticcheck with gosimple folded in, unused, ineffassign, misspell, gocritic, revive, plus bodyclose, gosec, noctx and the gofmt formatter). One real finding was fixed: a dead no-op loop in trend_test.go (staticcheck SA4017). gofmt alignment was applied tree-wide. The remaining pre-existing findings, which were never enforced because the v1 lint never ran green, are scoped with commented exclusions and listed in the PR for a follow-up cleanup. Supersedes the five action-bump dependabot PRs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 17, 2026
setup-go v6 sets GOTOOLCHAIN=local, so the pinned go-version 1.23 no longer auto-upgrades to the 1.25 the module requires, and the Download dependencies step fails with 'go.mod requires go >= 1.25.0 (running go 1.23.12; GOTOOLCHAIN=local)'. Pin the CI Go to 1.25 so build + lint run on the module's target version. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kamir
added a commit
that referenced
this pull request
Jun 17, 2026
Follow-up to #24. CI used golangci-lint version: latest, which drifted to a newer release whose gosec G703 (path-traversal) + G704 (SSRF) taint rules fail on patterns kshark guards at runtime (file reads in diff.go/util.go; the SSRF-checked httpGet in validate_blueprint.go). #24 validated v2.6.0 locally as green; pin CI to v2.6.0 so it matches. Bump deliberately + re-validate. Only golangci-lint is pinned; goreleaser stays latest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kamir
added a commit
that referenced
this pull request
Jun 17, 2026
Follow-up to #24. CI used golangci-lint version: latest, which drifted to a newer release whose gosec G703 (path-traversal) + G704 (SSRF) taint rules fail on patterns kshark guards at runtime (file reads in diff.go/util.go; the SSRF-checked httpGet in validate_blueprint.go). #24 validated v2.6.0 locally as green; pin CI to v2.6.0 so it matches. Bump deliberately + re-validate. Only golangci-lint is pinned; goreleaser stays latest. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
One PR that modernizes CI for kshark-core: bump five GitHub Actions and migrate the golangci-lint config to v2, which is the actual fix for the red
Build & Test > Lintstep.Action bumps
Applied across
.github/workflows/build-and-release.yml,docs.yml,security.yml(only theuses:version pins changed, no workflow restructuring):actions/checkoutgoreleaser/goreleaser-actiongolangci/golangci-lint-actionactions/setup-goactions/deploy-pagesThese five dependabot PRs each touched the same shared workflow files and would cascade-conflict if merged one-by-one, so they are rolled into this PR. It supersedes #15, #13, #12, #11, #10.
golangci-lint v2 migration (the lint fix)
The Lint step failed on every PR with:
go.modtargetsgo 1.25.0. golangci-lint v1 (last release v1.64.8, built with go1.24) refuses to lint a module that targets go1.25. golangci-lint v2 is built with go1.25 and reads a v2-format config, so the fix is both thegolangci-lint-action@v9bump above and a.golangci.ymlmigration from v1 to v2 format (v2 will not read the v1 config)..golangci.ymlwas converted with the official migrator (golangci-lint migrate), which preserves the v1 linter intent. In v2 the default set already includes errcheck, govet, staticcheck, unused and ineffassign, so only the additional v1 linters are listed underenable. Net enabled set matches v1: errcheck, govet, staticcheck (gosimple folded in, typecheck dropped as a config entry), unused, ineffassign, misspell, gocritic, revive, plus bodyclose, gosec, noctx, and the gofmt formatter. No new linters were added and no linter was disabled wholesale.Verified locally with golangci-lint v2.6.0 (built with go1.25.3):
golangci-lint config verify-> valid v2 config.golangci-lint run ./...-> exits 0. The go1.24 < go1.25 error is gone and the config loads.Findings handled vs deferred
The v1 lint step never ran green in CI (it always died on the go-version error), so v2 surfaced a batch of pre-existing findings on
main. Handled in this PR:trend_test.go(atime.Beforecomparison whose result was discarded in an emptyifbody).Deferred to a follow-up code cleanup, scoped with commented exclusions in
.golangci.yml(per linter/rule, not by disabling linters):io.Copy/SetReadDeadline/SetWriteDeadline/fmt.Sscanf/ReadStringon probe and bundle paths, and the usual setup/teardown calls in_test.go.net/tls/execcalls without a context, inherent to the probe paths of a diagnostic CLI; plus_test.go.These are tracked as a follow-up; the exclusions keep the v1 linter set enabled and let lint pass on the existing code without mass-suppression.
Verification
golangci-lint run ./...-> 0 issues (v2 config, go1.25 toolchain).go build ./...-> ok.go vet ./...-> ok.go test ./... -race-> all packages pass.gofmt -l-> clean.