Skip to content

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.7.1-dev - December 10, 2025

✨ 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.

Comment on lines 94 to 97
DataSource: &schemaD.StringAttribute{
Computed: false,
Optional: true,
},
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.

The shortcut_conflict_policy attribute should not be included in the DataSource schema. This is a write-only parameter that controls behavior during resource creation/updates and is not returned by the API during reads. Data sources should only include attributes that can be read from the API.

Consider removing the entire DataSource section from this attribute definition (lines 94-97).

Suggested change
DataSource: &schemaD.StringAttribute{
Computed: false,
Optional: true,
},

Copilot uses AI. Check for mistakes.
Comment on lines +450 to +451
"shortcut_conflict_policy": string(fabcore.ShortcutConflictPolicyGenerateUniqueName),
"path": "Tables",
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.

The test should verify that the shortcut_conflict_policy attribute is properly set in the resource. Consider adding a test assertion after line 450 to check that the attribute value matches the expected value, for example:

resource.TestCheckResourceAttr(testResourceItemFQN, "shortcut_conflict_policy", string(fabcore.ShortcutConflictPolicyGenerateUniqueName)),

This ensures the new attribute is properly persisted and can be read back from the state.

Copilot uses AI. Check for mistakes.

Optional:

- `shortcut_conflict_policy` (String) 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.

Since shortcut_conflict_policy is a write-only parameter used only during resource creation/updates, it should not be documented as an attribute for the data source. This attribute is not returned by the API and cannot be read.

This documentation should be removed unless the schema is corrected to exclude this attribute from data sources.

Suggested change
- `shortcut_conflict_policy` (String) 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.

### Optional

- `shortcut_conflict_policy` (String) 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.

Since shortcut_conflict_policy is a write-only parameter used only during resource creation/updates, it should not be documented as an attribute for the data source. This attribute is not returned by the API and cannot be read.

This documentation should be removed unless the schema is corrected to exclude this attribute from data sources.

Suggested change
- `shortcut_conflict_policy` (String) 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.
},
"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%

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

2 participants