Skip to content

Commit f365f30

Browse files
Merge pull request #1369 from nnethercote/gh-comments-1
cc @rust-lang/wg-compiler-performance on master perf regressions.
2 parents e61f35d + ce166c4 commit f365f30

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

site/src/github.rs

+22-21
Original file line numberDiff line numberDiff line change
@@ -727,37 +727,38 @@ fn next_steps(
727727
is_master_commit: bool,
728728
) -> String {
729729
let deserves_attention = deserves_attention_icount(&primary, &secondary);
730-
let label = match (deserves_attention, direction) {
731-
(true, Some(Direction::Regression | Direction::Mixed)) => "+perf-regression",
732-
_ => "-perf-regression",
730+
let (is_regression, label) = match (deserves_attention, direction) {
731+
(true, Some(Direction::Regression | Direction::Mixed)) => (true, "+perf-regression"),
732+
_ => (false, "-perf-regression"),
733733
};
734734

735735
if is_master_commit {
736-
master_run_body(label)
736+
master_run_body(is_regression)
737737
} else {
738738
try_run_body(label)
739739
}
740740
}
741741

742-
fn master_run_body(label: &str) -> String {
743-
let next_steps = if label.starts_with("+") {
744-
"\n\n**Next Steps**: If you can justify the \
745-
regressions found in this perf run, please indicate this with \
746-
`@rustbot label: +perf-regression-triaged` along with \
747-
sufficient written justification. If you cannot justify the regressions \
748-
please open an issue or create a new PR that fixes the regressions, \
749-
add a comment linking to the newly created issue or PR, \
750-
and then add the `perf-regression-triaged` label to this PR."
742+
fn master_run_body(is_regression: bool) -> String {
743+
if is_regression {
744+
"
745+
**Next Steps**: If you can justify the \
746+
regressions found in this perf run, please indicate this with \
747+
`@rustbot label: +perf-regression-triaged` along with \
748+
sufficient written justification. If you cannot justify the regressions \
749+
please open an issue or create a new PR that fixes the regressions, \
750+
add a comment linking to the newly created issue or PR, \
751+
and then add the `perf-regression-triaged` label to this PR.
752+
753+
@rustbot label: +perf-regression
754+
cc @rust-lang/wg-compiler-performance
755+
"
751756
} else {
752-
""
753-
};
754-
755-
format!(
756757
"
757-
{next_steps}
758-
759-
@rustbot label: {label}",
760-
)
758+
@rustbot label: -perf-regression
759+
"
760+
}
761+
.to_string()
761762
}
762763

763764
fn try_run_body(label: &str) -> String {

0 commit comments

Comments
 (0)