Builder_db: get_all_failed, get_failed_builds: reconsider failed builds

As remarked by @reynir, consider builds with no main_binary as failed.
This commit is contained in:
Hannes Mehnert 2023-09-09 10:15:11 +02:00 committed by Reynir Björnsson
parent 8a70e76032
commit b27570ef11

View file

@ -283,7 +283,8 @@ module Build = struct
b.main_binary, b.input_id, b.user, b.job b.main_binary, b.input_id, b.user, b.job
FROM build b FROM build b
INNER JOIN job ON job.id = b.job INNER JOIN job ON job.id = b.job
WHERE b.result_code <> 0 AND ($3 IS NULL OR b.platform = $3) WHERE (b.result_code <> 0 OR (b.result_code = 0 AND b.main_binary IS NULL))
AND ($3 IS NULL OR b.platform = $3)
ORDER BY start_d DESC, start_ps DESC ORDER BY start_d DESC, start_ps DESC
LIMIT $2 LIMIT $2
OFFSET $1 OFFSET $1
@ -304,7 +305,8 @@ module Build = struct
result_code, result_msg, console, script, result_code, result_msg, console, script,
platform, main_binary, input_id, user, job platform, main_binary, input_id, user, job
FROM build FROM build
WHERE job = $1 AND result_code <> 0 WHERE job = $1
AND (result_code <> 0 OR (result_code = 0 AND main_binary IS NULL))
AND ($2 IS NULL OR platform = $2) AND ($2 IS NULL OR platform = $2)
ORDER BY start_d DESC, start_ps DESC ORDER BY start_d DESC, start_ps DESC
|} |}