feat(shortcut): add new shortcut_conflict_policy for fabric_shortcut#770
feat(shortcut): add new shortcut_conflict_policy for fabric_shortcut#770CatalinDabuleanu wants to merge 6 commits intomainfrom
Conversation
Changelog Previewv1.8.1-dev - March 11, 2026✨ Added
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new shortcut_conflict_policy attribute to the fabric_shortcut resource, enabling users to control how conflicts are handled when a shortcut with the same name and path already exists. The attribute accepts values like Abort, CreateOrOverwrite, GenerateUniqueName, and OverwriteOnly, with Abort as the default.
Key Changes:
- Added
shortcut_conflict_policyoptional string attribute to the resource schema with enum validation - Updated resource Create, Update, and Read methods to handle the new policy parameter
- Extended the model to include the new field and properly serialize it to API requests
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
internal/services/shortcut/schema.go |
Adds the shortcut_conflict_policy attribute definition to the schema with validators for allowed enum values |
internal/services/shortcut/models.go |
Extends resourceShortcutModel with the new field and implements setter/getter methods to handle the policy parameter |
internal/services/shortcut/resource_shortcut.go |
Updates Create, Update, and Read operations to use the new conflict policy parameter when interacting with the API |
internal/services/shortcut/resource_shortcut_test.go |
Adds test coverage for the new attribute in the acceptance test's Create step |
examples/resources/fabric_shortcut/resource.tf |
Adds example usage of the new shortcut_conflict_policy attribute with a comment explaining the default behavior |
docs/resources/shortcut.md |
Documents the new optional attribute with its description and valid values |
docs/data-sources/shortcuts.md |
Documents the attribute for the data source (though this may be incorrect as it's a write-only parameter) |
docs/data-sources/shortcut.md |
Documents the attribute for the data source (though this may be incorrect as it's a write-only parameter) |
.changes/unreleased/added-20251209-215321.yaml |
Changelog entry documenting the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/services/shortcut/schema.go
Outdated
| }, | ||
| "shortcut_conflict_policy": superschema.StringAttribute{ | ||
| Common: &schemaR.StringAttribute{ | ||
| MarkdownDescription: "When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'", |
There was a problem hiding this comment.
[nitpick] The markdown description is missing a period at the end. For consistency with other attribute descriptions in the schema, add a period:
MarkdownDescription: "When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'.",| MarkdownDescription: "When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'", | |
| MarkdownDescription: "When provided, it defines the action to take when a shortcut with the same name and path already exists. The default action is 'Abort'.", |
Minimum allowed line rate is |
internal/services/shortcut/schema.go
Outdated
| Computed: isList, | ||
| }, | ||
| }, | ||
| "actual_name": superschema.StringAttribute{ |
There was a problem hiding this comment.
this approach seems off,
do we need it if we do not support in the create new random name option?
There was a problem hiding this comment.
No, if we do not support GenerateUniqueName we no longer need this attribute
…r-fabric into catalindabuleanu/shortcut
📥 Pull Request
❓ What are you trying to address
This onboards new
shortcut_conflict_policyattribute forfabric_shortcut. Closes #765