From 2ef90804c6223bffe25ee90515a6c354140cdebd Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Fri, 23 Apr 2010 08:17:15 +0000 Subject: [PATCH] Hydra/22: on job page, 'finished builds' shows nothing for old (non-current) jobs --- src/lib/Hydra/Controller/Job.pm | 8 ++++++++ src/root/job.tt | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Controller/Job.pm b/src/lib/Hydra/Controller/Job.pm index ab35ae3f..7079321d 100644 --- a/src/lib/Hydra/Controller/Job.pm +++ b/src/lib/Hydra/Controller/Job.pm @@ -27,6 +27,14 @@ sub overview : Chained('job') PathPart('') Args(0) { $c->stash->{currentBuilds} = [$c->stash->{job}->builds->search({iscurrent => 1}, { join => 'resultInfo', '+select' => ["resultInfo.releasename", "resultInfo.buildstatus"] , '+as' => ["releasename", "buildstatus"], order_by => 'system' })]; + + $c->stash->{lastBuilds} = [$c->stash->{job}->builds->search({}, { join => 'resultInfo', '+select' => ["resultInfo.releasename", "resultInfo.buildstatus"] + , '+as' => ["releasename", "buildstatus"], order_by => 'system', rows => 5 })]; + + $c->stash->{runningBuilds} = [$c->stash->{job}->builds->search({iscurrent => 1}, { join => ['schedulingInfo', 'project'] , order_by => ["priority DESC", "timestamp"] + , '+select' => ['project.enabled', 'schedulingInfo.priority', 'schedulingInfo.disabled', 'schedulingInfo.busy'] + , '+as' => ['enabled', 'priority', 'disabled', 'busy'] })]; + $c->stash->{systems} = [$c->stash->{job}->builds->search({iscurrent => 1}, {select => ["system"], distinct => 1})]; } diff --git a/src/root/job.tt b/src/root/job.tt index 338496a9..0d0933e4 100644 --- a/src/root/job.tt +++ b/src/root/job.tt @@ -17,12 +17,19 @@
-

Finished builds

+ [% IF currentBuilds.size != 0 %] +

Finished builds

[% INCLUDE renderBuildList builds=currentBuilds showStatusChange=0 %] - [% IF runningBuilds %] -

Running builds

- [% INCLUDE renderBuildList builds=runningBuilds showStatusChange=0 %] - [% END %] + [% ELSE %] + [% IF lastBuilds.size != 0 %] +

Last 5 builds

+ [% INCLUDE renderBuildList builds=lastBuilds showStatusChange=0 %] + [% END %] + [% END %] + [% IF runningBuilds.size != 0 %] +

Running builds

+ [% INCLUDE renderBuildList builds=runningBuilds showSchedulingInfo=1 hideResultInfo=1 %] + [% END %]

This job provides the following Nix channels: