Skip to content

Show latest stable version on search result page #654

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

Closed
badboy opened this issue Mar 29, 2017 · 3 comments · Fixed by #3179
Closed

Show latest stable version on search result page #654

badboy opened this issue Mar 29, 2017 · 3 comments · Fixed by #3179
Labels
A-backend ⚙️ C-bug 🐞 Category: unintended, undesired behavior

Comments

@badboy
Copy link
Member

badboy commented Mar 29, 2017

Currently it seems to show the latest released version, even if it is a pre-release.

Example: https://crates.io/search?q=bincode
I see: bincode v1.0.0-alpha6

Following the link I get to bincode v0.6.1

It should show v0.6.1 on the search page as well.

@carols10cents
Copy link
Member

Thank you! This is related to, but slightly different from, #510.

@briansmith
Copy link

Not sure if this is the same thing, but pages like https://crates.io/categories/cryptography also show prerelease (e.g. alpha) versions instead of showing the latest stable version.

@carols10cents carols10cents added the C-bug 🐞 Category: unintended, undesired behavior label Aug 2, 2017
@locks locks self-assigned this Sep 6, 2019
@Turbo87
Copy link
Member

Turbo87 commented Mar 31, 2020

I just had a quick look at this as it was labeled "A-ember". The problem is that from the API we only get max_version (highest version; semver order) and newest_version (the most recently updated version), but both include prereleases. I guess this would need to be changed on the API side, so that max_version only considers regular releases, but not prereleases. Unfortunately, I can't judge whether that might break anything else... 😞

@locks locks removed their assignment Apr 19, 2020
bors added a commit that referenced this issue Jan 7, 2021
EncodableCrate: Add `max_stable_version` field

This PR resolves the API part of #654 by adding a `max_stable_version` field for the `krate` resource. Since naming is hard, it is called `highest_stable` internally on the `TopVersions` struct. Contrary to `newest_version` and `max_version` this field will be `null` (not `"0.0.0"`) if all available versions have been yanked.

r? `@jtgeibel`
bors added a commit that referenced this issue Jan 11, 2021
mirage/crate: Add derived `max_stable_version` field

This PR implements #3163 for our fake testing API on the frontend to eventually address #654

r? `@pichfl`
bors added a commit that referenced this issue Jan 14, 2021
Simplify `crate.version` route implementation

This PR adds a `defaultVersion` property on the `crate` model and uses it in the `crate.version` (and `crate.index`) route to determine which version to display by default. This lets us get rid of the `semver` dependency in that route and puts the backend in charge of telling us what to display by default. This will allow us to address #654 in the near future, since the new `defaultVersion` property can be used in the search results too.

This is probably best reviewed commit-by-commit :)

r? `@pichfl`
@bors bors closed this as completed in 452a5c8 Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants