-
Notifications
You must be signed in to change notification settings - Fork 201
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
Make "Go to latest version" point to /latest/ #1562
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
Sorry, forgot to comment along with the push. I updated along the lines we discussed, but I'm still struggling with getting some of the tests to pass. I think I don't fully understand what they're doing yet. If you have a chance to take a look I'd appreciate, otherwise I can probably puzzle through it next weekend. |
@jsha hmm, so this seems like a larger problem - |
target-redirect does appear to support
|
Ok great, I think you can just update the tests to match the new behavior then :) |
Alright, I've got almost all of them updated, except this one, which now gets a 404:
I don't really understand - what's the expected behavior when all versions are yanked? Do I need to add code such that target-redirect will go to a yanked version if there's no unyanked version available? |
Previously, the behaviour when all versions were yanked is that you could not load the crate using any of the semver/wildcard requests, only an exact version number would load; and if you were on an old version of the crate then it would show a link to the latest version still. I'm not sure what the behaviour should be after this change, changing the latest version link on those pages to |
By "drop the latest version redirect in those cases," you mean don't generate the link in the header? |
Exactly. |
Alright, I checked and that's actually the current behavior - no link is generated when all versions are yanked. So I pulled out the failing redirect_latest_with_all_yanked test because it was testing a behavior that doesn't happen. Should be ready to go! |
Still trying to get tests to pass, but figured I'd post up what I've got so far.