feat(operations_agent): onboard new Operations Agent resource and data source #911
feat(operations_agent): onboard new Operations Agent resource and data source #911catalina-gav wants to merge 6 commits intomainfrom
Conversation
Changelog Previewv1.9.2-dev - April 28, 2026✨ Added
🪲 Fixed |
There was a problem hiding this comment.
Pull request overview
Adds first-class Terraform support for Microsoft Fabric Operations Agent items by introducing a new fabric_operations_agent resource plus singular/plural data sources, including provider registration, tests, examples, and generated documentation.
Changes:
- Implement
fabric_operations_agentresource (definition + properties) and register it in the provider. - Implement
fabric_operations_agentandfabric_operations_agentsdata sources (read by id/name + list). - Add unit/acceptance tests, examples, fixtures, fake-server support, and generated docs/changelog entries.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/testhelp/fixtures/operations_agent/Configurations.json.tmpl | Adds an Operations Agent definition fixture for tests. |
| internal/testhelp/fakes/fake_server.go | Registers Operations Agent handlers in the fake server. |
| internal/testhelp/fakes/fabric_operations_agent.go | Adds fake Operations Agent entity + definition operations for unit tests. |
| internal/services/operationsagent/base.go | Defines Operations Agent type info and supported definition formats/paths. |
| internal/services/operationsagent/base_test.go | Wires shared type info/constants for operationsagent tests. |
| internal/services/operationsagent/models.go | Adds Terraform model mapping for Operations Agent properties (state). |
| internal/services/operationsagent/schema_resource_operations_agent.go | Defines resource-side properties.state schema. |
| internal/services/operationsagent/schema_data_operations_agent.go | Defines data-source-side properties.state schema. |
| internal/services/operationsagent/resource_operations_agent.go | Implements the Operations Agent resource using the shared fabricitem helpers. |
| internal/services/operationsagent/resource_operations_agent_test.go | Adds unit + acceptance tests for Operations Agent resource CRUD + import + definition behavior. |
| internal/services/operationsagent/data_operations_agent.go | Implements singular Operations Agent data source (by id or display_name, optional definition output). |
| internal/services/operationsagent/data_operations_agent_test.go | Adds unit + acceptance tests for singular Operations Agent data source. |
| internal/services/operationsagent/data_operations_agents.go | Implements plural Operations Agents data source (list). |
| internal/services/operationsagent/data_operations_agents_test.go | Adds unit + acceptance tests for plural Operations Agents data source. |
| internal/provider/provider.go | Registers the new resource and data sources with the provider. |
| examples/resources/fabric_operations_agent/resource.tf | Adds resource usage examples (with and without definition). |
| examples/resources/fabric_operations_agent/providers.tf | Adds provider setup for the resource examples. |
| examples/resources/fabric_operations_agent/outputs.tf | Outputs the example resource. |
| examples/resources/fabric_operations_agent/import.sh | Adds import example for the resource. |
| examples/data-sources/fabric_operations_agent/data-source.tf | Adds singular data source examples (by id/name and with definition output). |
| examples/data-sources/fabric_operations_agent/providers.tf | Adds provider setup for the singular data source examples. |
| examples/data-sources/fabric_operations_agent/outputs.tf | Outputs the singular data source examples. |
| examples/data-sources/fabric_operations_agents/data-source.tf | Adds plural data source example (list). |
| examples/data-sources/fabric_operations_agents/providers.tf | Adds provider setup for the plural data source example. |
| examples/data-sources/fabric_operations_agents/outputs.tf | Outputs the plural data source example. |
| docs/resources/operations_agent.md | Adds generated documentation for the new resource. |
| docs/data-sources/operations_agent.md | Adds generated documentation for the singular data source. |
| docs/data-sources/operations_agents.md | Adds generated documentation for the plural data source. |
| .changes/unreleased/added-20260408-105129.yaml | Changelog entry for the new resource. |
| .changes/unreleased/added-20260408-105059.yaml | Changelog entry for the new data source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Minimum allowed line rate is |
| } | ||
|
|
||
| func TestAcc_OperationsAgentsDataSource(t *testing.T) { | ||
| if testhelp.ShouldSkipTest(t) { |
There was a problem hiding this comment.
since there are no E2Es, can you try to make some operations with it manually (get, get definition and properties for DS, CRUD + definition manual cover for resource)
There was a problem hiding this comment.
ran the E2E tests locally without skipping them and they pass
| const ( | ||
| FabricItemType = fabcore.ItemTypeOperationsAgent | ||
| ItemDefinitionEmpty = `{}` | ||
| ItemDefinitionEmpty = `{"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/operationsAgents/definition/1.0.0/schema.json","configuration": {"goals": "","instructions": "","dataSources": {},"actions": {}},"shouldRun": false}` |
There was a problem hiding this comment.
should the schema be here? what about other items?
📥 Pull Request
❓ What are you trying to address
Close #899
Close #900