On build pages, provide a link to the build's first eval

This commit is contained in:
Eelco Dolstra 2013-02-21 18:34:34 +01:00
parent d8370142c2
commit edbe531ccc
3 changed files with 19 additions and 0 deletions

View file

@ -91,6 +91,11 @@ sub view_build : Chained('build') PathPart('') Args(0) {
]; ];
} }
# Get the first eval of which this build was a part.
($c->stash->{eval}) = $c->stash->{build}->jobsetevals->search(
{ hasnewbuilds => 1},
{ limit => 1, order_by => ["id"] });
my $maxRelated = 100; my $maxRelated = 100;
my $r = $c->model('DB::Builds')->search( my $r = $c->model('DB::Builds')->search(
{ eval => { -in => $build->jobsetevalmembers->search({}, {rows => 1})->get_column('eval')->as_query } }, { eval => { -in => $build->jobsetevalmembers->search({}, {rows => 1})->get_column('eval')->as_query } },

View file

@ -482,6 +482,12 @@ __PACKAGE__->has_many(
{ "foreign.build" => "self.id" }, { "foreign.build" => "self.id" },
); );
__PACKAGE__->has_many(
"evals",
"Hydra::Schema::BuildInputs",
{ "foreign.build" => "self.id" },
);
#__PACKAGE__->has_one( #__PACKAGE__->has_one(
# "actualBuildStep", # "actualBuildStep",
# "Hydra::Schema::BuildSteps", # "Hydra::Schema::BuildSteps",
@ -490,6 +496,8 @@ __PACKAGE__->has_many(
# }, # },
#); #);
__PACKAGE__->many_to_many("jobsetevals", "jobsetevalmembers", "eval");
sub makeSource { sub makeSource {
my ($name, $query) = @_; my ($name, $query) = @_;
my $source = __PACKAGE__->result_source_instance(); my $source = __PACKAGE__->result_source_instance();

View file

@ -97,6 +97,12 @@
<th>System:</th> <th>System:</th>
<td><tt>[% build.system %]</tt></td> <td><tt>[% build.system %]</tt></td>
</tr> </tr>
[% IF eval %]
<tr>
<th>Part of:</th>
<td><a href="[% c.uri_for(c.controller('JobsetEval').action_for('view'), [eval.id]) %]">evaluation [% eval.id %]</a></td>
</tr>
[% END %]
[% IF build.releasename %] [% IF build.releasename %]
<tr> <tr>
<th>Release name:</th> <th>Release name:</th>