diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index c716458e..35b29d86 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -274,7 +274,7 @@ sub evals_GET { my $offset = ($page - 1) * $resultsPerPage; $c->stash->{evals} = getEvals($self, $c, $evals, $offset, $resultsPerPage); my %entity = ( - evals => $c->stash->{evals}, + evals => [ map { $_->{eval} } @{$c->stash->{evals}} ], first => "?page=1", last => "?page=" . POSIX::ceil($c->stash->{total}/$resultsPerPage) ); diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 31b26fbd..16e89088 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -606,6 +606,7 @@ my %hint = ( 'id', 'finished', 'timestamp', + 'starttime', 'stoptime', 'project', 'jobset', diff --git a/src/lib/Hydra/Schema/JobsetEvalInputs.pm b/src/lib/Hydra/Schema/JobsetEvalInputs.pm index 77b18900..f79c873b 100644 --- a/src/lib/Hydra/Schema/JobsetEvalInputs.pm +++ b/src/lib/Hydra/Schema/JobsetEvalInputs.pm @@ -171,7 +171,9 @@ __PACKAGE__->belongs_to( my %hint = ( columns => [ - "revision" + "revision", + "type", + "uri" ], ); diff --git a/src/lib/Hydra/Schema/Jobsets.pm b/src/lib/Hydra/Schema/Jobsets.pm index 4af1ee88..7946b33b 100644 --- a/src/lib/Hydra/Schema/Jobsets.pm +++ b/src/lib/Hydra/Schema/Jobsets.pm @@ -309,6 +309,12 @@ __PACKAGE__->has_many( # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DTAGxP5RFvcNxP/ciJGo4Q my %hint = ( + columns => [ + "enabled", + "errormsg", + "fetcherrormsg", + "emailoverride" + ], eager_relations => { jobsetinputs => "name" } diff --git a/tests/api-test.pl b/tests/api-test.pl index 4e3b5311..8b520fba 100644 --- a/tests/api-test.pl +++ b/tests/api-test.pl @@ -51,14 +51,14 @@ $result = request_json({ uri => '/jobset/sample/default/evals' }); ok($result->code() == 200, "Can get evals of a jobset"); my $evals = decode_json($result->content())->{evals}; my $eval = $evals->[0]; -ok($eval->{eval}->{hasnewbuilds} == 1, "The first eval of a jobset has new builds"); +ok($eval->{hasnewbuilds} == 1, "The first eval of a jobset has new builds"); # Ugh, cached for 30s sleep 30; system("echo >> /run/jobset/default.nix; LOGNAME=root NIX_STORE_DIR=/run/nix/store NIX_LOG_DIR=/run/nix/var/log/nix NIX_STATE_DIR=/run/nix/var/nix HYDRA_DATA=/var/lib/hydra HYDRA_DBI='dbi:Pg:dbname=hydra;user=root;' hydra-evaluator sample default"); my $evals = decode_json(request_json({ uri => '/jobset/sample/default/evals' })->content())->{evals}; -ok($evals->[0]->{eval}->{jobsetevalinputs}->{"my-src"}->{revision} != $evals->[1]->{eval}->{jobsetevalinputs}->{"my-src"}->{revision}, "Changing a jobset source changes its revision"); +ok($evals->[0]->{jobsetevalinputs}->{"my-src"}->{revision} != $evals->[1]->{jobsetevalinputs}->{"my-src"}->{revision}, "Changing a jobset source changes its revision"); -my $build = decode_json(request_json({ uri => "/build/" . $evals->[0]->{eval}->{builds}->[0] })->content()); +my $build = decode_json(request_json({ uri => "/build/" . $evals->[0]->{builds}->[0] })->content()); ok($build->{job} eq "job", "The build's job name is job"); ok($build->{finished} == 0, "The build isn't finished yet");