diff --git a/src/lib/Hydra/Controller/Job.pm b/src/lib/Hydra/Controller/Job.pm index 2e272395..4d186974 100644 --- a/src/lib/Hydra/Controller/Job.pm +++ b/src/lib/Hydra/Controller/Job.pm @@ -40,7 +40,7 @@ sub overview : Chained('job') PathPart('') Args(0) { # If this is an aggregate job, then get its constituents. my @constituents = $c->model('DB::Builds')->search( - { aggregate => { -in => $job->builds->search({}, { columns => ["id"], order_by => "id desc", rows => 10 })->as_query } }, + { aggregate => { -in => $job->builds->search({}, { columns => ["id"], order_by => "id desc", rows => 15 })->as_query } }, { join => 'aggregateconstituents_constituents', columns => ['id', 'job', 'finished', 'buildstatus'], +select => ['aggregateconstituents_constituents.aggregate'], @@ -51,11 +51,17 @@ sub overview : Chained('job') PathPart('') Args(0) { my %constituentJobs; foreach my $b (@constituents) { my $jobName = $b->get_column('job'); - $aggregates->{$b->get_column('aggregate')}->{$jobName} = + $aggregates->{$b->get_column('aggregate')}->{constituents}->{$jobName} = { id => $b->id, finished => $b->finished, buildstatus => $b->buildstatus}; $constituentJobs{$jobName} = 1; } + foreach my $agg (keys %$aggregates) { + # FIXME: could be done in one query. + $aggregates->{$agg}->{build} = + $c->model('DB::Builds')->find({id => $agg}, {columns => [@buildListColumns]}) or die; + } + $c->stash->{aggregates} = $aggregates; $c->stash->{constituentJobs} = [sort (keys %constituentJobs)]; } diff --git a/src/root/common.tt b/src/root/common.tt index 35e4b032..6e684087 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -20,7 +20,7 @@ BLOCK renderJobsetName %] BLOCK renderJobName %] -[% job %] +[% job %] [% END; diff --git a/src/root/job.tt b/src/root/job.tt index c9c4b6cb..10c719a5 100644 --- a/src/root/job.tt +++ b/src/root/job.tt @@ -28,51 +28,34 @@
# | - [% FOREACH j IN constituentJobs %] -[% HTML.escape(j) %] | - [% END %] -
---|---|
[% agg %] | - [% FOREACH j IN constituentJobs %] -- [% r = aggregates.$agg.$j; IF r.id %] - - [% INCLUDE renderBuildStatusIcon size=16 build=r %] - - [% END %] - | - [% END %] -
# | - [% FOREACH j IN constituentJobs %] -[% HTML.escape(j) %] | +Job | + [% FOREACH agg IN aggs %] +
+ [% agg_ = aggregates.$agg %]
+
+ [% agg %]
+ |
[% END %]
---|---|---|---|
[% agg %] | - [% FOREACH j IN constituentJobs %] -- [% r = aggregates.$agg.$j; IF r.id %] + | [% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %] | + [% FOREACH agg IN aggs %] ++ [% r = aggregates.$agg.constituents.$j; IF r.id %] [% INCLUDE renderBuildStatusIcon size=16 build=r %] @@ -84,7 +67,6 @@ |