Skip to content

Update yanked after crates are already built #614

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
sunjay opened this issue Feb 15, 2020 · 9 comments
Closed

Update yanked after crates are already built #614

sunjay opened this issue Feb 15, 2020 · 9 comments
Assignees

Comments

@sunjay
Copy link
Member

sunjay commented Feb 15, 2020

There was a very similar bug in crates.io two years ago and now it seems to have popped up on docs.rs too: rust-lang/crates.io#1144

All the details are in that bug (just replace crates.io/crates with docs.rs), but I'll describe it here as well.

Reproduction Steps

To reproduce the bug, go to https://docs.rs/turtle

Expected: This should redirect to the latest version: https://docs.rs/turtle/1.0.0-rc.3
Actual: You are taken to an old version: https://docs.rs/turtle/0.1.3

More Details

This doesn't happen for crates that already have a non-alpha/non-rc latest version (e.g. https://docs.rs/serde)

This was working until recently. Something must have changed in the last few weeks to cause this bug.

Interestingly, the "Go to latest version" link still appears and works as expected. It's just the version resolution for the URL that isn't working as expected anymore.


Update: Looking into it further, it seems to be an intentional change made as part of #223. So I guess the real bug is that yanked versions aren't being considered when we filter for the versions available. For example, for the turtle crate used in the steps above, all the non-alpha/non-rc versions are yanked. So docs.rs should choose the latest alpha/rc version instead of loading docs for a yanked version.

@sunjay
Copy link
Member Author

sunjay commented Feb 15, 2020

If docs.rs doesn't currently deal with yanked crates, an easy workaround just for my particular case might be to delete the old non-1.0 versions of the turtle crate. I asked for that in #158 a few years ago, but I guess no one had a chance to get around to it.

@jyn514
Copy link
Member

jyn514 commented Feb 15, 2020

This is a very strange bug to see, because we explicitly filter out yanked versions in the match_version query: https://github.com/rust-lang/docs.rs/blob/master/src/web/mod.rs#L231. Maybe we didn't store that the version was yanked for some reason?

@sunjay
Copy link
Member Author

sunjay commented Feb 15, 2020

Maybe these versions were published before that information started being stored?

@jyn514 jyn514 changed the title Redirect to latest alpha/rc version if there are no non-yanked other versions Update yanked for crates built before it was tracked Feb 16, 2020
@jyn514
Copy link
Member

jyn514 commented Feb 16, 2020

This doesn't need to be fixed in code then I think, I can just write a one-off shell script.

@jyn514 jyn514 self-assigned this Feb 16, 2020
@jyn514
Copy link
Member

jyn514 commented Feb 16, 2020

Ah so the problem is we never update the yanked field 🤦‍♂️ This is #322

@jyn514 jyn514 changed the title Update yanked for crates built before it was tracked Update yanked after crates are already built Feb 16, 2020
@sunjay
Copy link
Member Author

sunjay commented Apr 22, 2020

@jyn514 any update on this issue? Is there a way to fix this?

@jyn514
Copy link
Member

jyn514 commented Apr 22, 2020

@sunjay see #322 (comment)

@Nemo157
Copy link
Member

Nemo157 commented May 6, 2020

with #739 yanked is now automatically updated for new crates, and @jyn514 has just imported missing yanks up to now, so https://docs.rs/turtle now redirects to the latest prerelease.

@Nemo157 Nemo157 closed this as completed May 6, 2020
@sunjay
Copy link
Member Author

sunjay commented May 6, 2020

Thanks! This is awesome. Everything works really well now 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants