Skip to content

Commit a1b3559

Browse files
renovate[bot]carabasdaniel
authored andcommitted
chore(deps): update dependency golangci/golangci-lint to v2.11.3 (#4261)
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [golangci/golangci-lint](https://redirect.github.com/golangci/golangci-lint) | minor | `v2.10.1` → `v2.11.3` | | [golangci/golangci-lint](https://redirect.github.com/golangci/golangci-lint) | minor | `2.10.1` → `2.11.3` | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/370) for more information. --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci/golangci-lint)</summary> ### [`v2.11.3`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2113) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.11.2...v2.11.3) *Released on 2026-03-10* 1. Linters bug fixes - `gosec`: from v2.24.7 to [`619ce21`](https://redirect.github.com/golangci/golangci-lint/commit/619ce2117e08) ### [`v2.11.2`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2112) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.11.1...v2.11.2) *Released on 2026-03-07* 1. Fixes - `fmt`: fix error when using the `fmt` command with explicit paths. ### [`v2.11.1`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2111) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.11.0...v2.11.1) *Released on 2026-03-06* Due to an error related to AUR, some artifacts of the v2.11.0 release have not been published. This release contains the same things as v2.11.0. ### [`v2.11.0`](https://redirect.github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v2110) [Compare Source](https://redirect.github.com/golangci/golangci-lint/compare/v2.10.1...v2.11.0) *Released on 2026-03-06* 1. Linters new features or changes - `errcheck`: from 1.9.0 to 1.10.0 (exclude `crypto/rand.Read` by default) - `gosec`: from 2.23.0 to 2.24.6 (new rules: `G113`, `G118`, `G119`, `G120`, `G121`, `G122`, `G123`, `G408`, `G707`) - `noctx`: from 0.4.0 to 0.5.0 (new detection: `httptest.NewRequestWithContext`) - `prealloc`: from 1.0.2 to 1.1.0 - `revive`: from 1.14.0 to 1.15.0 (⚠️ Breaking change: package-related checks moved from `var-naming` to a new rule `package-naming`) 2. Linters bug fixes - `gocognit`: from 1.2.0 to 1.2.1 - `gosec`: from 2.24.6 to 2.24.7 - `unqueryvet`: from 1.5.3 to 1.5.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 10am on friday" in timezone Europe/London, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/overmindtech/workspace). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS4wIiwidXBkYXRlZEluVmVyIjoiNDMuNTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Mostly a tooling upgrade, but it also changes runtime behavior by enforcing request body size limits on several admin/API handlers, which could reject previously-accepted large submissions. > > **Overview** > Updates `golangci-lint` to `v2.11.3` in both the devcontainer and CI. > > To satisfy new linter rules, this removes/adjusts many `//nolint:gosec` annotations, switches multiple tests to `httptest.NewRequestWithContext`, and adds/updates a few targeted suppressions (e.g. `context.WithCancel`, `context.WithTimeout`). > > Adds explicit `http.MaxBytesReader` limits on various Area51 admin handlers (typically 10MB; 200MB for snapshot/blast-radius uploads), reducing risk of oversized request bodies at the cost of stricter input limits. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit aa6ee6c4ad731a9c1dd0433d3f2abb4402a4ca5f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: carabasdaniel <[email protected]> GitOrigin-RevId: 4cf21c8a7518ea44685543934946dc11213ab426
1 parent da039d4 commit a1b3559

16 files changed

Lines changed: 26 additions & 26 deletions

File tree

cmd/changes_submit_plan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func changeTitle(ctx context.Context, arg string) string {
5252
return arg
5353
}
5454

55-
describeBytes, err := exec.CommandContext(ctx, "git", "describe", "--long").Output() //nolint:gosec // G702: all arguments are hardcoded string literals; no user input reaches this command
55+
describeBytes, err := exec.CommandContext(ctx, "git", "describe", "--long").Output()
5656
describe := strings.TrimSpace(string(describeBytes))
5757
if err != nil {
5858
log.WithError(err).Trace("failed to run 'git describe' for default title")

cmd/pterm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func RunRevlinkWarmup(ctx context.Context, oi sdp.OvermindInstance, postPlanPrin
151151
}
152152

153153
func RunPlan(ctx context.Context, args []string) error {
154-
c := exec.CommandContext(ctx, "terraform", args...) //nolint:gosec // G702: args are CLI arguments from the local user who invoked this command; this tool runs on the user's own machine
154+
c := exec.CommandContext(ctx, "terraform", args...)
155155

156156
// remove go's default process cancel behaviour, so that terraform has a
157157
// chance to gracefully shutdown when ^C is pressed. Otherwise the
@@ -180,7 +180,7 @@ func RunPlan(ctx context.Context, args []string) error {
180180
}
181181

182182
func RunApply(ctx context.Context, args []string) error {
183-
c := exec.CommandContext(ctx, "terraform", args...) //nolint:gosec // G702: args are CLI arguments from the local user who invoked this command; this tool runs on the user's own machine
183+
c := exec.CommandContext(ctx, "terraform", args...)
184184

185185
// remove go's default process cancel behaviour, so that terraform has a
186186
// chance to gracefully shutdown when ^C is pressed. Otherwise the

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ func login(ctx context.Context, cmd *cobra.Command, scopes []string, writer io.W
522522
}
523523

524524
// apply a timeout to the main body of processing
525-
ctx, _ = context.WithTimeout(ctx, timeout) //nolint:govet // the context will not leak as the command will exit when it is done
525+
ctx, _ = context.WithTimeout(ctx, timeout) //nolint:govet,gosec // the context will not leak as the command will exit when it is done
526526

527527
return ctx, oi, token, nil
528528
}

cmd/terraform_plan.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI
116116
// Convert provided plan into JSON for easier parsing
117117
///////////////////////////////////////////////////////////////////
118118

119-
tfPlanJsonCmd := exec.CommandContext(ctx, "terraform", "show", "-json", planFile) //nolint:gosec // G702: "terraform", "show", "-json" are hardcoded; planFile is from the local user's CLI -out flag
119+
tfPlanJsonCmd := exec.CommandContext(ctx, "terraform", "show", "-json", planFile)
120120

121121
tfPlanJsonCmd.Stderr = multi.NewWriter() // send output through PTerm; is usually empty
122122

@@ -182,7 +182,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI
182182
}
183183

184184
line := printer.Sprintf("%v (%v)", mapping.TerraformName, mapping.Message)
185-
_, err = fmt.Fprintf(resourceExtractionResults, " %v\n", line) //nolint:gosec // G203: resourceExtractionResults is a pterm.MultiPrinter writer (terminal UI), not an http.ResponseWriter; no XSS vector
185+
_, err = fmt.Fprintf(resourceExtractionResults, " %v\n", line)
186186
if err != nil {
187187
return fmt.Errorf("error writing to resource extraction results: %w", err)
188188
}
@@ -230,7 +230,7 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI
230230
}
231231

232232
title := changeTitle(ctx, viper.GetString("title"))
233-
tfPlanTextCmd := exec.CommandContext(ctx, "terraform", "show", planFile) //nolint:gosec // G702: "terraform" and "show" are hardcoded; planFile is from the local user's CLI -out flag
233+
tfPlanTextCmd := exec.CommandContext(ctx, "terraform", "show", planFile)
234234

235235
tfPlanTextCmd.Stderr = multi.NewWriter() // send output through PTerm; is usually empty
236236

@@ -514,7 +514,7 @@ func osc8Hyperlink(url, text string) string {
514514

515515
// getTicketLinkFromPlan reads the plan file to create a unique hash to identify this change
516516
func getTicketLinkFromPlan(planFile string) (string, error) {
517-
plan, err := os.ReadFile(planFile) //nolint:gosec // G703: planFile is from the local user's CLI args; reading their chosen file is the intended behavior of this CLI tool
517+
plan, err := os.ReadFile(planFile)
518518
if err != nil {
519519
return "", fmt.Errorf("failed to read plan file (%v): %w", planFile, err)
520520
}

cmd/version_check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func checkVersion(ctx context.Context, currentVersion string) (latestVersion str
5555
req.Header.Set("User-Agent", fmt.Sprintf("overmind-cli/%s", currentVersion))
5656
req.Header.Set("Accept", "application/vnd.github.v3+json")
5757

58-
resp, err := client.Do(req) //nolint:gosec // G704: URL is the hardcoded constant githubReleasesURL; no user input reaches the request URL
58+
resp, err := client.Do(req)
5959
if err != nil {
6060
log.WithError(err).Debug("Failed to check for CLI updates")
6161
return "", false

go/auth/auth.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type ClientCredentialsConfig struct {
7070
// The ClientID of the application that we'll be authenticating as
7171
ClientID string
7272
// ClientSecret that corresponds to the ClientID
73-
ClientSecret string //nolint:gosec // G101 (hardcoded secret): config field name, not a credential value; never JSON-marshaled into logs or responses
73+
ClientSecret string
7474
}
7575

7676
type TokenSourceOptionsFunc func(*clientcredentials.Config)
@@ -128,7 +128,7 @@ func (flowConfig ClientCredentialsConfig) TokenSource(ctx context.Context, oAuth
128128
type Auth0Config struct {
129129
Domain string
130130
ClientID string
131-
ClientSecret string //nolint:gosec // G101 (hardcoded secret): config field name, not a credential value; populated from env vars and only used in OAuth token exchange
131+
ClientSecret string
132132
Audience string
133133
}
134134

@@ -298,7 +298,7 @@ func (n *natsTokenClient) Sign(in []byte) ([]byte, error) {
298298
// tokens
299299
type APIKeyTokenSource struct {
300300
// The API Key to use to authenticate to the Overmind API
301-
ApiKey string //nolint:gosec // G101 (hardcoded secret): config field name, not a credential value; only passed to API key exchange endpoint
301+
ApiKey string
302302
token *oauth2.Token
303303
apiKeyClient sdpconnect.ApiKeyServiceClient
304304
}

go/auth/middleware_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ func TestWithResourceMetadata(t *testing.T) {
705705

706706
handler := WithResourceMetadata(prmURL, inner)
707707
rr := httptest.NewRecorder()
708-
req := httptest.NewRequest(http.MethodPost, "/area51/mcp", nil)
708+
req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/area51/mcp", nil)
709709
handler.ServeHTTP(rr, req)
710710

711711
if rr.Code != http.StatusUnauthorized {
@@ -727,7 +727,7 @@ func TestWithResourceMetadata(t *testing.T) {
727727

728728
handler := WithResourceMetadata(prmURL, inner)
729729
rr := httptest.NewRecorder()
730-
req := httptest.NewRequest(http.MethodPost, "/area51/mcp", nil)
730+
req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/area51/mcp", nil)
731731
handler.ServeHTTP(rr, req)
732732

733733
if rr.Code != http.StatusOK {
@@ -747,7 +747,7 @@ func TestWithResourceMetadata(t *testing.T) {
747747

748748
handler := WithResourceMetadata(prmURL, inner)
749749
rr := httptest.NewRecorder()
750-
req := httptest.NewRequest(http.MethodPost, "/area51/mcp", nil)
750+
req := httptest.NewRequestWithContext(t.Context(), http.MethodPost, "/area51/mcp", nil)
751751
handler.ServeHTTP(rr, req)
752752

753753
if rr.Code != http.StatusForbidden {
@@ -767,7 +767,7 @@ func TestWithResourceMetadata(t *testing.T) {
767767

768768
handler := WithResourceMetadata(prmURL, inner)
769769
rr := httptest.NewRecorder()
770-
req := httptest.NewRequest(http.MethodGet, "/area51/mcp", nil)
770+
req := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/area51/mcp", nil)
771771
handler.ServeHTTP(rr, req)
772772

773773
if rr.Code != http.StatusOK {

go/discovery/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type EngineConfig struct {
6262

6363
// The 'ovm_*' API key to use to authenticate to the Overmind API.
6464
// This and 'SourceAccessToken' are mutually exclusive
65-
ApiKey string //nolint:gosec // G101 (hardcoded secret): config field name, not a credential value; populated from CLI flags/env vars
65+
ApiKey string
6666
// Static token passed to the source to authenticate.
6767
SourceAccessToken string // The access token to use to authenticate to the source
6868
SourceAccessTokenType string // The type of token to use to authenticate the source for managed sources

go/sdp-go/instance_detect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func NewOvermindInstance(ctx context.Context, app string) (OvermindInstance, err
5858
}
5959

6060
req = req.WithContext(ctx)
61-
res, err := tracing.HTTPClient().Do(req) //nolint:gosec // G107 (SSRF): URL is built from the app base URL (CLI config) + hardcoded path /api/public/instance-data
61+
res, err := tracing.HTTPClient().Do(req)
6262
if err != nil {
6363
return OvermindInstance{}, fmt.Errorf("could not fetch instance-data: %w", err)
6464
}

sources/gcp/dynamic/shared.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func externalCallSingle(ctx context.Context, httpCli *http.Client, url string) (
154154
return nil, err
155155
}
156156

157-
resp, err := httpCli.Do(req) //nolint:gosec // G107 (SSRF): URL built from GCP API discovery document endpoints and project config, not user input
157+
resp, err := httpCli.Do(req)
158158
if err != nil {
159159
return nil, err
160160
}
@@ -215,7 +215,7 @@ func externalCallMulti(ctx context.Context, itemsSelector string, httpCli *http.
215215
return err
216216
}
217217

218-
resp, err := httpCli.Do(req) //nolint:gosec // G107 (SSRF): URL built from GCP API discovery document endpoints with pagination token from GCP responses
218+
resp, err := httpCli.Do(req)
219219
if err != nil {
220220
return err
221221
}

0 commit comments

Comments
 (0)