We now have a searchBuildsAndEvalsForJobset, which creates such a mapping for us, so we don't need to duplicate code in jobs_tab and channels_tab.
Also, we're going to use this for the overview of a particular channel as well, so it makes sense to put it in CatalystUtils instead of directly in Jobset.pm.
Instead of eval->jobs, it's now eval->builds, because it's really an aggregate over the builds schema, rather than the job schema.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
TNIHMBCRFZO4FPMVYCQGPVFHRRYMXF24FPIUX2Q6SSHPDZYOEJ5QC
MNKXBLNCAGESRG3AUMII3F5NPPMOYKXJCKZNNAVHIBDA6Z6ZPHUAC
XA4U3RP6AQP665FQDVCGTZW2UXQQAT7W2M7GHP7OXVTCO6TQRZ7QC
TFPS7WQ24TM4C6MUUPBNYZ4F6ANCLTSRPQ2CNKH6J5O3WZFBXO5AC
ZWKPXRWYGSVX6IKUDHVN7LTOMSAWXKDBWUA53MESQCKRW7C3BYEQC
D7X6XTKQVG7SQTAIQ24SOVT6YHBHFKXDXB5GBPII6VK3CB4MYNTQC
AK2UZDS2IRVBZP3GRNZS2SIKMKEFUBPIVSA45EZBH4UYFKWI2HCAC
3HZY24CX4U2TO74HOY4YX3LBJIYF4DLXHCIY7J2RASAC4COMSMZAC
GEADFVZ5LXXFIE3VIP4UJ4AEI2VX57DXER47JA4IHH5BG3QNPAEAC
Z6FOXDECKALEON3WZVYXBQAOBYAJSLKYIBZO73NVCLV73IKA67NAC
6QRHXIM3XHCDLSIIBEGETDV67V6LTV55QMHC64ZPBMLTAECM5N3QC
QTC3SYBMNNTPZHQGXRMV5GU5KDODGXPIM3TIGWBAF7HDKNDKTCXQC
CQTN62OHT4DY35E2MJEG7GFTVNEE5KRDMV6ASBQLBHN7BUDK7WHAC
XU4PKY3UT67BMJYUQNLNGS5CNFP3TDK3PNON2K7MQIJF74J4JAVAC
RX7USXWQTA3K7KJJZKBEJ5XVCNA6DO7XCDGXNB2LMZ24BEWYKHKQC
SSMN5MPTOC6JN7WLWDUKAVEI2VUD4WB2ULOOJ6ELQDIESUT5M76QC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
KAZWI5G4DN2WUW7L2KWZR3D3QQJON4ISQYP7CRLC5HAOPIDYQGRQC
LGNML7VJCQ4E53ZYRGL5BNK6KVTNQGPJKFIULSAGSTU6VK45INMAC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
foreach my $eval (@evals) {
my @builds = $eval->builds->search(
{ job => { ilike => $filter }, ischannel => 0 },
{ columns => ['id', 'job', 'finished', 'buildstatus'] });
foreach my $b (@builds) {
my $jobName = $b->get_column('job');
$evals->{$eval->id}->{timestamp} = $eval->timestamp;
$evals->{$eval->id}->{jobs}->{$jobName} =
{ id => $b->id, finished => $b->finished, buildstatus => $b->buildstatus };
$jobs{$jobName} = 1;
$nrBuilds++;
}
last if $nrBuilds >= 10000;
}
foreach my $eval (@evals) {
my @builds = $eval->builds->search(
{ ischannel => 1 },
{ columns => ['id', 'job', 'finished', 'buildstatus'] }
);
foreach my $b (@builds) {
my $jobName = $b->get_column('job');
$evals->{$eval->id}->{timestamp} = $eval->timestamp;
$evals->{$eval->id}->{channels}->{$jobName} = {
id => $b->id,
finished => $b->finished,
buildstatus => $b->buildstatus
};
$channels{$jobName} = 1;
}
}
foreach my $b (@allBuilds) {
my $jobName = $b->get_column('job');
$evals->{$eval->id}->{timestamp} = $eval->timestamp;
$evals->{$eval->id}->{builds}->{$jobName} = {
id => $b->id,
finished => $b->finished,
buildstatus => $b->buildstatus
};
$builds{$jobName} = 1;
$nrBuilds++;
}
last if $maxBuilds && $nrBuilds >= $maxBuilds;
}
return ($evals, \%builds);
}
<td>[% r = evals.$eval.channels.$chan; IF r.id %]<a href="[% c.uri_for('/build' r.id) %]">[% INCLUDE renderBuildStatusIcon size=16 build=r %]</a>[% END %]</td>
<td>[% r = evals.$eval.builds.$chan; IF r.id %]<a href="[% c.uri_for('/build' r.id) %]">[% INCLUDE renderBuildStatusIcon size=16 build=r %]</a>[% END %]</td>
<td>[% r = evals.$eval.jobs.$j; IF r.id %]<a href="[% c.uri_for('/build' r.id) %]">[% INCLUDE renderBuildStatusIcon size=16 build=r %]</a>[% END %]</td>
<td>[% r = evals.$eval.builds.$j; IF r.id %]<a href="[% c.uri_for('/build' r.id) %]">[% INCLUDE renderBuildStatusIcon size=16 build=r %]</a>[% END %]</td>