microsoft / microsoft/winget-cli

Use installed version for package disambiguation

Open
#1,951 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Matching Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Description of the new feature / enhancement

I'm not sure if this is a bug or a new feature, since I see some stuff happening with versions in the logs. I'm marking it as a feature for now, under the presumption that providing the user expectation of how it functions will lead to more meaningful triage and discussion.


There are times when multiple matching packages are found, especially during upgrade or export.
One of the best examples of this is OBSProject.OBSStudio and OBSProject.OBSStudio.Pre-release
I've captured the logs of upgrade and export here

While we are waiting for #147 OBS Studio has been split into these separate packages, as have many others. The key factor here is that there are no matching versions in these two packages.

image


I currently have version 27.1.3 installed on my system. Given that this version does not exist in OBSProject.OBSStudio.Pre-release, this should be a disambiguating factor which clearly points to which of the two packages I have installed

Proposed technical implementation details

If multiple matches are found for a package, get the current version the user has installed. I'll refer to this as INSALLED_VERSION for clarity.

  • If INSTALLED_VERSION is unknown, do not disambiguate by version
  • If INSTALLED_VERSION does not exist for any matching package identifier, do not disambiguate by version
  • If INSTALLED_VERSION exists in more than one matching package identifier, do not disambiguate by version
  • If INSTALLED_VERSION exists in exactly one package identifier, ensure that the disambiguation is valid, and then select the matching package identifier as correct; A warning to the user may be appropriate, to cover the edge case where the source may be missing a version

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked upgrade and export logs and tracing where multiple matching package identifiers are disambiguated. Use the proposed installed-version cases as acceptance criteria: select an identifier only when the installed version exists in exactly one match and otherwise leave disambiguation unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.