Skip to content

Commit 5c26009

Browse files
committed
Pr Feedback - handle where a try commit could have no parent
1 parent f30fa0f commit 5c26009

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

database/src/pool/postgres.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,8 @@ where
14201420
statuses: &[BenchmarkRequestStatus],
14211421
days: Option<i32>,
14221422
) -> anyhow::Result<Vec<BenchmarkRequest>> {
1423+
// There is a small period of time where a try commit's parent_sha
1424+
// could be NULL, this query will filter that out.
14231425
let mut query = "
14241426
SELECT
14251427
tag,
@@ -1432,7 +1434,8 @@ where
14321434
backends,
14331435
profiles
14341436
FROM benchmark_request
1435-
WHERE status = ANY($1) "
1437+
WHERE status = ANY($1)
1438+
AND (commit_type <> 'try' OR parent_sha IS NOT NULL) "
14361439
.to_string();
14371440

14381441
// Optionally add interval

0 commit comments

Comments
 (0)