diff --git a/src/lib/Hydra/Controller/JobsetEval.pm b/src/lib/Hydra/Controller/JobsetEval.pm index 30179d49c..6205cefcd 100644 --- a/src/lib/Hydra/Controller/JobsetEval.pm +++ b/src/lib/Hydra/Controller/JobsetEval.pm @@ -188,7 +188,9 @@ sub store_paths : Chained('evalChain') PathPart('store-paths') Args(0) { # Return full info about all the builds in this evaluation. sub all_builds : Chained('evalChain') PathPart('builds') Args(0) { my ($self, $c) = @_; - my @builds = $c->stash->{eval}->builds; + my @builds = $c->stash->{eval}->builds + ->search({}, + { prefetch => ['jobset', 'buildoutputs', 'buildproducts', 'buildmetrics'] }); $self->status_ok( $c, entity => [@builds], diff --git a/src/lib/Hydra/Schema/Result/Builds.pm b/src/lib/Hydra/Schema/Result/Builds.pm index 86f192a3d..b71338388 100644 --- a/src/lib/Hydra/Schema/Result/Builds.pm +++ b/src/lib/Hydra/Schema/Result/Builds.pm @@ -568,19 +568,14 @@ makeQueries('ForJobName', "and jobset_id = (select id from jobsets j where j.nam sub as_json { my ($self) = @_; - # After #1093 merges this can become $self->jobset; - # However, with ->jobset being a column on master - # it seems DBIX gets a it confused. - my ($jobset) = $self->search_related('jobset')->first; - my $json = { id => $self->get_column('id'), finished => $self->get_column('finished'), timestamp => $self->get_column('timestamp'), starttime => $self->get_column('starttime'), stoptime => $self->get_column('stoptime'), - project => $jobset->get_column('project'), - jobset => $jobset->name, + project => $self->jobset->get_column('project'), + jobset => $self->jobset->get_column('name'), job => $self->get_column('job'), nixname => $self->get_column('nixname'), system => $self->get_column('system'), @@ -588,7 +583,6 @@ sub as_json { buildstatus => $self->get_column('buildstatus'), releasename => $self->get_column('releasename'), drvpath => $self->get_column('drvpath'), - jobsetevals => [ map { $_->id } $self->jobsetevals ], buildoutputs => { map { $_->name => $_ } $self->buildoutputs }, buildproducts => { map { $_->productnr => $_ } $self->buildproducts }, buildmetrics => { map { $_->name => $_ } $self->buildmetrics }, diff --git a/t/Hydra/Controller/Build/api.t b/t/Hydra/Controller/Build/api.t index 91a553df9..5466e713e 100644 --- a/t/Hydra/Controller/Build/api.t +++ b/t/Hydra/Controller/Build/api.t @@ -67,7 +67,6 @@ subtest "validating the JSON representation of a build" => sub { finished => 1, id => $aggregateBuild->id, job => "aggregate", - jobsetevals => [ $aggregateBuild->jobsetevals->first->id ], nixname => "aggregate", priority => 100, releasename => undef,