Skip to content

feat: sync add UseStateForUnknown to service_account_password_id - #98

Merged
bradyburke merged 1 commit into
mainfrom
auto-sync-2026-07-10-68e2aba
Jul 13, 2026
Merged

feat: sync add UseStateForUnknown to service_account_password_id #98
bradyburke merged 1 commit into
mainfrom
auto-sync-2026-07-10-68e2aba

Conversation

@starburstdata-automation

Copy link
Copy Markdown
Collaborator

Automated sync from terraform-provider-galaxy-generation repository.

Source commit: 68e2aba4b998ff84c89dd6facaf3b702e406df4f

This PR contains the latest generated provider code from the generation repository.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request changes POST retry behavior for transport errors and HTTP 500 responses, adds coverage for that behavior, and adjusts cluster state handling. Terraform schemas gain plan modifiers for replacement and unknown-state preservation. Multiple data sources now fail early when unconfigured and surface malformed mapping results through diagnostics or warnings. Import IDs validate entity-specific scopes, while schema and table ownership descriptions are corrected.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches a real change in the PR, though it highlights only one of several broader sync updates.
Description check ✅ Passed The description is on-topic and accurately explains that this is an automated sync from the generation repository.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (4)
internal/provider/data_quality_schedule_data_source.go (1)

155-180: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a warning log for skipped non-map check entries.

When checkInterface at Line 158 fails the map[string]interface{} type assertion, the entry is silently skipped. Other data sources in this PR (e.g., data_quality_checks_data_source.go Line 109, groups_data_source.go Lines 92, 208, 244) consistently log tflog.Warn for unexpected entry types. Adding the same warning here would maintain consistency and aid debugging.

♻️ Proposed fix
 		for _, checkInterface := range checks {
 			if checkMap, ok := checkInterface.(map[string]interface{}); ok {
+			} else {
+				tflog.Warn(ctx, fmt.Sprintf("unexpected entry type, skipping: %T", checkInterface))
 			}
internal/provider/evaluation_data_source.go (1)

139-174: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a warning log for skipped non-map evaluation entries.

When evalInterface at Line 142 fails the map[string]interface{} type assertion, the entry is silently skipped. Other data sources in this PR consistently log tflog.Warn for unexpected entry types. Adding the same warning here would maintain consistency and aid debugging.

♻️ Proposed fix
 		for _, evalInterface := range evaluations {
 			if evalMap, ok := evalInterface.(map[string]interface{}); ok {
+			} else {
+				tflog.Warn(ctx, fmt.Sprintf("unexpected entry type, skipping: %T", evalInterface))
 			}
internal/client/client_test.go (1)

112-136: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test correctly verifies POST 500 non-retry; consider adding a transport-error variant.

The test validates the HTTP 500 path well. The transport-error path (line 241 in client.go, where c.HTTPClient.Do returns a non-nil error) is also now non-retriable for POST but has no test coverage. Consider adding a test variant where mockRoundTripper.RoundTrip returns nil response with a non-nil error to confirm POST is not retried on transport failures either.

🧪 Suggested additional test
+func (m *mockRoundTripper) withTransportError() *mockRoundTripper {
+	m.transportErr = fmt.Errorf("connection reset")
+	return m
+}
+
+func TestPostTransportErrorNotRetried(t *testing.T) {
+	mock := &mockRoundTripper{statusCode: http.StatusInternalServerError, transportErr: fmt.Errorf("connection reset")}
+	client := &GalaxyClient{
+		BaseURL:         "http://localhost",
+		ClientID:        "test",
+		ClientSecret:    "test",
+		ProviderVersion: "1.0.0",
+		HTTPClient:      &http.Client{Transport: mock},
+		accessToken:    "test-token",
+		tokenExpiry:    time.Now().Add(1 * time.Hour),
+	}
+	ctx := context.Background()
+	var result map[string]interface{}
+	err := client.doRequestWithRetry(ctx, http.MethodPost, "/test", nil, &result, 3)
+	if err == nil {
+		t.Fatalf("expected error for transport failure on POST, got nil")
+	}
+	if mock.requestCount != 1 {
+		t.Fatalf("POST transport error should not be retried; expected 1 request, got %d", mock.requestCount)
+	}
+}
internal/provider/data_product_resource.go (1)

63-77: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Inconsistent plan modifier assignment pattern between attributes.

catalog_id and schema_name (lines 52-56) use append to preserve existing plan modifiers, while data_product_id and created_on (lines 63-77) use direct slice assignment (attr.PlanModifiers = []planmodifier.String{...}), which replaces any pre-existing plan modifiers. If the generated schema already defines plan modifiers for these attributes, they would be silently lost. Consider using append here as well for consistency and safety.

♻️ Suggested refactor for consistency
 	if attr, ok := s.Attributes["data_product_id"].(schema.StringAttribute); ok {
-		attr.PlanModifiers = []planmodifier.String{
-			stringplanmodifier.UseStateForUnknown(),
-		}
+		attr.PlanModifiers = append(attr.PlanModifiers, stringplanmodifier.UseStateForUnknown())
 		s.Attributes["data_product_id"] = attr
 	}

And similarly for created_on:

 	if attr, ok := s.Attributes["created_on"].(schema.StringAttribute); ok {
-		attr.PlanModifiers = []planmodifier.String{
-			stringplanmodifier.UseStateForUnknown(),
-		}
+		attr.PlanModifiers = append(attr.PlanModifiers, stringplanmodifier.UseStateForUnknown())
 		s.Attributes["created_on"] = attr
 	}

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 115f65b7-75e5-4a0c-99f1-b4748a55e222

📥 Commits

Reviewing files that changed from the base of the PR and between f8c67d4 and aeffcae.

📒 Files selected for processing (17)
  • docs/data-sources/schema.md
  • docs/data-sources/table.md
  • internal/client/client.go
  • internal/client/client_test.go
  • internal/provider/cluster_resource.go
  • internal/provider/data_product_resource.go
  • internal/provider/data_quality_check_data_source.go
  • internal/provider/data_quality_check_resource.go
  • internal/provider/data_quality_checks_data_source.go
  • internal/provider/data_quality_schedule_data_source.go
  • internal/provider/datasource_schema/schema_data_source_gen.go
  • internal/provider/datasource_table/table_data_source_gen.go
  • internal/provider/evaluation_data_source.go
  • internal/provider/groups_data_source.go
  • internal/provider/role_privilege_grant_resource.go
  • internal/provider/service_account_password_resource.go
  • internal/provider/usage_example_data_source.go

@bradyburke
bradyburke merged commit 8d61e91 into main Jul 13, 2026
3 checks passed
@bradyburke
bradyburke deleted the auto-sync-2026-07-10-68e2aba branch July 13, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants