Skip to content

Track when crates are yanked and handle yanked status better #739

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 17 commits into from
May 6, 2020

Conversation

Nemo157
Copy link
Member

@Nemo157 Nemo157 commented May 1, 2020

  • mark releases as yanked when a yank is detected
  • show yanked status on crate details page
  • don't redirect to a yanked version if it's the latest
  • add test to load handlebars templates
  • Don't show latest version redirect to yanked versions
  • Allow loading yanked docs via exact version number
  • Show yanked status in nav on rustdoc pages
  • Show yanked status on crate details version list
  • Show yanked status in version drop down

I skipped 7a57350 from #322 to avoid any conflicts with #721, it may be useful to look into rebasing that too later.

fixes #112, #396
closes #322

Screenshots:

nav bar when viewing latest version and all versions are yanked:
image

nav bar when there's at least one non-yanked version, or viewing non-latest version of a fully yanked crate:
image

crate details page:
image

crate details version list:
image

crate details nav drop-down:
image

@jyn514
Copy link
Member

jyn514 commented May 1, 2020

cc @QuietMisdreavus :)

@Nemo157 Nemo157 force-pushed the bop-it-twist-it-yank-it branch from 0cea556 to 4c9a2e6 Compare May 1, 2020 19:42
@@ -180,11 +183,11 @@ impl CrateDetails {
description: rows.get(0).get(4),
rustdoc_status: rows.get(0).get(11),
target_name: rows.get(0).get(16),
default_target: rows.get(0).get(25),
default_target: rows.get(0).get(26),
Copy link
Member

Choose a reason for hiding this comment

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

Oh boy, we have some technical debt stacking up. Once this PR is in I think we should start think about getting things by name instead of by index: https://docs.rs/postgres/0.15.2/postgres/rows/struct.Row.html#method.get

Comment on lines 849 to 854
use html5ever::tendril::TendrilSink;
assert_success(path, web)?;
let data = web.get(path).send()?.text()?;
Ok(kuchiki::parse_html()
.one(data)
.select("form ul li .warn")
Copy link
Member

Choose a reason for hiding this comment

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

get_platform_links is pretty similar to this, do you think it's worth factoring out a html_select() function?

@Nemo157 Nemo157 force-pushed the bop-it-twist-it-yank-it branch 4 times, most recently from a07a4e4 to c6298d6 Compare May 1, 2020 21:09
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.

Comment on lines 31 to 32
.ok();
debug!("{}-{} yanked", krate.name, krate.version);
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as #746 (comment)

Comment on lines +1333 to +1336
assert_eq!(
env.frontend().get("/crate/dummy").send()?.status(),
StatusCode::NOT_FOUND
);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert_eq!(
env.frontend().get("/crate/dummy").send()?.status(),
StatusCode::NOT_FOUND
);
assert_eq!(
env.frontend().get("/crate/dummy").send()?.status(),
StatusCode::NOT_FOUND
);
assert_eq!(
env.frontend().get("/dummy").send()?.status(),
StatusCode::NOT_FOUND
);

@jyn514
Copy link
Member

jyn514 commented May 6, 2020

Whoops, I misread the changes. You addressed both the comments I linked.

@jyn514
Copy link
Member

jyn514 commented May 6, 2020

Looks good once nits have been addressed.

@Nemo157 Nemo157 force-pushed the bop-it-twist-it-yank-it branch 2 times, most recently from 8e15b27 to 3f855ec Compare May 6, 2020 09:11
@Nemo157 Nemo157 force-pushed the bop-it-twist-it-yank-it branch from 3f855ec to d51802c Compare May 6, 2020 13:16
@jyn514 jyn514 merged commit ece1b21 into rust-lang:master May 6, 2020
@Nemo157 Nemo157 deleted the bop-it-twist-it-yank-it branch May 6, 2020 13:47
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.

Hide yanked crate versions.
4 participants