-
Notifications
You must be signed in to change notification settings - Fork 472
[Feature] Add unified provider support for manual plugin framework resources and data sources #5127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| var name types.String | ||
| resp.Diagnostics.Append(req.Config.GetAttribute(ctx, path.Root("name"), &name)...) | ||
| var workspaceID string | ||
| if !config.ProviderConfig.IsNull() { |
There was a problem hiding this comment.
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
There was a problem hiding this 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
GetWorkspaceIDResourceandGetWorkspaceIDDataSourcehelper 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_configattribute 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.
| attrs["workspace_id"] = attrs["workspace_id"].(StringAttributeBuilder).AddValidator( | ||
| stringvalidator.RegexMatches(regexp.MustCompile(`^\d+$`), "workspace_id must be a valid integer")) |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
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.
| attrs["workspace_id"] = attrs["workspace_id"].(StringAttributeBuilder).AddValidator( | ||
| stringvalidator.RegexMatches(regexp.MustCompile(`^\d+$`), "workspace_id must be a valid integer")) |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
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).
| ), | ||
| } | ||
| return 0, fmt.Errorf("failed to parse workspace_id, please check if the workspace_id in provider_config is a valid integer: %w", err) | ||
|
|
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
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.
mgyucht
left a comment
There was a problem hiding this 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!
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
## 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)).
Changes
Support for unified provider for manual plugin framework resources.
To be merge after: #5115
Tests
Integration tests
Unit tests