Skip to content

Ensure link to compare page is always present #1291

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 1 commit into from
Apr 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions site/src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,35 +602,41 @@ async fn summarize_run(ctxt: &SiteCtxt, commit: QueuedCommit, is_master_commit:
please file an issue in [rust-lang/rustc-perf](https://github.com/rust-lang/rustc-perf/issues/new).";
let footer = format!("{DISAGREEMENT}{errors}");

if !primary.is_relevant() && !secondary.is_relevant() {
return format!("This benchmark run did not return any relevant results.\n\n{footer}");
}
let mut message = format!(
"Finished benchmarking commit ({sha}): [comparison url]({comparison_url}).

**Summary**: ",
sha = commit.sha,
);

let primary_short_summary = generate_short_summary(&primary);
let secondary_short_summary = generate_short_summary(&secondary);
if !primary.is_relevant() && !secondary.is_relevant() {
write!(
&mut message,
"This benchmark run did not return any relevant results.\n\n{footer}"
)
.unwrap();
} else {
let primary_short_summary = generate_short_summary(&primary);
let secondary_short_summary = generate_short_summary(&secondary);

let mut summary = format!(
r#"
write!(
&mut message,
r#"
- Primary benchmarks: {primary_short_summary}
- Secondary benchmarks: {secondary_short_summary}
"#
);
write!(summary, "\n\n").unwrap();

write_summary_table(&primary, &secondary, true, &mut summary);

write!(summary, "\n{footer}").unwrap();
"#
)
.unwrap();

let direction = primary.direction().or(secondary.direction());
let next_steps = next_steps(primary, secondary, direction, is_master_commit);
write_summary_table(&primary, &secondary, true, &mut message);

format!(
"Finished benchmarking commit ({sha}): [comparison url]({comparison_url}).
let direction = primary.direction().or(secondary.direction());
let next_steps = next_steps(primary, secondary, direction, is_master_commit);
write!(&mut message, "\n{footer}\n{next_steps}").unwrap();
}

**Summary**: {summary}
{next_steps}",
sha = commit.sha,
)
message
}

fn next_steps(
Expand Down