Skip to content

feat(shortcut): add new shortcut_conflict_policy for fabric_shortcut#770

Open
CatalinDabuleanu wants to merge 6 commits intomainfrom
catalindabuleanu/shortcut
Open

feat(shortcut): add new shortcut_conflict_policy for fabric_shortcut#770
CatalinDabuleanu wants to merge 6 commits intomainfrom
catalindabuleanu/shortcut

Conversation

@CatalinDabuleanu
Copy link
Contributor

📥 Pull Request

❓ What are you trying to address

This onboards new shortcut_conflict_policy attribute for fabric_shortcut. Closes #765

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Changelog Preview

v1.8.1-dev - March 11, 2026

✨ Added

  • #765 Onboard new shortcut_conflict_policy in fabric_shortcut

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 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_policy optional 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.

},
"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'",
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

[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'.",
Suggested change
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'.",

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Code Coverage

Package Line Rate Complexity Health
github.com/microsoft/terraform-provider-fabric/internal/auth 84% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/customtypes 66% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/planmodifiers 53% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/typeutils 50% 0
github.com/microsoft/terraform-provider-fabric/internal/framework/validators 69% 0
github.com/microsoft/terraform-provider-fabric/internal/functions 75% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/fabricitem 76% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/tftypeinfo 75% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/transforms 77% 0
github.com/microsoft/terraform-provider-fabric/internal/pkg/utils 85% 0
github.com/microsoft/terraform-provider-fabric/internal/provider/client 91% 0
github.com/microsoft/terraform-provider-fabric/internal/provider/config 100% 0
github.com/microsoft/terraform-provider-fabric/internal/provider 80% 0
github.com/microsoft/terraform-provider-fabric/internal/provider/utils 63% 0
github.com/microsoft/terraform-provider-fabric/internal/services/activator 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/apacheairflowjob 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/capacity 84% 0
github.com/microsoft/terraform-provider-fabric/internal/services/connection 72% 0
github.com/microsoft/terraform-provider-fabric/internal/services/connectionra 71% 0
github.com/microsoft/terraform-provider-fabric/internal/services/copyjob 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/dashboard 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/dataflow 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/datamart 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/datapipeline 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/deploymentpipeline 68% 0
github.com/microsoft/terraform-provider-fabric/internal/services/deploymentpipelinera 70% 0
github.com/microsoft/terraform-provider-fabric/internal/services/digitaltwinbuilder 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/domain 77% 0
github.com/microsoft/terraform-provider-fabric/internal/services/domainra 62% 0
github.com/microsoft/terraform-provider-fabric/internal/services/domainwa 71% 0
github.com/microsoft/terraform-provider-fabric/internal/services/environment 86% 0
github.com/microsoft/terraform-provider-fabric/internal/services/eventhouse 93% 0
github.com/microsoft/terraform-provider-fabric/internal/services/eventstream 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/eventstreamsourceconnection 83% 0
github.com/microsoft/terraform-provider-fabric/internal/services/folder 75% 0
github.com/microsoft/terraform-provider-fabric/internal/services/gateway 79% 0
github.com/microsoft/terraform-provider-fabric/internal/services/gatewayra 55% 0
github.com/microsoft/terraform-provider-fabric/internal/services/graphqlapi 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/itemjobscheduler 72% 0
github.com/microsoft/terraform-provider-fabric/internal/services/kqldashboard 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/kqldatabase 87% 0
github.com/microsoft/terraform-provider-fabric/internal/services/kqlqueryset 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/lakehouse 86% 0
github.com/microsoft/terraform-provider-fabric/internal/services/lakehousetable 80% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mirroreddatabase 84% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mirroredwarehouse 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mlexperiment 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mlmodel 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/mounteddatafactory 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/notebook 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/paginatedreport 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/report 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/semanticmodel 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/shortcut 79% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkcustompool 70% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkenvsettings 79% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkjobdefinition 89% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sparkwssettings 83% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sqldatabase 90% 0
github.com/microsoft/terraform-provider-fabric/internal/services/sqlendpoint 100% 0
github.com/microsoft/terraform-provider-fabric/internal/services/variablelibrary 90% 0
github.com/microsoft/terraform-provider-fabric/internal/services/warehouse 91% 0
github.com/microsoft/terraform-provider-fabric/internal/services/warehousesnapshot 90% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspace 79% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacegit 69% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacempe 77% 0
github.com/microsoft/terraform-provider-fabric/internal/services/workspacera 76% 0
Summary 76% (18901 / 24805) 0

Minimum allowed line rate is 40%

Computed: isList,
},
},
"actual_name": superschema.StringAttribute{
Copy link
Collaborator

Choose a reason for hiding this comment

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

this approach seems off,
do we need it if we do not support in the create new random name option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, if we do not support GenerateUniqueName we no longer need this attribute

@badeamarjieh badeamarjieh added this to the 2026-03 milestone Feb 3, 2026
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.

[FEAT] Add support for shortcutConflictPolicy in Shorcuts

4 participants