diff --git a/.github/workflows/code-health.yml b/.github/workflows/code-health.yml index dbd252bb30..7223ade723 100644 --- a/.github/workflows/code-health.yml +++ b/.github/workflows/code-health.yml @@ -57,7 +57,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 with: - version: v2.1.6 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version + version: v2.3.1 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version - name: actionlint run: | make tools diff --git a/Makefile b/Makefile index a5ccb5afb4..83dfb7decb 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ GITTAG=$(shell git describe --always --tags) VERSION=$(GITTAG:v%=%) LINKER_FLAGS=-s -w -X 'github.com/mongodb/terraform-provider-mongodbatlas/version.ProviderVersion=${VERSION}' -GOLANGCI_VERSION=v2.1.6 # Also update golangci-lint GH action in code-health.yml when updating this version +GOLANGCI_VERSION=v2.3.1 # Also update golangci-lint GH action in code-health.yml when updating this version export PATH := $(shell go env GOPATH)/bin:$(PATH) export SHELL := env PATH=$(PATH) /bin/bash @@ -236,4 +236,4 @@ upload-sbom: ## Upload SBOM .PHONY: augment-sbom augment-sbom: ## Augment SBOM - ./scripts/compliance/augment-sbom.sh \ No newline at end of file + ./scripts/compliance/augment-sbom.sh diff --git a/go.mod b/go.mod index 14a5ea7022..25b02e43a0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mongodb/terraform-provider-mongodbatlas -go 1.24.5 +go 1.24.6 require ( github.com/andygrunwald/go-jira/v2 v2.0.0-20240116150243-50d59fe116d6 diff --git a/internal/serviceapi/clusterapi/resource_schema.go b/internal/serviceapi/clusterapi/resource_schema.go index b32d8b622d..45363092dd 100755 --- a/internal/serviceapi/clusterapi/resource_schema.go +++ b/internal/serviceapi/clusterapi/resource_schema.go @@ -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.", NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "analytics_auto_scaling": schema.SingleNestedAttribute{ @@ -489,7 +489,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, "state_name": schema.StringAttribute{ Computed: true, - MarkdownDescription: "Human-readable label that indicates the current operating condition of this cluster.", + MarkdownDescription: "Human-readable label that indicates any current activity being taken on this cluster by the Atlas control plane. With the exception of CREATING and DELETING states, clusters should always be available and have a Primary node even when in states indicating ongoing activity.\n\n - `IDLE`: Atlas is making no changes to this cluster and all changes requested via the UI or API can be assumed to have been applied.\n - `CREATING`: A cluster being provisioned for the very first time returns state CREATING until it is ready for connections. Ensure IP Access List and DB Users are configured before attempting to connect.\n - `UPDATING`: A change requested via the UI, API, AutoScaling, or other scheduled activity is taking place.\n - `DELETING`: The cluster is in the process of deletion and will soon be deleted.\n - `REPAIRING`: One or more nodes in the cluster are being returned to service by the Atlas control plane. Other nodes should continue to provide service as normal.", }, "tags": schema.ListNestedAttribute{ Optional: true, diff --git a/internal/serviceapi/projectapi/resource_schema.go b/internal/serviceapi/projectapi/resource_schema.go index a64474b53e..03ef4f15cd 100755 --- a/internal/serviceapi/projectapi/resource_schema.go +++ b/internal/serviceapi/projectapi/resource_schema.go @@ -56,7 +56,7 @@ func ResourceSchema(ctx context.Context) schema.Schema { "with_default_alerts_settings": schema.BoolAttribute{ Computed: true, Optional: true, - MarkdownDescription: "Flag that indicates whether to create the project with default alert settings.", + MarkdownDescription: "Flag that indicates whether to create the project with default alert settings. This setting cannot be updated after project creation.", }, }, } diff --git a/internal/testutil/clean/org_clean_test.go b/internal/testutil/clean/org_clean_test.go index d338d6cd64..0c0c3cd3fa 100644 --- a/internal/testutil/clean/org_clean_test.go +++ b/internal/testutil/clean/org_clean_test.go @@ -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 t.Logf("SUMMARY\nProjects changed from %d to %d\ndelete_errors=%d\nempty_project_count=%d\nDRY_RUN=%t", projectsBefore, len(projectsAfter), deleteErrors, emptyProjectCount, dryRun) }) } diff --git a/tools/codegen/main.go b/tools/codegen/main.go index 464d996ede..30fbd89d23 100644 --- a/tools/codegen/main.go +++ b/tools/codegen/main.go @@ -1,6 +1,7 @@ package main import ( + "context" "fmt" "log" "os" @@ -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) if output, err := goimportsCmd.CombinedOutput(); err != nil { log.Printf("warning: goimports failed for %s: %v\nOutput: %s", filePath, err, output) } - fieldalignmentCmd := exec.Command("fieldalignment", "-fix", filePath) + fieldalignmentCmd := exec.CommandContext(context.Background(), "fieldalignment", "-fix", filePath) if output, err := fieldalignmentCmd.CombinedOutput(); err != nil { log.Printf("warning: fieldalignment failed for %s: %v\nOutput: %s", filePath, err, output) }