Conversation
mdanish-kh
reviewed
Feb 4, 2026
| Type = DefaultSourceType, | ||
| TrustLevel = TrustedTrustLevel, | ||
| Explicit = true, | ||
| Priority = 42, |
Contributor
There was a problem hiding this comment.
I see what you did there
Member
Author
There was a problem hiding this comment.
On obviously arbitrary number for testing purposes only...
Contributor
In such a scenario (for a single result as you mentioned), it may be worth checking if one of the sources returned version "Unknown" for the package (common with |
florelis
previously approved these changes
Feb 5, 2026
florelis
previously approved these changes
Feb 5, 2026
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
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.
Implements #1488
Change
Adds the concept/value of priority to sources. This is an integer value (default 0) where greater numbers are sorted first. This is an editable value of a source. Priority has been added to the following interfaces:
sourceadd/edit/list/export)sourceresourceSources are sorted by priority in the list of sources, which has minor effects such as changing the order in
source listand the order of available sources when constructing the default composite source. That default composite ordering has always had the effect of making equal match type/field results dependent on the order, but now the priority can affect the third order sorting.The larger effect is when multiple sources return results for an operation targeting available packages (ex.
install). In this case, if there is only one result amongst the sources at the highest returned priority, then that will be used instead of producing an error about multiple results. For example, if all sources return one result and the priorities are { Source A = 2, Source B = 1, Source C = 0 }, then the result from Source A would be installed without any additional user input (although a warning is output to indicate this has happened). But if the priorities are { Source A = 2, Source B = 2, Source C = 0 }, then an error similar to the existing one will be presented with only the A and B source results.REST match criteria
A TODO has also been resolved in the REST source code that evaluates the match criteria of REST results so that they may be sorted properly amongst the winget-pkgs results. Previously they were always using default values (0s) which would cause them to be sorted first.
Validation
Added tests across the spectrum of use.
Microsoft Reviewers: Open in CodeFlow