Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring archived package versions when querying the registry #4004

Merged
merged 3 commits into from
Jun 19, 2023

Conversation

Michael-F-Bryan
Copy link
Contributor

Description

This PR updates the WapmSource to respect a package version's isArchived field. All packages with isArchived 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:

  • When running a package without a version constraint (i.e. wasmer run wasmer/python instead of wasmer run wasmer/[email protected]) we use the catch-all * version constraint to say "just give me the latest version".
  • You need to explicitly ask for pre-release versions - they won't be picked up by *
  • As far as semver is concerned, pre-releases (e.g. 3.12.0-build.5 or 3.12.0-beta) are considered to have a lower version number than their released version (i.e. 3.12.0).
  • The WapmSource wasn't respecting the isArchived flag when looking for packages that satisfy a constraint

This 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 explicitly wasmer run wasmer/[email protected] would work.

Fixes #4000

@Michael-F-Bryan Michael-F-Bryan force-pushed the ignore-archived-packages branch from a06d2e4 to 5d5180f Compare June 16, 2023 11:59
@Michael-F-Bryan Michael-F-Bryan force-pushed the ignore-archived-packages branch from 5d5180f to b6fd6de Compare June 16, 2023 14:01
@Michael-F-Bryan Michael-F-Bryan force-pushed the ignore-archived-packages branch from b6fd6de to e16952a Compare June 19, 2023 06:27
@Michael-F-Bryan Michael-F-Bryan merged commit eb3dbda into master Jun 19, 2023
@Michael-F-Bryan Michael-F-Bryan deleted the ignore-archived-packages branch June 19, 2023 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to run the wasmer/python package
3 participants