diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab3878266..33e24db67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,7 +119,7 @@ We are migrating the resource from SDKv2 to Plugin Framework provider and hence - `sdkv2`: Contains the changes specific to SDKv2. This package shouldn't depend on pluginfw or common. ### Adding a new resource -1. Check if the directory for this particular resource exists under `internal/providers/pluginfw/resources`, if not create the directory eg: `cluster`, `volume` etc... Please note: Resources and Data sources are organized under the same package for that service. +1. Check if the directory for this particular resource exists under `internal/providers/plugnifw/products`, if not create the directory eg: `cluster`, `volume` etc... Please note: Resources and Data sources are organized under the same package for that service. 2. Create a file with resource_resource-name.go and write the CRUD methods, schema for that resource. For reference, please take a look at existing resources eg: `resource_quality_monitor.go` 3. Create a file with `resource_resource-name_acc_test.go` and add integration tests here. 4. Create a file with `resource_resource-name_test.go` and add unit tests here. Note: Please make sure to abstract specific method of the resource so they are unit test friendly and not testing internal part of terraform plugin framework library. You can compare the diagnostics, for example: please take a look at: `data_cluster_test.go` @@ -127,7 +127,7 @@ We are migrating the resource from SDKv2 to Plugin Framework provider and hence 6. Create a PR and send it for review. ### Adding a new data source -1. Check if the directory for this particular datasource exists under `internal/providers/pluginfw/resources`, if not create the directory eg: `cluster`, `volume` etc... Please note: Resources and Data sources are organized under the same package for that service. +1. Check if the directory for this particular datasource exists under `internal/providers/plugnifw/products`, if not create the directory eg: `cluster`, `volume` etc... Please note: Resources and Data sources are organized under the same package for that service. 2. Create a file with `data_resource-name.go` and write the CRUD methods, schema for that data source. For reference, please take a look at existing data sources eg: `data_cluster.go` 3. Create a file with `data_resource-name_acc_test.go` and add integration tests here. 4. Create a file with `data_resource-name_test.go` and add unit tests here. Note: Please make sure to abstract specific method of the resource so they are unit test friendly and not testing internal part of terraform plugin framework library. You can compare the diagnostics, for example: please take a look at: `data_cluster_test.go` @@ -141,7 +141,7 @@ Ideally there shouldn't be any behaviour change when migrating a resource or dat ### Code Organization -Each resource and data source should be defined in package `internal/providers/pluginfw/resources/`, e.g.: `internal/providers/pluginfw/resources/volume` package will contain both resource, data sources and other utils specific to volumes. Tests (both unit and integration tests) will also remain in this package. +Each resource and data source should be defined in package `internal/providers/plugnifw/products/`, e.g.: `internal/providers/plugnifw/products/volume` package will contain both resource, data sources and other utils specific to volumes. Tests (both unit and integration tests) will also remain in this package. Note: Only Docs will stay under root docs/ directory. diff --git a/internal/acceptance/pipeline_test.go b/internal/acceptance/pipeline_test.go index d56f651ca..695163120 100644 --- a/internal/acceptance/pipeline_test.go +++ b/internal/acceptance/pipeline_test.go @@ -88,6 +88,8 @@ func TestAccPipelineResource_CreatePipeline(t *testing.T) { } } + schema = null + continuous = false } ` + dltNotebookResource, diff --git a/internal/providers/pluginfw/pluginfw.go b/internal/providers/pluginfw/pluginfw.go index db811d5ae..62b15e1a3 100644 --- a/internal/providers/pluginfw/pluginfw.go +++ b/internal/providers/pluginfw/pluginfw.go @@ -16,12 +16,12 @@ import ( "github.com/databricks/terraform-provider-databricks/commands" "github.com/databricks/terraform-provider-databricks/common" providercommon "github.com/databricks/terraform-provider-databricks/internal/providers/common" - "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/cluster" - "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/library" - "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/notificationdestinations" - "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/qualitymonitor" - "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/registered_model" - "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/volume" + "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/products/cluster" + "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/products/library" + "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/products/notificationdestinations" + "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/products/qualitymonitor" + "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/products/registered_model" + "github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/products/volume" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -45,17 +45,17 @@ var _ provider.Provider = (*DatabricksProviderPluginFramework)(nil) func (p *DatabricksProviderPluginFramework) Resources(ctx context.Context) []func() resource.Resource { return []func() resource.Resource{ - qualitymonitor.ResourceQualityMonitor, library.ResourceLibrary, + qualitymonitor.ResourceQualityMonitor, } } func (p *DatabricksProviderPluginFramework) DataSources(ctx context.Context) []func() datasource.DataSource { return []func() datasource.DataSource{ cluster.DataSourceCluster, - volume.DataSourceVolumes, - registered_model.DataSourceRegisteredModel, notificationdestinations.DataSourceNotificationDestinations, + registered_model.DataSourceRegisteredModel, + volume.DataSourceVolumes, } } diff --git a/internal/providers/pluginfw/resources/cluster/data_cluster.go b/internal/providers/pluginfw/products/cluster/data_cluster.go similarity index 100% rename from internal/providers/pluginfw/resources/cluster/data_cluster.go rename to internal/providers/pluginfw/products/cluster/data_cluster.go diff --git a/internal/providers/pluginfw/resources/cluster/data_cluster_acc_test.go b/internal/providers/pluginfw/products/cluster/data_cluster_acc_test.go similarity index 100% rename from internal/providers/pluginfw/resources/cluster/data_cluster_acc_test.go rename to internal/providers/pluginfw/products/cluster/data_cluster_acc_test.go diff --git a/internal/providers/pluginfw/resources/cluster/data_cluster_test.go b/internal/providers/pluginfw/products/cluster/data_cluster_test.go similarity index 100% rename from internal/providers/pluginfw/resources/cluster/data_cluster_test.go rename to internal/providers/pluginfw/products/cluster/data_cluster_test.go diff --git a/internal/providers/pluginfw/resources/library/resource_library.go b/internal/providers/pluginfw/products/library/resource_library.go similarity index 100% rename from internal/providers/pluginfw/resources/library/resource_library.go rename to internal/providers/pluginfw/products/library/resource_library.go diff --git a/internal/providers/pluginfw/resources/library/resource_library_acc_test.go b/internal/providers/pluginfw/products/library/resource_library_acc_test.go similarity index 100% rename from internal/providers/pluginfw/resources/library/resource_library_acc_test.go rename to internal/providers/pluginfw/products/library/resource_library_acc_test.go diff --git a/internal/providers/pluginfw/resources/notificationdestinations/data_notification_destinations.go b/internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations.go similarity index 100% rename from internal/providers/pluginfw/resources/notificationdestinations/data_notification_destinations.go rename to internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations.go diff --git a/internal/providers/pluginfw/resources/notificationdestinations/data_notification_destinations_acc_test.go b/internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations_acc_test.go similarity index 100% rename from internal/providers/pluginfw/resources/notificationdestinations/data_notification_destinations_acc_test.go rename to internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations_acc_test.go diff --git a/internal/providers/pluginfw/resources/notificationdestinations/data_notification_destinations_test.go b/internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations_test.go similarity index 100% rename from internal/providers/pluginfw/resources/notificationdestinations/data_notification_destinations_test.go rename to internal/providers/pluginfw/products/notificationdestinations/data_notification_destinations_test.go diff --git a/internal/providers/pluginfw/resources/qualitymonitor/resource_quality_monitor.go b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go similarity index 100% rename from internal/providers/pluginfw/resources/qualitymonitor/resource_quality_monitor.go rename to internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go diff --git a/internal/providers/pluginfw/resources/qualitymonitor/resource_quality_monitor_acc_test.go b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor_acc_test.go similarity index 100% rename from internal/providers/pluginfw/resources/qualitymonitor/resource_quality_monitor_acc_test.go rename to internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor_acc_test.go diff --git a/internal/providers/pluginfw/resources/registered_model/data_registered_model.go b/internal/providers/pluginfw/products/registered_model/data_registered_model.go similarity index 100% rename from internal/providers/pluginfw/resources/registered_model/data_registered_model.go rename to internal/providers/pluginfw/products/registered_model/data_registered_model.go diff --git a/internal/providers/pluginfw/resources/volume/data_volumes.go b/internal/providers/pluginfw/products/volume/data_volumes.go similarity index 100% rename from internal/providers/pluginfw/resources/volume/data_volumes.go rename to internal/providers/pluginfw/products/volume/data_volumes.go diff --git a/internal/providers/pluginfw/resources/volume/data_volumes_acc_test.go b/internal/providers/pluginfw/products/volume/data_volumes_acc_test.go similarity index 100% rename from internal/providers/pluginfw/resources/volume/data_volumes_acc_test.go rename to internal/providers/pluginfw/products/volume/data_volumes_acc_test.go