Skip to content

Commit 66aebe8

Browse files
Don't add rollup=never when perf does not deserve attention
1 parent dde69eb commit 66aebe8

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

site/src/github/comparison_summary.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ async fn summarize_run(
147147
Direction::Mixed => "❌✅ regressions and improvements",
148148
Direction::None => "no relevant changes",
149149
};
150-
let is_regression = deserves_attention_icount(&inst_primary, &inst_secondary)
151-
&& matches!(direction, Direction::Regression | Direction::Mixed);
150+
let deserves_attention = deserves_attention_icount(&inst_primary, &inst_secondary);
151+
let is_regression =
152+
deserves_attention && matches!(direction, Direction::Regression | Direction::Mixed);
152153

153154
writeln!(
154155
&mut message,
@@ -165,7 +166,7 @@ async fn summarize_run(
165166
.unwrap();
166167

167168
let next_steps = match source {
168-
PerfRunSource::TryBuild => try_run_body(is_regression),
169+
PerfRunSource::TryBuild => try_run_body(is_regression, deserves_attention),
169170
PerfRunSource::TryBuildRollup => "".to_string(),
170171
PerfRunSource::MasterCommit => master_run_body(is_regression),
171172
};
@@ -331,7 +332,7 @@ cc @rust-lang/wg-compiler-performance
331332
.to_string()
332333
}
333334

334-
fn try_run_body(is_regression: bool) -> String {
335+
fn try_run_body(is_regression: bool, deserves_attention: bool) -> String {
335336
let next_steps = if is_regression {
336337
"\n\n**Next, please**: If you can, justify the regressions found in \
337338
this try perf run in writing \
@@ -342,6 +343,15 @@ fn try_run_body(is_regression: bool) -> String {
342343
""
343344
};
344345

346+
// We mark PRs as rollup=never if perf deserves attention, so we don't need to debug the perf in the rollup
347+
// We don't remove `rollup=never` if perf does not deserve attention, as sometimes there are multiple perf. runs on the same PR,
348+
// and it's not always the case that the latest version that gets approved is the one for which we ran perf.
349+
let rollup_never = if deserves_attention {
350+
"@bors rollup=never"
351+
} else {
352+
""
353+
};
354+
345355
let sign = if is_regression { "+" } else { "-" };
346356
format!(
347357
"
@@ -350,7 +360,7 @@ It's automatically marked not fit for rolling up. \
350360
Overriding is possible but disadvised: \
351361
it risks changing compiler perf.{next_steps}
352362
353-
@bors rollup=never
363+
{rollup_never}
354364
@rustbot label: -S-waiting-on-perf {sign}perf-regression",
355365
)
356366
}

0 commit comments

Comments
 (0)