Skip to content
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

[Internal] Generate both SdkV2-compatible and Plugin Framework-compatible structures #4332

Merged
merged 8 commits into from
Dec 19, 2024

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Dec 18, 2024

Changes

To make it possible to implement new resources following the Plugin Framework's recommendation to use attributes while allowing resources to be migrated from SDKv2 to the Plugin Framework without breaking, we will create two copies of each code-generated structure in the Terraform provider. The structures with no suffix should be used for new resources. The structures with the _SdkV2 suffix should be used for resources in the plugin framework that are migrated from SDKv2.

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • using Go SDK
  • using TF Plugin Framework

@mgyucht mgyucht requested review from a team as code owners December 18, 2024 16:15
@mgyucht mgyucht requested review from hectorcast-db and removed request for a team December 18, 2024 16:15
@@ -2289,7 +2289,7 @@ type ShareInfo struct {
// A list of shared data objects within the share.
Objects types.List `tfsdk:"object" tf:"optional"`
// Username of current owner of share.
Owner types.String `tfsdk:"owner" tf:"computed,optional"`
Owner types.String `tfsdk:"owner" tf:"computed"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Owner types.String `tfsdk:"owner" tf:"computed"`
Owner types.String `tfsdk:"owner" tf:"computed,optional"`

@mgyucht
Copy link
Contributor Author

mgyucht commented Dec 19, 2024

Only diff is in that databricks_share_pluginframework's owner attribute is no longer optional, but the whole resource is computed anyways and users only specify the share name.

@mgyucht mgyucht enabled auto-merge December 19, 2024 12:42
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 4332
  • Commit SHA: a1f3439183d5df280441f45d61b432dd1046174e

Checks will be approved automatically on success.

@eng-dev-ecosystem-bot
Copy link
Collaborator

Test Details: go/deco-tests/12416891035

@mgyucht mgyucht added this pull request to the merge queue Dec 19, 2024
Merged via the queue into main with commit cc758b8 Dec 19, 2024
12 checks passed
@mgyucht mgyucht deleted the duplicate-all-legacy-structures branch December 19, 2024 17:48
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.

3 participants