Bump Terraform provider to v1.113.0#4991
Conversation
Co-authored-by: Isaac
Co-authored-by: Isaac
Align mock server workspace_id (470123456789500) with org-id header (900800700600) to fix workspace_id validation errors in app tests. The v1.113.0 provider validates that these match for app resources. Also regenerates test outputs for: - Version string updates in User-Agent headers - Extra /.well-known/databricks-config requests from the provider - embed_credentials null -> false in dashboard state - update_mask change in postgres_projects Co-authored-by: Isaac
| }, | ||
| "method": "GET", | ||
| "path": "/.well-known/databricks-config" | ||
| } |
There was a problem hiding this comment.
Does this match the # of command invocations?
Just to gut check that we're not doing 1 of these per TF request.
There was a problem hiding this comment.
Yes, it's per terraform invocation, not per API request. The provider calls /.well-known/databricks-config during initialization, so it happens roughly twice per terraform operation (plan, apply). Deploy runs plan+apply so you see ~4 provider calls, destroy similarly gets ~6. The single calls with cli/... user-agent are from the CLI SDK's own config resolution. I think there might be an effort looking into adding caching for this, but we'd have to ask @tanmay-db
There was a problem hiding this comment.
The current TF Release (v1.113.0) doesn't directly rely on this end point. This is called during Host metadata resolution in Go SDK and that is bumped in TF so I am guessing this is why this is needed here (not sure)? In very near future we plan to use this in TF
The plan is to add this in HostType() in Go SDK so
- Go SDK would call this endpoint store it in the config
- TF will check if this value is there in config
| DefaultCatalogName: "hive_metastore", | ||
| MetastoreId: "120efa64-9b68-46ba-be38-f319458430d2", | ||
| WorkspaceId: 470123456789500, | ||
| WorkspaceId: 900800700600, |
There was a problem hiding this comment.
Was the previous one broken?
There was a problem hiding this comment.
We have added the .well-known/databricks-config as validation in terraform now, so it must match the expectation there
There was a problem hiding this comment.
@simonfaltum what was the failure on the previous workspaceID?
There was a problem hiding this comment.
The provider gets its workspace ID from X-Databricks-Org-Id header (900800700600), but /.well-known/databricks-config was returning 470123456789500. The mismatch caused all app tests to fail with "workspace_id mismatch: provider is configured for workspace 900800700600 but got 470123456789500 in provider_config".
There was a problem hiding this comment.
For context on why might have happened, we have recently launched support for default workspace id in apps: databricks/terraform-provider-databricks#5542. The call terraform is making for validation is scim/me and not .well-known.
The scim/me returns this workspace id and hence the conflict
server.Handle("GET", "/api/2.0/preview/scim/v2/Me", func(req Request) any {
return Response{
Headers: map[string][]string{"X-Databricks-Org-Id": {"900800700600"}},
Body: req.Workspace.CurrentUser(),
}
})| @@ -1,3 +1,5 @@ | |||
| RecordRequests = false | |||
|
|
|||
There was a problem hiding this comment.
Not relevant for this case, I guess?
There was a problem hiding this comment.
The TF provider v1.113.0 makes extra /.well-known/databricks-config calls that the direct engine doesn't. Since both variants share out.requests.txt, the terraform variant now produces more requests than direct, causing a divergence. Disabling recording for this test sidesteps it since the test only cares about the plan output anyway.
Why
Keep the CLI's Terraform schema in sync with the latest provider release (v1.113.0).
Changes
Bumps the provider version from 1.111.0 to 1.113.0 and regenerates the Go schema types using
go run .inbundle/internal/tf/codegen.New data sources and resources added:
environments_default_workspace_base_environmentenvironments_workspace_base_environment(s)postgres_catalogpostgres_role(s)postgres_synced_tableTest plan
make checkspasses