Skip to content

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

Merged
merged 4 commits into from
Aug 12, 2025
Merged

chore: Update to Go 1.24.6 and Go linter to 2.3.1 #3579

merged 4 commits into from
Aug 12, 2025

Conversation

lantoli
Copy link
Member

@lantoli lantoli commented Aug 11, 2025

Description

Update to Go 1.24.6 and Go linter to 2.3.1

Link to any related issue(s):

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@lantoli
Copy link
Member Author

lantoli commented Aug 11, 2025

snyk false positives

@lantoli lantoli changed the title chore: Update to Go 1.24.6 chore: Update to Go 1.24.6 and Go linter to 2.3.1 Aug 11, 2025
@@ -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
Copy link
Member Author

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)
Copy link
Member Author

@lantoli lantoli Aug 11, 2025

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)

@lantoli lantoli marked this pull request as ready for review August 11, 2025 12:05
@Copilot Copilot AI review requested due to automatic review settings August 11, 2025 12:05
@lantoli lantoli requested a review from a team as a code owner August 11, 2025 12:05
Copy link
Contributor

@Copilot Copilot AI left a 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

Copy link
Collaborator

@EspenAlbert EspenAlbert left a 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.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional updates?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lantoli lantoli merged commit 0de42db into master Aug 12, 2025
45 of 47 checks passed
@lantoli lantoli deleted the go_1.24.6 branch August 12, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants