-
Notifications
You must be signed in to change notification settings - Fork 205
chore: Update to Go 1.24.6 and Go linter to 2.3.1 #3579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
snyk false positives |
@@ -142,7 +142,7 @@ func TestCleanProjectAndClusters(t *testing.T) { | |||
}) | |||
} | |||
t.Cleanup(func() { | |||
projectsAfter := readAllProjects(context.Background(), t, client) //nolint:usetesting // reason: using context.Background() here intentionally because t.Context() is canceled at cleanup | |||
projectsAfter := readAllProjects(context.Background(), t, client) // reason: using context.Background() here intentionally because t.Context() is canceled at cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix linter issue:
internal/testutil/clean/org_clean_test.go:145:69: directive `//nolint:usetesting // reason: using context.Background() here intentionally because t.Context() is canceled at cleanup` is unused for linter "usetesting" (nolintlint)
@@ -75,12 +76,12 @@ func writeToFile(fileName, content string) error { | |||
|
|||
// formatGoFile runs goimports and fieldalignment on the specified Go file | |||
func formatGoFile(filePath string) { | |||
goimportsCmd := exec.Command("goimports", "-w", filePath) | |||
goimportsCmd := exec.CommandContext(context.Background(), "goimports", "-w", filePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix linter issue:
os/exec.Command must not be called. use os/exec.CommandContext (noctx)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Go version from 1.24.5 to 1.24.6 and the golangci-lint version from 2.1.6 to 2.3.1. This is a maintenance update to keep dependencies current.
Key changes:
- Go runtime version bump to 1.24.6
- Golangci-lint version update to 2.3.1 across Makefile and GitHub Actions
- Addition of context to exec commands for better cancellation support
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
go.mod | Updates Go version from 1.24.5 to 1.24.6 |
Makefile | Updates golangci-lint version from v2.1.6 to v2.3.1 |
.github/workflows/code-health.yml | Updates golangci-lint action version to v2.3.1 |
tools/codegen/main.go | Adds context support to exec commands |
internal/testutil/clean/org_clean_test.go | Updates linter directive format |
internal/serviceapi/projectapi/resource_schema.go | Enhances documentation for project alert settings |
internal/serviceapi/clusterapi/resource_schema.go | Improves documentation for region configs and cluster states |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY!
@@ -258,7 +258,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { | |||
}, | |||
"region_configs": schema.ListNestedAttribute{ | |||
Optional: true, | |||
MarkdownDescription: "Hardware specifications for nodes set for a given region. Each **regionConfigs** object describes the region's priority in elections and the number and type of MongoDB nodes that MongoDB Cloud deploys to the region. Each **regionConfigs** object must have either an **analyticsSpecs** object, **electableSpecs** object, or **readOnlySpecs** object. Tenant clusters only require **electableSpecs. Dedicated** clusters can specify any of these specifications, but must have at least one **electableSpecs** object within a **replicationSpec**.\n\n**Example:**\n\nIf you set `\"replicationSpecs[n].regionConfigs[m].analyticsSpecs.instanceSize\" : \"M30\"`, set `\"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize\" : `\"M30\"` if you have electable nodes and `\"replicationSpecs[n].regionConfigs[m].readOnlySpecs.instanceSize\" : `\"M30\"` if you have read-only nodes.", | |||
MarkdownDescription: "Hardware specifications for nodes set for a given region. Each **regionConfigs** object must be unique by region and cloud provider within the **replicationSpec**. Each **regionConfigs** object describes the region's priority in elections and the number and type of MongoDB nodes that MongoDB Cloud deploys to the region. Each **regionConfigs** object must have either an **analyticsSpecs** object, **electableSpecs** object, or **readOnlySpecs** object. Tenant clusters only require **electableSpecs. Dedicated** clusters can specify any of these specifications, but must have at least one **electableSpecs** object within a **replicationSpec**.\n\n**Example:**\n\nIf you set `\"replicationSpecs[n].regionConfigs[m].analyticsSpecs.instanceSize\" : \"M30\"`, set `\"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize\" : `\"M30\"` if you have electable nodes and `\"replicationSpecs[n].regionConfigs[m].readOnlySpecs.instanceSize\" : `\"M30\"` if you have read-only nodes.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional updates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the check is triggered as tool changed: https://github.com/mongodb/terraform-provider-mongodbatlas/actions/runs/16879077164/job/47810284143?pr=3579
Description
Update to Go 1.24.6 and Go linter to 2.3.1
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments