* The "latest" channel shouldn't contain inactive jobs.

This commit is contained in:
Eelco Dolstra 2009-04-25 11:41:46 +00:00
parent 000fffeb11
commit 469893cd4a

View file

@ -7,17 +7,23 @@ use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils; use Hydra::Helper::CatalystUtils;
sub getJobStatus { sub filterInactiveJobs {
my ($self, $c) = @_; my ($build) = @_;
return $build->search(
my $latest = joinWithResultInfo($c, $c->stash->{jobStatus});
$latest = $latest->search(
{ active => 1 }, { active => 1 },
{ join => 'job' { join => 'job'
, '+select' => ["job.active"] , '+select' => ["job.active"]
, '+as' => ["active"] , '+as' => ["active"]
}) })
}
sub getJobStatus {
my ($self, $c) = @_;
my $latest = joinWithResultInfo($c, $c->stash->{jobStatus});
$latest = filterInactiveJobs($latest)
unless defined $c->stash->{showInactiveJobs}; unless defined $c->stash->{showInactiveJobs};
return $latest; return $latest;
@ -77,7 +83,7 @@ sub nix : Chained('get_builds') PathPart('channel') CaptureArgs(1) {
eval { eval {
if ($channelName eq "latest") { if ($channelName eq "latest") {
$c->stash->{channelName} = $c->stash->{channelBaseName} . "-latest"; $c->stash->{channelName} = $c->stash->{channelBaseName} . "-latest";
getChannelData($c, scalar($c->stash->{latestSucceeded})); getChannelData($c, scalar(filterInactiveJobs($c->stash->{latestSucceeded})));
} }
elsif ($channelName eq "all") { elsif ($channelName eq "all") {
$c->stash->{channelName} = $c->stash->{channelBaseName} . "-all"; $c->stash->{channelName} = $c->stash->{channelBaseName} . "-all";