-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Enable Explicit toggling for sources (i.e. Enable/Disable) #5904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JohnMcPMS
requested changes
Dec 2, 2025
Member
JohnMcPMS
left a comment
There was a problem hiding this 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.
src/AppInstallerRepositoryCore/Public/winget/RepositorySource.h
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JohnMcPMS
reviewed
Dec 12, 2025
src/AppInstallerRepositoryCore/Public/winget/RepositorySource.h
Outdated
Show resolved
Hide resolved
src/AppInstallerRepositoryCore/Microsoft/PreIndexedPackageSourceFactory.cpp
Outdated
Show resolved
Hide resolved
JohnMcPMS
previously approved these changes
Dec 16, 2025
src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.dll.manifest
Show resolved
Hide resolved
JohnMcPMS
approved these changes
Dec 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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