KG5AMUMGZA53FMA35K3KYOPJTNG3BKWDFWDPVXJ6XGG2GJJRI2LAC
3U3CXCDWYL3MHNHANECWQBRDFXXH3QIR5V6WXJXERWOKVTFQMQZAC
Q4VDOA762MDHLJKNJMPLHFYRRACCT3DQXF66ZTVMETZCR52B72OQC
3HZY24CX4U2TO74HOY4YX3LBJIYF4DLXHCIY7J2RASAC4COMSMZAC
G4X5IUYJHZSEXAGFG5DRIJEHFBSQDQ2UTIJ4FCILIPZAUHGQ3GTQC
UMFB2767NMAG46NAG3XHMYQMCLF5TMVN46SST4AM2CFUEMNZH3WQC
RSEGBU6CIEDRNTL7R6Q7RF2IZGCN3HH6VTPGFBKD77LSHEUD6EKAC
U4TD3AIQXBJFFUORTMIC4IHZTVBORRKL2TZ2FSP4G665ECZOEMNAC
DE2DNCOIEVRA6OOSOSXI2USRPOWL4SC6XPCJFOUM54BS2ESCEWOAC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
OEPUOUNBNTHTFZVDXREGBQCKFRCWMVP2MDVK4OA47VK2DBKEWVYAC
$c->stash->{evals} = [ $c->stash->{jobset}->jobsetevals->search(
{ hasnewbuilds => 1 },
{ order_by => "id DESC"
, '+select' => # !!! Slow - should precompute this.
[ "(select count(*) from JobsetEvalMembers where eval = me.id)"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 0))"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 1))"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 1 and b.buildStatus = 0))"
]
, '+as' => [ "nrBuilds", "nrScheduled", "nrFinished", "nrSucceeded" ]
, rows => 6
}
) ];
$c->stash->{evals} = getEvals($self, $c, 0, 6);
}
sub getEvals {
my ($self, $c, $offset, $rows) = @_;
return [ $c->stash->{jobset}->jobsetevals->search(
{ hasnewbuilds => 1 },
{ order_by => "id DESC"
, '+select' => # !!! Slow - should precompute this.
[ "(select count(*) from JobsetEvalMembers where eval = me.id)"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 0))"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 1))"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 1 and b.buildStatus = 0))"
]
, '+as' => [ "nrBuilds", "nrScheduled", "nrFinished", "nrSucceeded" ]
, rows => $rows
, offset => $offset
}
) ];
$c->stash->{evals} = [ $c->stash->{jobset}->jobsetevals->search(
{ hasnewbuilds => 1 },
{ order_by => "id DESC"
, '+select' => # !!! Slow - should precompute this.
[ "(select count(*) from JobsetEvalMembers where eval = me.id)"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 0))"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 1))"
, "(select count(*) from JobsetEvalMembers where eval = me.id and exists(select 1 from Builds b where b.id = build and b.finished = 1 and b.buildStatus = 0))"
]
, '+as' => [ "nrBuilds", "nrScheduled", "nrFinished", "nrSucceeded" ]
, rows => $resultsPerPage + 1
, offset => ($page - 1) * $resultsPerPage
}
) ];
$c->stash->{evals} = getEvals($self, $c, ($page - 1) * $resultsPerPage, $resultsPerPage + 1)
[% INCLUDE renderEvals nrShown=5 linkToAll=c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name]) %]
[% INCLUDE renderEvals nrShown=evals.size() - 1 linkToAll=c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name]) %]