Skip to content

Commit b57a5a4

Browse files
committed
Ensure link to compare page is always present
1 parent 372205d commit b57a5a4

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

site/src/github.rs

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -602,35 +602,41 @@ async fn summarize_run(ctxt: &SiteCtxt, commit: QueuedCommit, is_master_commit:
602602
please file an issue in [rust-lang/rustc-perf](https://github.com/rust-lang/rustc-perf/issues/new).";
603603
let footer = format!("{DISAGREEMENT}{errors}");
604604

605-
if !primary.is_relevant() && !secondary.is_relevant() {
606-
return format!("This benchmark run did not return any relevant results.\n\n{footer}");
607-
}
605+
let mut message = format!(
606+
"Finished benchmarking commit ({sha}): [comparison url]({comparison_url}).
607+
608+
**Summary**: ",
609+
sha = commit.sha,
610+
);
608611

609-
let primary_short_summary = generate_short_summary(&primary);
610-
let secondary_short_summary = generate_short_summary(&secondary);
612+
if !primary.is_relevant() && !secondary.is_relevant() {
613+
write!(
614+
&mut message,
615+
"This benchmark run did not return any relevant results.\n\n{footer}"
616+
)
617+
.unwrap();
618+
} else {
619+
let primary_short_summary = generate_short_summary(&primary);
620+
let secondary_short_summary = generate_short_summary(&secondary);
611621

612-
let mut summary = format!(
613-
r#"
622+
write!(
623+
&mut message,
624+
r#"
614625
- Primary benchmarks: {primary_short_summary}
615626
- Secondary benchmarks: {secondary_short_summary}
616-
"#
617-
);
618-
write!(summary, "\n\n").unwrap();
619-
620-
write_summary_table(&primary, &secondary, true, &mut summary);
621627
622-
write!(summary, "\n{footer}").unwrap();
628+
"#
629+
)
630+
.unwrap();
623631

624-
let direction = primary.direction().or(secondary.direction());
625-
let next_steps = next_steps(primary, secondary, direction, is_master_commit);
632+
write_summary_table(&primary, &secondary, true, &mut message);
626633

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

630-
**Summary**: {summary}
631-
{next_steps}",
632-
sha = commit.sha,
633-
)
639+
message
634640
}
635641

636642
fn next_steps(

0 commit comments

Comments
 (0)