Ignoring archived package versions when querying the registry #4004
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the
WapmSource
to respect a package version'sisArchived
field. All packages withisArchived
set will now be ignored while determining which versions satisfy the query.Context
We were seeing #4000 because of a combination of semver quirks and not respecting a package version's
isArchived
flag:wasmer run wasmer/python
instead ofwasmer run wasmer/[email protected]
) we use the catch-all*
version constraint to say "just give me the latest version".*
3.12.0-build.5
or3.12.0-beta
) are considered to have a lower version number than their released version (i.e.3.12.0
).WapmSource
wasn't respecting theisArchived
flag when looking for packages that satisfy a constraintThis all meant that when faced with the following versions for
wasmer/python
...3.12.0-build.5
3.12.0-build.2
(archived)3.12.0
(archived)3.12.0-build.4
(archived)3.12.0-build.3
(archived)... We'll always pick version
3.12.0
(which is broken) because it has the "highest" version number that matches*
.Hence why running
wasmer run wasmer/python
would fail but explicitlywasmer run wasmer/[email protected]
would work.Fixes #4000