-
Notifications
You must be signed in to change notification settings - Fork 16
feat(digital_twin_builder_flow): Onboard new fabric_digital_twin_buil… #668
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
base: main
Are you sure you want to change the base?
Conversation
…der_flow Data Source and Resource
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 onboards a new fabric_digital_twin_builder_flow Data Source and Resource to the Terraform provider for Microsoft Fabric, adding support for managing Digital Twin Builder Flow items.
- Implements the Digital Twin Builder Flow resource with full CRUD operations
- Adds corresponding data sources for both single and multiple Digital Twin Builder Flows
- Includes comprehensive test coverage for both unit and acceptance tests
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/services/digitaltwinbuilderflow/base.go | Defines core constants and configuration for Digital Twin Builder Flow item type |
| internal/services/digitaltwinbuilderflow/resource_digital_twin_builder.go | Implements the resource configuration for Digital Twin Builder Flow |
| internal/services/digitaltwinbuilderflow/data_digital_twin_builder_flow.go | Implements single Digital Twin Builder Flow data source |
| internal/services/digitaltwinbuilderflow/data_digital_twin_builder_flows.go | Implements multiple Digital Twin Builder Flows data source |
| internal/provider/provider.go | Registers the new resources and data sources with the provider |
| examples/ | Provides usage examples for the new resources and data sources |
| docs/ | Auto-generated documentation for the new functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
internal/services/digitaltwinbuilderflow/resource_digital_twin_builder_flow_test.go
Outdated
Show resolved
Hide resolved
…_builder_flow_test.go Co-authored-by: Copilot <[email protected]>
| "definition.json" = { | ||
| source = "${local.path}/definition.json.tmpl" | ||
| tokens = { | ||
| "DIGITAL_TWIN_BUILDER_ID" = "Item ID of the parent lakehouse that exists in the workspace" |
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.
replace with 11111111-1111-1111-1111-111111111111 instead of the description since it's an id
| DefinitionFormats: itemDefinitionFormats, | ||
| } | ||
|
|
||
| return fabricitem.NewResourceFabricItemDefinition(config) |
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.
I see that the digital twin builder flow can have either creationPayload or definition and that the dataflow object has also the properties attribute, so NewResourceFabricItemConfigDefinitionProperties should be used
(https://learn.microsoft.com/en-us/rest/api/fabric/digitaltwinbuilderflow/items/create-digital-twin-builder-flow?tabs=HTTP#response)
| DefinitionFormats: itemDefinitionFormats, | ||
| } | ||
|
|
||
| return fabricitem.NewDataSourceFabricItemDefinition(config) |
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 digital twin builder flow also has properties, so NewDataSourceFabricItemDefinitionProperties should be used. add the corresponding properties model and setter
| } | ||
| } | ||
| } | ||
| } |
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.
add an example for creationPayload
| FabricItemType: FabricItemType, | ||
| } | ||
|
|
||
| return fabricitem.NewDataSourceFabricItems(config) |
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.
same as the others, it's an item with properties so NewDataSourceFabricItemsProperties should be used
| })) | ||
| } | ||
|
|
||
| func TestAcc_DigitalTwinBuilderFlowResource_CRUD(t *testing.T) { |
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.
I think it would be easier to follow if you split this testing func into 3 different functions, one for item with definition, without definition and with configuration (see eventhouse for eg)
…der_flow Data Source and Resource
📥 Pull Request
❓ What are you trying to address
Onboard new
fabric_digital_twin_builder_flowData Source and Resource. This closes #661 #662