Skip to content

Conversation

@JEETDESAI25
Copy link
Contributor

What kind of change does this PR introduce?

Feature

What is the current behavior?

Closes #227. supabase_settings.storage existed in the schema but wasn’t wired to the Supabase API, so users couldn’t configure storage limits or feature flags and Terraform ignored the input.

What is the new behavior?

  • Added storage support to the resource lifecycle(Create/Read/Update/Import) with readStorageConfig/updateStorageConfig helpers that call the Supabase storage endpoints and normalize the response.
  • Acceptance test now mocks storage GET/PATCH flows and asserts state contains the expected file size limit and feature flags.
  • Example and docs show a real storage block using the API’s camelCase JSON to prevent plan drift.

Additional context

Storage logic mirrors the existing database/network/api/auth patterns. PR #258 plan-vs-state comparison pattern can be extended to include storage.

@JEETDESAI25 JEETDESAI25 requested a review from a team as a code owner November 26, 2025 22:51
return diag.Diagnostics{diag.NewErrorDiagnostic("Client Error", msg)}
}

if state.Storage, err = parseConfig(state.Storage, *httpResp.JSON200); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does parseConfig work with storage as expected? I believe parseConfig does not handle nested structures at the moment, so icebergCatalog being omitempty might cause issues with the state. Could you take a look and confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, wrote a unit test for the icebergCatalog case and it did drop the field when the API omitted it. pickConfig now recurses into nested structs and preserves user values even when the response has omitempty. Added the test to make sure we don’t regress.

@JEETDESAI25 JEETDESAI25 force-pushed the feat/issue-227-storage-settings branch from 5345858 to 6d718e2 Compare December 1, 2025 23:15
@JEETDESAI25 JEETDESAI25 force-pushed the feat/issue-227-storage-settings branch from 6d718e2 to 5ff60cc Compare December 2, 2025 23:01
@JEETDESAI25 JEETDESAI25 requested a review from savme December 3, 2025 03:29
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.

Storage in terraform is not working

2 participants