Skip to content
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

Improve matching logic with multiple sources #1663

Open
denelon opened this issue Nov 2, 2021 · 3 comments
Open

Improve matching logic with multiple sources #1663

denelon opened this issue Nov 2, 2021 · 3 comments
Labels
Area-Matching Issue related to correlation between installed package and manifest Issue-Feature This is a feature request for the Windows Package Manager client.

Comments

@denelon
Copy link
Contributor

denelon commented Nov 2, 2021

Description of the new feature / enhancement

When one or more results are returned from all configured sources apply additional logic to help improve client behavior.

Specifically, when a user runs winget install <query> and the value in is either the PackageIdentifier, PackageName or Moniker for only one package, that package should be installed.

If more than one package matches in any of the three fields, the user must still disambiguate which result they want installed.

This would impact "install", "show", "upgrade", and "uninstall".

Proposed technical implementation details

No response

@denelon denelon added the Issue-Feature This is a feature request for the Windows Package Manager client. label Nov 2, 2021
@ghost ghost added the Needs-Triage Issue need to be triaged label Nov 2, 2021
@denelon denelon removed the Needs-Triage Issue need to be triaged label Nov 2, 2021
@denelon
Copy link
Contributor Author

denelon commented Nov 2, 2021

Precedence on "Id", "Name", and "Moniker" was selected due to the results of a search query where the "Id" and "Name" are always displayed. The Windows Terminal supports copy/paste shortcuts so those two fields were selected. As the "Id" doesn't contain any spaces, it negates the need to quote the value for command-line operations.

The priority would be "Id" as it is unique to a source, and does not contain spaces.
Then the "Name" as it is displayed in search results.
Finally, the "Moniker" is often a commonly known term, so if no other package has the requested value for "Id" or "Name", moniker is considered unique enough to disambiguate a requested package.

Note, the flow for matching a package against manifests is used in "Show", "Search", "Install", "Upgrade", and "Uninstall". Of these, "search" is the most permissive looking for substring matches (by default with no options configured) across multiple fields. The other commands use a more refined logic to attempt to find a single best match result to display or act on.

@denelon
Copy link
Contributor Author

denelon commented Nov 8, 2021

@Trenly
Copy link
Contributor

Trenly commented Jun 16, 2023

[Policy] Area-Matching

@microsoft-github-policy-service microsoft-github-policy-service bot added the Area-Matching Issue related to correlation between installed package and manifest label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Matching Issue related to correlation between installed package and manifest Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

No branches or pull requests

2 participants