Skip to content

Commit f36ecb0

Browse files
Fix comparison code to iterate more than 2 commits
1 parent 04fff4f commit f36ecb0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

site/src/comparison.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pub async fn handle_triage(
3535
let start_artifact = ctxt
3636
.artifact_id_for_bound(start.clone(), true)
3737
.ok_or(format!("could not find start commit for bound {:?}", start))?;
38+
let end_artifact = ctxt
39+
.artifact_id_for_bound(end.clone(), false)
40+
.ok_or(format!("could not find end commit for bound {:?}", end))?;
3841
// This gives a better error, but is still not great -- the common case here
3942
// is that we've had a 422 error and as such had a fork. It's possible we
4043
// could diagnose that and give a nicer error here telling the user which
@@ -49,8 +52,6 @@ pub async fn handle_triage(
4952
let mut num_comparisons = 0;
5053
let metric = Metric::InstructionsUser;
5154
let benchmark_map = ctxt.get_benchmark_category_map().await;
52-
// Track whether we are on the known last iteration
53-
let mut last_iteration = false;
5455

5556
let end = loop {
5657
let comparison = match compare_given_commits(
@@ -83,7 +84,7 @@ pub async fn handle_triage(
8384
populate_report(&comparison, &benchmark_map, &mut report).await;
8485

8586
// If we already know this is the last iteration, we can stop
86-
if last_iteration {
87+
if comparison.b.artifact == end_artifact {
8788
break before;
8889
}
8990

@@ -93,8 +94,6 @@ pub async fn handle_triage(
9394
// We keep doing comparisons...
9495
Some(n) => {
9596
before = next;
96-
// The next iteration is the last if the next bound is equal to the end bound
97-
last_iteration = n != end;
9897
next = n;
9998
}
10099
// There is no next commit so we stop.

0 commit comments

Comments
 (0)