Hirevo / alexandrie

An alternative crate registry, implemented in Rust.
https://hirevo.github.io/alexandrie/
Apache License 2.0
494 stars 55 forks source link

Fix index version requirement bug #134

Closed glennib closed 1 year ago

glennib commented 1 year ago

I wasn't able to push packages if a previous version of that package did exist. Now I've tried to redo the match_record function to return an option. It's None if there were no prior packages within that version range. Version ranges are also handled explicitly for cases where major is 0.

Should fix #109

Hirevo commented 1 year ago

Hi, thank you for the PR.
This bug was indeed a big issue that I left hanging for way too long, I'm very sorry about that.
While your fix looks correct, an earlier PR about this bug was already created (PR #124).

I have decided to merge that other PR instead of this one because of two reasons:

By passing the full ^{version} to semver (rather than ^{major}.0.0), it is able to do the correct checking logic on its own (including the special handling of 0.x.x versions), and so it requires less code on our side.

That being said, thanks a lot still for the contribution and sorry again for my delay in addressing this issue.

glennib commented 1 year ago

Great!