You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
golangci-lint upgrade to v2.11.4, related fixes (#549)
* exclude node_modules from golangci-lint
* bump golangci-lint in CI
The branch updates `.golangci.yaml` and is being linted locally with
`golangci-lint` 2.11.4, but CI was still pinned to 2.9.0. That leaves
local and CI checks evaluating different rule sets and can hide or
invent failures depending on where the lint runs.
Update the workflow pin to 2.11.4 so the GitHub Action fetches the same
linter version used locally. Keeping the versions aligned makes the
branch's lint results reproducible across environments.
* replace httptest.NewRequest in tests
Recent `golangci-lint` releases enable the `noctx` checks that now flag
plain `httptest.NewRequest` calls in our tests and shared test helpers.
Those requests were still valid, but they no longer match the context-
aware API the linter expects.
Switch the affected tests and helper code to
`httptest.NewRequestWithContext`, reusing each test's existing context
where possible and falling back to `context.Background()` in the small
helper that has no test context available. This keeps the request setup
behavior the same while satisfying the stricter lint rule.
* confine packager writes to output root
The packager writes `.mod`, `.zip`, and `.info` artifacts under a
caller-provided output directory. Those writes were assembled with
`filepath.Join` and then passed straight to file creation helpers, which
is exactly the pattern `gosec` now flags for path traversal.
Open the version output directory as an `os.Root` and perform the file
writes through that root instead. This keeps the artifact generation
behavior the same, but confines every write to the intended output
subtree even if a filename is malformed or hostile.
* suppress gosec on -healthcheck probe
`gosec` flagged the `riverui -healthcheck=...` code path because it
constructs an outbound HTTP request using deployment configuration.
That probe is an operator-invoked check of the running River UI
server's own health endpoint, and we don't treat steering it via env as
a meaningful security boundary in this context.
Keep the existing behavior and add a narrow `//nolint:gosec`
suppression on the request construction and execution lines with an
explanation of why the warning is not actionable here.
0 commit comments