You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: ensure '0' version is always sorted first (#4049)
Per the osv-schema:
> `introduced` allows a version of the value `"0"` to represent a
version that sorts before any other version.
Previously, we were just coercing "0" to be the general 0 value for the
ecosystem (e.g. in semver `0.0.0`).
This caused problems when trying to match e.g. `0.0.0-pre`, which sorts
before.
Wrapped all the sort_keys in a `VersionKey` type and added a new
sentinel `0` value type that always sorts before other versions.
This is technically incorrect for ecosystems where "0" is a valid
version and that supports pre-releases (e.g. in Maven `alpha` <
`0-alpha` < `0`) but these edge cases are not worth handling.
On an semi unrelated note, also bumped the max version that some invalid
versions get mapped to from `999999` to `9999999999` so that they're
larger than CalVer versions e.g. `20250607`
I'm going to have to do a re-computation/reput of the AffectedVersions
entities to make sure they're all still sorted.
0 commit comments