Add golangci-lint gate and expand audit tooling - #5633
Merged
norman-abramovitz merged 8 commits intoJul 12, 2026
Conversation
check lint and the standalone lint verb now run golangci-lint (errcheck, staticcheck, unused, ineffassign) over both Go modules, with an upfront installed-tool check. The standalone verb reuses the check.lint recipe instead of duplicating it.
- trivy: replace deprecated --security-checks vuln,config with --scanners vuln,misconfig - audit backend now also scans the nested src/jetstream/api module (gosec + govulncheck) - new opt-in modes kept off the default path: tests (gosec incl. _test.go + #nosec suppression report), tree (trivy full-tree incl. deploy/ Dockerfiles and helm chart), history (gitleaks full git history), licenses (osv-scanner license report) - ZIZMOR_FLAGS passthrough for audit actions (e.g. --persona=auditor) Bare 'make audit' still runs exactly the original five scanners.
Refresh the tool and command tables (zizmor, osv-scanner, gitleaks were undocumented) and explain why the tests/tree/history/licenses audit modes stay off the default path.
Resolve the errcheck findings surfaced by the new lint gate across plugins, datastore, repositories, crypto, and the api module: propagate where the enclosing function returns error, log where aborting would change behavior (session affinity, streaming), and explicitly acknowledge genuinely-ignorable cleanup calls. Also fixes a latent bug where analysis dbStore.Save results were silently dropped.
Two deliberate policy exclusions, both documented in the file: errcheck skips _test.go (teardown-call noise), and staticcheck ST1005 is off because jetstream error strings are user-facing surface (API responses, logs) where mass-rewording is behavioral churn. Everything else stays on.
Second errcheck sweep: echo handler results now returned to echo, logout/cleanup paths log-and-continue instead of silently dropping failures, setup prerequisites propagate, and remaining rows/Body Close teardowns are explicitly acknowledged. errcheck is now clean across both modules.
Replace deprecated io/ioutil calls, convert if/else chains to tagged switches, drop redundant conversions and comparisons, and make the CF auto-register error-discard explicit. The two CFB cipher deprecation sites carry documented suppressions: persisted tokens and client secrets are CFB-encrypted, so changing modes needs a versioned re-encryption migration, not a drop-in swap.
unused: delete 32 unreferenced symbols (~213 lines) across both modules, each verified by repo-wide search; popeyeConfig stays with a documented suppression (referenced by the parked sonobuoy file). ineffassign fixes include three real defects: shadowed errors in local-user INSERT/UPDATE made zero-row writes return success, metrics proxy handlers swallowed request-build errors and forwarded nil responses, and a failed session creation still attempted the session save. Also unmasks three test assertions that could never fail.
nabramovitz
marked this pull request as ready for review
July 12, 2026 10:00
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
make check lint(and the standalonelintverb) now run golangci-lint (errcheck, staticcheck, unused, ineffassign) over both Go modules —src/jetstreamand the nestedsrc/jetstream/api, which no scanner covered before.--security-checks vuln,configwith--scanners vuln,misconfigmake audit backendalso scans theapimodule (gosec + govulncheck)audit tests(gosec incl. test files + #nosec report),audit tree(trivy over the whole tree, covering the deploy/ Dockerfiles and helm chart),audit history(gitleaks over full git history),audit licenses(osv-scanner license report)ZIZMOR_FLAGSpassthrough foraudit actions(e.g.--persona=auditor)docs/developer-environment.mdand an explanation of why the new modes stay off the default path.Lint findings resolved
The uncapped baseline was 705 findings. Two policy exclusions are set in
src/jetstream/.golangci.ymlwith reasons in the file: errcheck skips_test.go(teardown-call noise, 289 findings), and staticcheck's ST1005 error-string style rule is off (error text is user-facing API/log surface, 230 findings). The remaining 186 were fixed:Verified with the full gate: frontend lint + 3094 unit tests + production build + all backend Go tests green.