microsoft / microsoft/winget-cli
Warn if manifest is using a newer schema version
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Description of the new feature / enhancement
As more features and functionality are added to winget, new versions of the manifest schema are created to support these features. Often times new Installer Types or other functionality don't constitute breaking changes, but are not supported in older versions of winget.
winget should be able to explain this to the user in a helpful way, either as a warning (for minor schema updates) or an error (for major schema updates, like 1.x -> 2.x). There's a case to be made for it only being an error, but sometimes new schemas only add metadata fields that aren't relevant to whether winget can install a package, so I think it should just be a warning and the user can decide to abort if they want.
C:\Users\epillay> winget install Mozilla.Firefox
Found Mozilla Firefox [Mozilla.Firefox] Version 98.0
Warning: This manifest is using a newer version of the Windows Package Manager schema than this client supports.
We'll attempt to install the package anyway, but it is recommended that you check the Microsoft Store for updates.
<...>
or
C:\Users\epillay> winget install Mozilla.Firefox
Found Mozilla Firefox [Mozilla.Firefox] Version 98.0
Error: This manifest is using a newer version of the Windows Package Manager schema than this client supports.
This client is unable to use the new manifest for installation. Update App Installer in the Microsoft Store to continue.
C:\Users\epillay> # Darn!
Proposed technical implementation details
I don't know if the pre-indexed source currently sends along ManifestVersion, but it would need to for this to work. I'm almost certain the REST source doesn't, but I haven't looked at it in a hot second.
If anyone cares, prior art exists for this in NPM (and I'm sure other package managers). I've seen this quite a few times when Node isn't up-to-date in CI environments:
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1,
but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the winget install path and check how the pre-indexed and REST sources provide ManifestVersion. Define handling for minor versus major schema versions, then verify the warning or error output and resulting installation behavior.
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
- 42/100