-
Notifications
You must be signed in to change notification settings - Fork 212
Link to last successful build when build fails #516
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
Comments
I want to make it a link, not a redirect, so people know that it's an old version. |
Actually maybe this would be better served by implementing #341, #396 at the same time and just putting it in the 'Redirect to Latest Version' button at the top? 'Latest Version' is no longer an accurate description then ... 'latest successful stable version' is closer but way too verbose to put in a link. |
Hmm ... but in this case I think people would want to know the latest version is released even if there's no docs. I think separate links is fine. Relevant code: https://github.com/rust-lang/docs.rs/blob/master/templates/crate_details.hbs#L65 |
The way to get started with this would be to
|
Hi, I would like to work on this 👋 Can you assign me? 🙂 |
I did some analysis, just to make sure I'm changing the right things 😉 So the main issue: if the build of a release of a crate fails, a user should be able to find the most recent successful build fairly simple. There a two places this causes a problem: Crate details pageIf a build failed (for example fie-0.16.2), currently an error message is showed: We can extend the error message with a quick link: "The most recent successful build is fie-0.15.0" I also propose extending the "Versions" segment in the left column. I think it would be nice to show a little icon ( Navigation headerAnother place with a possibly problematic link is the navigation bar. Let's take as example this crate Maybe we can split this up and show two messages instead:
ChangesSo changes I would like to implement:
Feedback and comments are welcome! |
Yes, and moreover usually it's the latest release which failed a build (at least if the user sees the message at all).
Yes, that's about what I was imagining.
That would be really great! I hadn't though of that :)
I am not opposed to fixing this, but there are many issues with the current 'latest version' calculation and I think that would be better as a separate PR. See #396, #502, #223, #341, #513 for related issues. |
So in other words, 1. and 2. are very welcome but it may be better to hold off on 3. for a while. |
I don't have a strong opinion either way. @GuillaumeGomez you do more of the CSS/styling, do you have a preference? |
I prefer the separate box myself. |
With #543 and #546 merged, I think this issue can be closed? I think the following refactorings in crate_details.rs would be good as well, but I'm not sure if we should pursue them now or wait until we feel more comfortable with the codebase. I wouldn't mind adding some tests and making a PR for this. Possible refactorings:
|
I'm fine with making I'm also not sure I understand the rationale for a separate crate_details_page. I know having fields for the templates unchecked by the compiler is not ideal, but I don't see how making that a separate .rs file would help with that.
I would be interested to see this query, I tried to write it and my SQL wasn't good enough 😆 the problem I ran into was that we have an array of different versions. I guess we could just concatenate them ( Finally, I would like to see a lot more tests before we make refactorings like this. |
I'll put a PR together in the next few days.
I think this could be avoided by either:
This wouldn't do anything for the templates. The biggest advantage imo is that it communicates intent a lot better.
This query could populate most fields of CrateDetails (this is basically the existing query minus SELECT crates.id,
releases.id,
crates.name,
releases.version,
releases.description,
releases.authors,
releases.dependencies,
releases.readme,
releases.description_long,
releases.release_time,
releases.build_status,
releases.rustdoc_status,
releases.repository_url,
releases.homepage_url,
releases.keywords,
releases.have_examples,
releases.target_name,
crates.github_stars,
crates.github_forks,
crates.github_issues,
releases.is_library,
releases.doc_targets,
releases.license,
releases.documentation_url
FROM releases
INNER JOIN crates ON releases.crate_id = crates.id
WHERE crates.name = $1 AND releases.version = $2; And then this query could be used to populate SELECT version, build_status
FROM releases
WHERE crate_id = $1; The output should be something like:
And agreed, it works fine now. |
I thought about this while investigating why https://docs.rs/crate/hyper/0.13.0 failed to build - the reason this usually matters to library authors is because new users/users upgrading see an error instead of the docs. If there a version of the docs, even an out of date version, I imagine that would make the failures much less critical for library authors.
The text was updated successfully, but these errors were encountered: