microsoft / microsoft/winget-cli

Support redirecting manifests

Open
#1,899 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Sometimes a package id gets changed. Usually this happens when the publisher changes, or when the community has determined a better approach for organizing manifests. When this happens, users who have packages.json files could be broken, and the install of those packages that have been moved will fail.

Proposed technical implementation details

Current thinking is that we would leverage a new YAML file "Redirect.yaml". This file would be placed in the package directory (as opposed to the version directories) as a signal that the package has been moved. The client would be able to understand what to install.

Examples:

Foo.Bar has been redirected to Contoso.Bar

winget install Foo.Bar would inform the user that the package has been redirected to Contoso.Bar, and Contoso..Bar would be installed.

>winget install Foo.Bar
Found Bar [Foo.Bar]. The package has been redirected to Bar [Contoso.Bar].
Found Bar [Contoso.Bar] Version 2.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://www.contoso.com/bar.exe
  ██████████████████████████████  1.77 MB / 1.77 MB
Successfully verified installer hash
Starting package install...
Successfully installed

winget upgrade Foo.Bar Upgrading a package that has been redirected.

>winget upgrade Foo.Bar
Found Bar [Foo.Bar]. The package has been redirected to Bar [Contoso.Bar]. 
Found Bar [Contoso.Bar] Version 2.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://www.contoso.com/bar.exe
  ██████████████████████████████  1.77 MB / 1.77 MB
Successfully verified installer hash
Starting package install...
Successfully installed

If a user were to perform a search, the "old" package would not be displayed by default.

winget search -e --id Foo.Bar - No package found

>winget search Foo.Bar
"No package found matching input criteria."

winget search -e --id Foo.Bar --includeRedirected - Foo.Bar is found and has been redirected to Contoso.Bar

The UX for displaying redirected packages may not fit well in the current table format. Suggestions are welcome.


Settings would be added to change default behavior.

"searchFilters": {
  "redirectedPackages": "include"
}

The default behavior would be to exclude.

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 tracing the existing winget install, winget upgrade, and winget search command flows described in the issue, along with the proposed searchFilters.redirectedPackages setting. Determine how a package-level Redirect.yaml would be discovered and represented, then define behavior for redirected installs, upgrades, searches, and the default exclusion setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.