-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for or default to using max_stable_version
when fetching crate info
#8666
Comments
max_stable_version
when getting crate info from https://crates.io/api/v1/crates/:crate_namemax_stable_version
when fetching crate info
max_stable_version
when fetching crate infomax_stable_version
when fetching crate info
I'm not necessarily opposed to this - showing stable versions in preference to unstable is our usual behaviour for version badges - but I'd like to understand more first. By normal semver rules both
Where we have only unstable releases to choose from, we'd usually pick the numerically latest one. I can't seem to find any docs for it, but how does I'm trying to avoid specifically tagging @calebcartwright into things, but this specific issue might be a good one for you to weigh in on. |
@chris48s thanks for taking a gander. So, on crates.io, e.g. https://crates.io/crates/ucan/versions, hash.max_stable_version = versionNums.find(it => !prerelease(it, { loose: true })) ?? null; |
@chris48s, additionally, I think this note hints that crates have moved off max_version directly ~ https://github.com/rust-lang/crates.io/blob/20bbac9f5521cb4888ef63f8464fddb28fd973f5/src/views.rs#L214. |
There's been some increased chatter this year on both internals and rfcs/cargo in the Rust ecosystem around some of the nuance and challenges of semver handling, particularly with prerelease versions. I assume that's indeed being reflected in the different values within the api response we're seeing given the inherently necessary coupling between cargo and crates, and that we should indeed utilize |
Are you experiencing an issue with...
shields.io
馃悶 Description
A Rust project I've contributed to, called ucan (and ucan-key-support), recently transitioned from (higher-versioned) alpha releases to a stable 0.1.0 release. However, the badge is not getting updated (https://img.shields.io/crates/v/ucan.svg), as it uses the max_version, per this line of code: https://github.com/badges/shields/blob/master/services/crates/crates-version.service.js#L22. In viewing the crate information via https://crates.io/api/v1/crates/ucan, should it use the
max_stable_version
if it exists, defaulting tomax_version
otherwise? Here's what the crate data returns:馃敆 Link to the badge
https://img.shields.io/crates/v/ucan.svg
https://img.shields.io/crates/v/ucan-key-support.svg
馃挕 Possible Solution
No response
The text was updated successfully, but these errors were encountered: