Skip to content

Conversation

@JEETDESAI25
Copy link

What kind of change does this PR introduce?

Bug fix for supabase_settings respecting lifecycle.ignore_changes.

What is the current behavior?

Closes #229. Even when lifecycle.ignore_changes includes auth (or other settings blocks), the provider still calls the update APIs. During imports the plan carries the existing JSON, so Update() sees non-null values and always invokes updateAuthConfig/updateNetworkConfig/etc., leading to unnecessary API errors.

What is the new behavior?

  • Update() now reads both plan and state and only calls updateDatabase/Network/Api/Auth when the jsontypes.Normalized values differ (semantic JSON comparison).
  • Adds TestAccSettingsResource_IgnoreChanges: applies a settings resource, updates only the network with lifecycle.ignore_changes = [auth], and asserts the auth PATCH endpoint is never hit.

Additional context

  • Verified locally with TF_ACC=1 go test -v ./internal/provider/ -timeout 5m and targeted runs for all settings tests.
  • golangci-lint run ./internal/provider/... passes with 0 issues.
  • The comparison logic applies identically to all JSON settings blocks (database, network, api, auth). Regression test specifically validates auth being ignored and network being updated.

@JEETDESAI25 JEETDESAI25 requested a review from a team as a code owner November 25, 2025 03:40
@JEETDESAI25 JEETDESAI25 force-pushed the fix/issue-229-respect-ignore-changes-clean branch from 41d2322 to eafa7da Compare November 25, 2025 03:51
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.

Terraform tries to update auth configure while ignored

1 participant