Skip to content

Conversation

@dkbennett
Copy link
Member

@dkbennett dkbennett commented Dec 1, 2025


Closes #5797
This issue was related to enabling/disabling a source without removing it. Functionally in WinGet this is already captured with the "Explicit" property, where a source is not included unless it is explicitly referenced. This is effectively equivalent to a "disabled" source. In examining this problem we determined the best way to resolve this is to allow editing of a source's properties, specifically the "Explicit" property, without having to remove and re-add a source, which is problematic with default sources. This PR implements that solution to allow editing of a Source's properties, starting with the Explicit property. This works on User defined sources and Default sources. In terms of policy, Edit follows Remove; if you can remove a source you can edit that source. If you cannot remove the source, then you cannot edit the source either.

This PR Introduces a new experimental feature, "sourceEdit" which has this new editing behavior. The user experience is not final so we are keeping it behind sourceEdit for now for testing and refinement.

New functionality: source edit subcommand
This allows a source to be edited without removing/readding. This currently only supports the "Explicit" property of a source, and includes User sources and Default sources (such as the winget-font source).

Aliases for this command: set and config

Example1: winget source edit -n winget --explicit true
This will make the winget source explicit.

Example2: winget source edit -n winget-font -e false
This will make the winget-font source no longer explicit.

This interface is probably going to change later, which is one of the reasons why we are using the experimental feature.

Key implementation detail is the addition of an "IsOverride" property to the SourceDetailsInternal which functions similar to IsTombstone, only instead of deleting the source it overrides some of the source's properties, currently the "Explicit" property. This is needed for the Default sources. For user sources the update is straightforward.

image

Tested

  • Added CLI tests for the default source override validation
  • Added E2E tests for the command validation
  • Manual verification of the command functionality.
Microsoft Reviewers: Open in CodeFlow

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@dkbennett dkbennett marked this pull request as ready for review December 1, 2025 21:18
@dkbennett dkbennett requested a review from a team as a code owner December 1, 2025 21:18
Copy link
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

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

All updates to the interface should include COM and PowerShell consideration.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback Issue needs attention from issue or PR author label Dec 2, 2025
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Dec 15, 2025
@dkbennett dkbennett requested a review from JohnMcPMS December 15, 2025 21:17
JohnMcPMS
JohnMcPMS previously approved these changes Dec 16, 2025
@dkbennett dkbennett merged commit 23b033e into microsoft:master Dec 17, 2025
9 checks passed
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Attention Issue needs attention from Microsoft label Dec 17, 2025
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.

Disable Source without Removing it

2 participants