fix get_latest_successful_with_binary to only return builds with main_binary

so-called successful builds. in a756f2c..3b98605f there were regressions
(missing this condition in get_latest_succesful_with_binary,
get_next_successful_different_output, get_previous_successful_different_output).
This commit is contained in:
Hannes Mehnert 2023-11-22 12:23:00 +01:00
parent bf35e3fbae
commit 6c4f36bfba

View file

@ -320,7 +320,7 @@ module Build = struct
FROM build b
LEFT JOIN build_artifact a ON
b.main_binary = a.id
WHERE b.job = $1 AND b.platform = $2
WHERE b.job = $1 AND b.platform = $2 AND b.main_binary IS NOT NULL
ORDER BY b.start_d DESC, b.start_ps DESC
LIMIT 1
|}
@ -348,6 +348,7 @@ module Build = struct
FROM build b, build b0, build_artifact a, build_artifact a0
WHERE b0.id = ? AND b0.job = b.job AND
b.platform = b0.platform AND
b.main_binary IS NOT NULL AND
a.id = b.main_binary AND a0.id = b0.main_binary AND
a.sha256 <> a0.sha256 AND
(b0.start_d > b.start_d OR b0.start_d = b.start_d AND b0.start_ps > b.start_ps)
@ -364,6 +365,7 @@ module Build = struct
FROM build b, build b0, build_artifact a, build_artifact a0
WHERE b0.id = ? AND b0.job = b.job AND
b.platform = b0.platform AND
b.main_binary IS NOT NULL AND
a.id = b.main_binary AND a0.id = b0.main_binary AND
a.sha256 <> a0.sha256 AND
(b0.start_d < b.start_d OR b0.start_d = b.start_d AND b0.start_ps < b.start_ps)