From d9dc7ca18bcd3342eb16e8ebd0eca943c9ecd2ed Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 28 Oct 2020 13:29:02 +0100 Subject: [PATCH] getPreviousBuild: Get previous build in the job, not jobset Broken since 8adb433e3. --- src/lib/Hydra/Helper/CatalystUtils.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Helper/CatalystUtils.pm b/src/lib/Hydra/Helper/CatalystUtils.pm index 9121428b..b1c51b82 100644 --- a/src/lib/Hydra/Helper/CatalystUtils.pm +++ b/src/lib/Hydra/Helper/CatalystUtils.pm @@ -46,11 +46,13 @@ sub getBuild { sub getPreviousBuild { my ($build) = @_; return undef if !defined $build; + # FIXME: slow return $build->jobset->builds->search( { finished => 1 , system => $build->system , 'me.id' => { '<' => $build->id } - , -not => { buildstatus => { -in => [4, 3]} } + , job => $build->job + , -not => { buildstatus => { -in => [4, 3]} } }, { rows => 1, order_by => "me.id DESC" })->single; }