Skip to content

Redirect to latest version does not work if build failed #502

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
jyn514 opened this issue Nov 30, 2019 · 1 comment · Fixed by #509
Closed

Redirect to latest version does not work if build failed #502

jyn514 opened this issue Nov 30, 2019 · 1 comment · Fixed by #509

Comments

@jyn514
Copy link
Member

jyn514 commented Nov 30, 2019

This is actually a combination of a number of issues:

  1. If you go to https://docs.rs/isatty/0.1.0/isatty/, the link to the latest version takes you to https://docs.rs/isatty/0.2.0/isatty/?search=isatty
  2. isatty 0.2.0 failed its build
  3. /isatty/0.2.0/isatty/ gives a 404

#325 fixed this for /isatty/0.2.0/isatty, so the issue is that /:crate/:version/:target/ behaves differently than /:crate/:version/:target.

We can't just change the redirect to link to /:crate/:version/:target, since ?search= doesn't work on that page. Maybe the easiest thing would be to link to /:target and have the redirect to /:target/ keep the search query parameter?

@jyn514
Copy link
Member Author

jyn514 commented Dec 7, 2019

Perhaps it would be a better idea to not show 'go to latest version' for failed builds? That would hit the majority of use cases. For this particular case though I think we really should show 0.2.0 so people see the 'this crate is deprecated' message.

jyn514 added a commit to jyn514/docs.rs that referenced this issue Dec 7, 2019
Closes rust-lang#502

The redirector behaved differently for `/:crate/:version/:target` than
for `/:crate/:version/:target/`. This changes the latest version link to
use the former, since it properly accounts for failed builds.

Additionally, this changes the `/:target` redirect to keep the query
parameter so that `?search=` URLs will be kept.
jyn514 added a commit to jyn514/docs.rs that referenced this issue Feb 19, 2020
Closes rust-lang#502

The redirector behaved differently for `/:crate/:version/:target` than
for `/:crate/:version/:target/`. This changes the latest version link to
use the former, since it properly accounts for failed builds.

Additionally, this changes the `/:target` redirect to keep the query
parameter so that `?search=` URLs will be kept.
jyn514 added a commit that referenced this issue Feb 23, 2020
Closes #502

The redirector behaved differently for `/:crate/:version/:target` than
for `/:crate/:version/:target/`. This changes the latest version link to
use the former, since it properly accounts for failed builds.

Additionally, this changes the `/:target` redirect to keep the query
parameter so that `?search=` URLs will be kept.
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

Successfully merging a pull request may close this issue.

1 participant