You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unify client construction pathways and logging between SDKv2 and Plugin Framework implementations (#4728)
## Changes
Currently, the SDKv2 and Plugin Framework provider implementations have
slightly different behavior in how the provider is configured. The
SDKv2's schema.Schema is constructed using `DefaultFunc`, which allows
setting provider-level configuration attributes to have default values
based on environment variables. The specific environment variables are
taken from struct tags in the Go SDK's Config object. On the other hand,
the Plugin Framework's provider.Schema has no support for default
values. Eventually, when the config.Config from the Databricks Go SDK is
resolved, those attributes will be populated from the environment
anyways. Thus, it should be safe to remove these environment variable
defaults from the SDKv2 implementation, ensuring a uniform treatment of
provider configuration between both implementations.
Beyond this, the code to construct the `DatabricksClient` used by each
provider was copied, resulting in a small, unexpected divergence between
the two. This common code has now been refactored into
`internal/providers/client/databricks_client.go` and is used by both
implementations.
Lastly, the Plugin Framework implementation incorrectly logged which
attributes were configured by the user. This makes it challenging to
review debug logs and interpret what attributes were actually set by a
user in their provider configuration. This PR addresses this, with a
small refactor of the logic to set an individual attribute refactored
into a function.
## Tests
This should pass existing integration tests.
Additionally, when running integration tests locally, I can see the
following log output:
```
2025-05-20T10:41:14.603Z [INFO] databricks: (sdkv2) No attributes specified in provider configuration: tf_provider_addr=registry.terraform.io/hashicorp/databricks tf_rpc=ConfigureProvider tf_mux_provider=tf5to6server.v5tov6Server tf_req_id=b6fd5713-ac58-ef1e-ec8e-10ca5ecb8aa4
2025-05-20T10:41:14.604Z [INFO] databricks: (plugin framework) No attributes specified in provider configuration: tf_provider_addr=registry.terraform.io/hashicorp/databricks tf_rpc=ConfigureProvider tf_mux_provider="*proto6server.Server" tf_req_id=b6fd5713-ac58-ef1e-ec8e-10ca5ecb8aa4
```
which is now accurate as the provider configuration is empty for
integration tests.
Copy file name to clipboardExpand all lines: NEXT_CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
### Bug Fixes
10
10
11
11
* Don't fail delete when `databricks_system_schema` can be disabled only by Databricks [#4727](https://github.com/databricks/terraform-provider-databricks/pull/4727)
12
+
* Fix debug logging for attributes used to configure the provider ([#4728](https://github.com/databricks/terraform-provider-databricks/pull/4728)).
0 commit comments