Skip to content

workspace_id support for Autogenerated Plugin Framework resources #5570

Merged
Divyansh-db merged 8 commits intomainfrom
divyansh-vijayvergia_data/pf-generated
Apr 16, 2026
Merged

workspace_id support for Autogenerated Plugin Framework resources #5570
Divyansh-db merged 8 commits intomainfrom
divyansh-vijayvergia_data/pf-generated

Conversation

@Divyansh-db
Copy link
Copy Markdown
Contributor

@Divyansh-db Divyansh-db commented Apr 8, 2026

Summary

  • Add default workspace ID support to all auto-generated Plugin Framework resources and data sources (34 resources, 65 data sources across 34 product areas)
  • Make provider_config.workspace_id optional+computed (previously required) so the provider auto-resolves the effective workspace ID when not explicitly set
  • Introduce UnifiedProviderClient interface in tfschema to decouple workspace ID helpers from *common.DatabricksClient, enabling testability
  • Add shared WorkspaceDriftDetection, ValidateWorkspaceID, and PopulateProviderConfigInState hooks to all generated resources, replacing inline validation logic
  • Add PopulateProviderConfigInStateForDataSource for data sources
  • Add ProviderConfigPlanModifier to all resources to prevent perpetual diffs when provider_config is absent from config
  • Add GetProviderWorkspaceID() and ValidateWorkspaceAccess() methods to DatabricksClient satisfying UnifiedProviderClient
  • Fix ValidateWorkspaceID to read from resp.Plan (not req.Plan) so it validates the workspace ID after drift detection updates
  • Update all generated docs to reflect workspace_id as optional

Test plan

  • 22 acceptance tests for databricks_tag_policy covering workspace-level and account-level provider
  • make test unit tests pass

This PR makes similar changes to #5542

NO_CHANGELOG=true

@Divyansh-db Divyansh-db requested review from a team as code owners April 8, 2026 13:30
@Divyansh-db Divyansh-db requested review from tejaskochar-db and removed request for a team and tejaskochar-db April 8, 2026 13:30
@Divyansh-db Divyansh-db force-pushed the divyansh-vijayvergia_data/pf-generated branch from ddd09bb to a1b62ed Compare April 9, 2026 12:10
@Divyansh-db Divyansh-db requested a review from tanmay-db April 9, 2026 12:13
@Divyansh-db Divyansh-db changed the title updated sdk with latest generator workspace_id support for Autogenerated Plugin Framework resources Apr 9, 2026
Copy link
Copy Markdown
Contributor

@tanmay-db tanmay-db left a comment

Choose a reason for hiding this comment

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

Great test coverage 🚀


// noOidcProviderFactories creates provider factories that skip the OidcConfigCustomizer.
// This is needed for account-level tests where auth is handled via client credentials,
// not github-oidc. Must be removed before committing to CI.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Must be removed before committing to CI.

Should we remove this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment thread exporter/exporter_test.go Outdated
},
},
}, func(ctx context.Context, client *common.DatabricksClient) {
client.Config.WorkspaceID = "123456789"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

since we use it in multiple places, abstract it out to a test provider workspace id?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@github-actions
Copy link
Copy Markdown
Contributor

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: 5570
  • Commit SHA: b07b5367c4cdb79298cf8d6ec368913a16b374ef

Checks will be approved automatically on success.

@Divyansh-db Divyansh-db enabled auto-merge April 16, 2026 15:32
@Divyansh-db Divyansh-db added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 5ea18ac Apr 16, 2026
11 of 12 checks passed
@Divyansh-db Divyansh-db deleted the divyansh-vijayvergia_data/pf-generated branch April 16, 2026 15:53
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.

2 participants