microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.35k stars 1.45k forks source link

Ability to sequence upgrades #4877

Open mdanish-kh opened 1 month ago

mdanish-kh commented 1 month ago

Scenario

When I run winget upgrade --all, upgrades are sequenced in a seemingly random order. This can mean that many packages that have a quick upgrade experience (CLIs, small dev tools) have to wait on upgrades that can take an hour or so either because of long install time (IDEs like Visual Studio, JetBrains) or long download time (in case of 1GB+ installer).

Proposal

  1. As a user it would help if I can specify a preference list in user settings for packages that should be upgraded first and packages that should be upgraded last. The CLI can then see the two lists and sequence the upgrade available packages accordingly. Something like:
    "upgradeSequencePreference": {
        "upgradeFirst": [
            "Git.Git",
            "junegunn.fzf",
            "JanDeDobbeleer.OhMyPosh"
        ],
        "upgradeLast": [
            "Microsoft.VisualStudio.2022.Community",
            "JetBrains.dotUltimate"
        ]
    }

The packages that aren't in either list would be determined by the same random order as they are right now.

  1. For packages that have a long download time, could it be possible that validation pipelines collect file size information and populate it in the index. The CLI can then implicitly sequence those packages to be upgraded last