ci: override golangci-lint and go-mod-tidy jobs to cover v2 module
Context
The common-ci-tasks golang template provides golangci_lint and go_mod_tidy CI jobs, but they only run against the root Go module. The v2 module (v2/go.mod) is not covered. Additionally, the v2 code on master had pre-existing lint violations that were never caught.
What's in this MR?
CI: extend template jobs to cover v2
Overrides the script section of the template-provided golangci_lint and go_mod_tidy jobs to also run against the v2 module. The template's stage, image, rules, artifacts, extends, and retry configuration are preserved via GitLab CI's merge behavior.
-
golangci_lint: runs the linter on root (with code-climate output), thencd v2and runs again. Handles both golangci-lint v1 and v2 flag syntax. -
go_mod_tidy: runsgo mod tidyon both modules, then checksgit diff --exit-code.
Fix pre-existing v2 lint violations
- Fix
gciimport grouping inmiddleware.go,app_test.go,server_test.go - Fix
godotcomment period inhttpclient/client.go - Disable
contextcheck(shutdown contexts are intentionally new, not inherited) - Disable
interfacebloat(Router interface mirrors chi's by design) - Fix deprecated golangci-lint directives in
v2/.golangci.yaml(deadline->timeout, removeskip-dirs)
Scripts in scripts/
The scripts/golangci-lint.sh and scripts/go-mod-tidy.sh (added in !333 (merged)) remain useful for pre-commit hooks during local development. CI now uses inline overrides instead of these scripts to preserve template behavior (code-climate artifacts, drift detection, retry config).
Note: the build, test, and test-fips jobs already cover v2 via scripts/compile.sh and scripts/test.sh.