LMETCA7G76HUDV2ZVOOIH6TI6UG7RJ5VCZNWRAAZVIQOWG6XLX5QC
3Y7AFJSSMMEXQEHA6O4UXYXY3YPP7G55ZG72U2WXFMZKOZDEKGKAC
DE2DNCOIEVRA6OOSOSXI2USRPOWL4SC6XPCJFOUM54BS2ESCEWOAC
UXXFND4UYVY6WHWPRL3YIRKWTGFM3PR32JZCYKYNQOX7MZAFEG5AC
3HZY24CX4U2TO74HOY4YX3LBJIYF4DLXHCIY7J2RASAC4COMSMZAC
U4TD3AIQXBJFFUORTMIC4IHZTVBORRKL2TZ2FSP4G665ECZOEMNAC
FPK5LF53CFUEKFYJ3IYXT4UTVC6IITWJOCFATMC4PLHEUP5SIEAAC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
my ($eval) = $c->stash->{jobset}->jobsetevals->search(
{ hasnewbuilds => 1 },
{ order_by => "id DESC", rows => 1
, where => \ "not exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.finished = 0)"
});
notFound($c, "No evaluation found.") unless defined $eval;
my $eval = getLatestFinishedEval($c, $c->stash->{jobset})
or notFound($c, "No evaluation found.");
($eval2) = $j->jobsetevals->search(
{ hasnewbuilds => 1 },
{ order_by => "id DESC", rows => 1
, where => \ "not exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.finished = 0)"
});
$eval2 = getLatestFinishedEval($c, $j);
}
sub getLatestFinishedEval {
my ($c, $jobset) = @_;
my ($eval) = $jobset->jobsetevals->search(
{ hasnewbuilds => 1 },
{ order_by => "id DESC", rows => 1
, where => \ "not exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.finished = 0)"
});
return $eval;