Skip to content

Crate details page: when a build has failed, display a message that links to last successful build #543

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

Merged
merged 3 commits into from
Jan 7, 2020
Merged

Conversation

yvrhdn
Copy link

@yvrhdn yvrhdn commented Jan 4, 2020

Implements part of #516.

When a build of a release failed and any other release was successfully built (before or after this release), this commit will add a message that links to the last successful build.
If no other release was built successfully, this message will not be displayed.

I had to extend test::fakes::FakeRelease a bit to be able to create a test with releases that had failed to build.

And I also adapted style.scss a bit:

  • div.info is the base styling of a message box
  • div.warning inherits all properties of div.info but sets background-color to orange

There might be cleaner ways to do this, I am not a SCSS expert 😅


Crate details page before this PR (https://docs.rs/crate/fie/0.16.2):

Screenshot 2020-01-04 at 01 09 26

Crate details page after this PR:

Screenshot 2020-01-04 at 01 07 40

The displayed link is /crate/fie/0.15.0, which will resolve to https://docs.rs/crate/fie/0.15.0

Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't run the code (on mobile) but it looks great! I'm very happy with how few changes you needed to get it working :)

The SCSS changes look reasonable but I haven't written SCSS before. @GuillaumeGomez do you mind reviewing?

@jyn514
Copy link
Member

jyn514 commented Jan 4, 2020

One more test request: can you add a test for when a build fails and then a later build succeeds? e.g. 0.1 fails and 0.2 succeeds, I would expect the error for 0.1 to have a link to 0.2.

After that I feel comfortable merging :)

@yvrhdn
Copy link
Author

yvrhdn commented Jan 4, 2020

I have added the extra test case 👍

@yvrhdn yvrhdn changed the title When a build fails, display a message that links to last successful build Crate details page: when a build has failed, display a message that links to last successful build Jan 4, 2020
@jyn514 jyn514 merged commit 0b16db9 into rust-lang:master Jan 7, 2020
@yvrhdn yvrhdn deleted the last_successful_build_#516 branch January 7, 2020 16:51
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 this pull request may close these issues.

2 participants