Skip to content

Conversation

@tanmay-db
Copy link
Contributor

@tanmay-db tanmay-db commented Oct 21, 2025

Changes

Support for unified provider for manual plugin framework resources.

To be merge after: #5115

Tests

Integration tests
Unit tests

@tanmay-db tanmay-db marked this pull request as ready for review October 21, 2025 13:06
@tanmay-db tanmay-db requested review from a team as code owners October 21, 2025 13:06
@tanmay-db tanmay-db requested review from Divyansh-db and removed request for a team and Divyansh-db October 21, 2025 13:06
var name types.String
resp.Diagnostics.Append(req.Config.GetAttribute(ctx, path.Root("name"), &name)...)
var workspaceID string
if !config.ProviderConfig.IsNull() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto, let's refactor this out to a separate method

@tanmay-db tanmay-db requested a review from mgyucht October 22, 2025 23:11
@alexott alexott requested a review from Copilot October 23, 2025 09:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds unified provider support for manual plugin framework resources and data sources by enabling the provider_config attribute. This allows resources and data sources to specify workspace-level configuration when the provider is configured at the account level.

Key changes:

  • Added GetWorkspaceIDResource and GetWorkspaceIDDataSource helper functions to extract workspace IDs from provider configuration
  • Added workspace ID validation using regex to ensure it contains only digits
  • Updated multiple data sources and the app resource to support the provider_config attribute with workspace ID extraction

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/providers/pluginfw/tfschema/unified_provider.go Added helper functions and validation for workspace ID extraction from provider config
internal/providers/pluginfw/tfschema/unified_provider_test.go Added comprehensive unit tests for workspace ID extraction functions
internal/providers/pluginfw/products//data_.go Updated data sources to support provider_config attribute and use unified provider client
internal/providers/pluginfw/products/app/resource_app.go Updated app resource to support provider_config attribute
internal/providers/pluginfw/products/app/data_app*.go Updated app data sources to support provider_config attribute
internal/providers/pluginfw/products/sharing/data_shares_acc_test.go Added acceptance tests for provider_config validation
common/client.go Refactored client methods to support both diagnostics and error return types
NEXT_CHANGELOG.md Documented the new feature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 41 to 42
attrs["workspace_id"] = attrs["workspace_id"].(StringAttributeBuilder).AddValidator(
stringvalidator.RegexMatches(regexp.MustCompile(`^\d+$`), "workspace_id must be a valid integer"))
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

The regex pattern is compiled on every call to ApplySchemaCustomizations. Consider defining the compiled regex as a package-level variable to avoid repeated compilation overhead.

Copilot uses AI. Check for mistakes.
Comment on lines 92 to 93
attrs["workspace_id"] = attrs["workspace_id"].(StringAttributeBuilder).AddValidator(
stringvalidator.RegexMatches(regexp.MustCompile(`^\d+$`), "workspace_id must be a valid integer"))
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

The regex pattern is compiled on every call to ApplySchemaCustomizations. Consider defining the compiled regex as a package-level variable to avoid repeated compilation overhead (same issue as in ProviderConfig).

Copilot uses AI. Check for mistakes.
),
}
return 0, fmt.Errorf("failed to parse workspace_id, please check if the workspace_id in provider_config is a valid integer: %w", err)

Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Remove the blank line before the closing brace to maintain consistent formatting.

Suggested change

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

One question, otherwise LGTM!

@github-actions
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: 5127
  • Commit SHA: 751fdb4f7ac30b0cc01d37bab428a87e7f34ba06

Checks will be approved automatically on success.

@tanmay-db tanmay-db added this pull request to the merge queue Oct 24, 2025
Merged via the queue into main with commit 49956d2 Oct 24, 2025
12 checks passed
@tanmay-db tanmay-db deleted the unified-tf-pluginfw-2 branch October 24, 2025 10:11
deco-sdk-tagging bot added a commit that referenced this pull request Oct 30, 2025
## Release v1.96.0

### New Features and Improvements

* Add `provider_config` support for manual plugin framework resources and data sources([#5127](#5127))

* Added support for custom instance profiles on instance pools on AWS ([#5144](#5144))
* Add `feature_engineering_materialized_feature` resource and data sources([#5166](#5166))

### Bug Fixes

* Remove unnecessary `SetSuppressDiff()` for `workload_size` in `databricks_model_serving` ([#5152](#5152)).

### Documentation

* Fix missing GCP IAM permissions for workspace creation in GCP guides ([#5123](#5123)).

### Internal Changes

* Caching group membership in `databricks_group_member` to improve performance ([#4581](#4581)).
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