-
Notifications
You must be signed in to change notification settings - Fork 645
Latest Version of Crate Does Not Show For Alpha Versions #1144
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
Comments
I think they do need to be yanked. The reason is that we don't want to recommend prerelease versions if there are non-prerelease versions; we made this change in #577. What I suspect is happening is that when we look to see if there are non-prerelease versions, we're not checking to make sure there are non-prerelease, non-yanked versions. |
Another example: https://crates.io/crates/apint This crate currently has only prerelease versions without any yanked non-prerelease versions, and the prerelease versions are recommended: https://crates.io/crates/shoop |
I'll pick this up. Very well-defined issue! |
Another test case which will require some more logic (expands the "Has only prerelease versions, the largest prerelease version should be recommended" test case)
Edit: This doesn't really apply, see message below |
Unfortunately half of the logic here lives on the server-side which allows for issues to re-appear undetected. https://github.com/rust-lang/crates.io/blob/master/src/krate/mod.rs#L421-L431
This currently sets the latest non-yanked version as the max-version of the crate which helps us in the happy case, meaning we can skip checking if the latest version in yanked in general. However, if this filter goes away, the front-end will happily render the latest version even if it's yanked. It seems like the right approach here would be either to remove the yanked check on the backend and always return the latest version (or even no version at all), letting the front-end decide on what to recommend, or include the pre-release checks in the backend, basically removing the need to override the max_version on the front-end since whatever the backend marks as max_version would be the version to use here as well. Any recommendations around this? |
Hi! Sorry for the delay on this! I'm not sure what to do either! I'm not sure if there are other places that either the frontend or backend use the max version logic that might be impacted if we move all the logic to one or the other. Maybe try one and see if any tests fail? Our test coverage isn't that great though... My other concern is if anyone is making use of this value from the backend JSON API, in which case we shouldn't remove it, but if it's giving wrong/inconsistent information we should fix it. I think your pull request is relevant regardless and would fix this issue at least, so I'm going to work on merging that now! |
From the discussion in #1158:
|
Is this issue still being worked on? |
Since there hasn't been any activity in almost two years, I don't think this is still actively being worked on. Feel free to work on this if you are interested. You can build on top of @behos' work, but it's probably somewhat out of date for the current codebase. |
Hi, I have came back after relearning JavaScript >.< . |
I believe this can be closed now per #1857 ,@carols10cents ? |
My original reproduction steps no longer lead the bug. Closing now. |
Example: https://crates.io/crates/turtle (example will work until I publish a non-alpha version)
Test case:
Problem:
crates.io does not display the 1.0.0-alpha.0 version. If your 0.x.x versions are yanked, it will actually display:
Viewing the other versions shows that there is a 1.0.0-alpha.0.
That means that it isn't finding that the latest version of the crate is 1.0.0-alpha.0 (possibly due to the -alpha.0 at the end). It still believes the 0.x.x versions are the latest.
Both cargo itself and docs.rs seem to work. If you use a "*" as your version, cargo will download the alpha correctly. If you just go to the crate URL on docs.rs, it'll redirect you correctly.
Instructions to fix added by carol:
version
has ayanked
boolean property accessible viaversion.get('yanked')
.The text was updated successfully, but these errors were encountered: