Uh oh!
There was an error while loading. Please reload this page.
Enable Explicit toggling for sources (i.e. Enable/Disable) - #5904
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JohnMcPMS
left a comment
There was a problem hiding this comment.
All updates to the interface should include COM and PowerShell consideration.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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:
setandconfigExample1:
winget source edit -n winget --explicit trueThis will make the winget source explicit.
Example2:
winget source edit -n winget-font -e falseThis 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.
Tested
Microsoft Reviewers: Open in CodeFlow