diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 226e9724..9e819263 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -81,6 +81,13 @@ sub view_build : Chained('build') PathPart('') Args(0) { ]; } + my $r = joinWithResultInfo( $c, $c->model('DB::Builds'))->search( + { eval => { -in => $build->jobsetevalmembers->get_column('eval')->as_query } } + , { join => 'jobsetevalmembers', order_by => [ 'project', 'jobset', 'job'] } + ); + if ($r->count <= 50) { + $c->stash->{relatedbuilds} = [$r->all]; + } } diff --git a/src/lib/Hydra/Helper/CatalystUtils.pm b/src/lib/Hydra/Helper/CatalystUtils.pm index 2379386d..e5dcdc82 100644 --- a/src/lib/Hydra/Helper/CatalystUtils.pm +++ b/src/lib/Hydra/Helper/CatalystUtils.pm @@ -105,7 +105,7 @@ sub joinWithResultInfo { { }, { join => 'resultInfo' , '+select' => ["resultInfo.releasename", "resultInfo.buildstatus"] - , '+as' => ["releasename", "buildstatus"] + , '+as' => ["releasename", "buildStatus"] }); } diff --git a/src/root/build.tt b/src/root/build.tt index 56e0cf9e..e3d5b88f 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -7,6 +7,7 @@ [% project = build.project %] [% jobset = build.jobset %] [% job = build.job %] +[% resultInfo = build.resultInfo %] [% BLOCK renderBuildSteps %] @@ -34,7 +35,7 @@ [% INCLUDE renderDuration duration = step.stoptime - step.starttime %] [% ELSE %] [% IF build.finished %] - [% INCLUDE renderDuration duration = build.resultInfo.stoptime - step.starttime %] + [% INCLUDE renderDuration duration = resultInfo.stoptime - step.starttime %] [% ELSE %] [% INCLUDE renderDuration duration = curTime - step.starttime %] [% END %] @@ -87,6 +88,7 @@
  • Summary
  • Information
  • Build Inputs
  • + [% IF relatedbuilds %]
  • Related builds
  • [% END %] [% IF build.buildsteps %]
  • Build Steps
  • [% END %] [% IF build.dependents %]
  • Used by
  • [% END%] [% IF prevBuilds %]
  • History chart
  • [% END %] @@ -104,10 +106,10 @@ Build ID: [% build.id %] - [% IF build.resultInfo.releasename %] + [% IF resultInfo.releasename %] Release name: - [% HTML.escape(build.resultInfo.releasename) %] + [% HTML.escape(resultInfo.releasename) %] [% ELSE %] @@ -129,15 +131,15 @@ Duration: - [% IF build.resultInfo.iscachedbuild %] + [% IF resultInfo.iscachedbuild %] (cached[% IF cachedBuild %] from [% INCLUDE renderFullBuildLink build=cachedBuild %][% END %]) [% ELSE %] - [% INCLUDE renderDuration duration = build.resultInfo.stoptime - build.resultInfo.starttime %] finished at [% INCLUDE renderDateTime timestamp = build.resultInfo.stoptime %] + [% INCLUDE renderDuration duration = resultInfo.stoptime - resultInfo.starttime %] finished at [% INCLUDE renderDateTime timestamp = resultInfo.stoptime %] [% END %] [% END %] - [% IF build.resultInfo.logfile %] + [% IF resultInfo.logfile %] Logfile: @@ -180,7 +182,7 @@ [% END %] [% IF build.finished %] - [% IF build.buildsteps && build.resultInfo.buildstatus != 0 && build.resultInfo.buildstatus != 6 %] + [% IF build.buildsteps && resultInfo.buildstatus != 0 && resultInfo.buildstatus != 6 %] [% INCLUDE renderBuildSteps type="Failed" %] [% END %] @@ -212,11 +214,11 @@ [% END %] - [% IF build.resultInfo.errormsg && build.resultInfo.buildstatus != 5 %] + [% IF resultInfo.errormsg && resultInfo.buildstatus != 5 %]

    Nix error output

    -
    [% HTML.escape(build.resultInfo.errormsg) -%]
    +
    [% HTML.escape(resultInfo.errormsg) -%]
    [% END %] [% END %] [% IF logtext %] @@ -262,10 +264,10 @@ Nix name: [% build.nixname %] - [% IF build.resultInfo.releasename %] + [% IF resultInfo.releasename %] Release name: - [% HTML.escape(build.resultInfo.releasename) %] + [% HTML.escape(resultInfo.releasename) %] [% END %] @@ -324,8 +326,8 @@ Time added: [% INCLUDE renderDateTime timestamp = build.timestamp %] - [% IF build.finished && build.resultInfo.buildstatus != 4 %] - [% IF build.resultInfo.iscachedbuild && cachedBuild %] + [% IF build.finished && resultInfo.buildstatus != 4 %] + [% IF resultInfo.iscachedbuild && cachedBuild %] Cached build: [% INCLUDE renderFullBuildLink build=cachedBuild %] @@ -334,23 +336,23 @@ Build started: - [% IF build.resultInfo.starttime %][% INCLUDE renderDateTime timestamp = build.resultInfo.starttime %][% ELSE %](cached build)[% END %] + [% IF resultInfo.starttime %][% INCLUDE renderDateTime timestamp = resultInfo.starttime %][% ELSE %](cached build)[% END %] Build finished: - [% IF build.resultInfo.stoptime %][% INCLUDE renderDateTime timestamp = build.resultInfo.stoptime %][% ELSE %](cached build)[% END %] + [% IF resultInfo.stoptime %][% INCLUDE renderDateTime timestamp = resultInfo.stoptime %][% ELSE %](cached build)[% END %] Duration: - [% IF build.resultInfo.iscachedbuild %] + [% IF resultInfo.iscachedbuild %] (cached build) [% ELSE %] - [% INCLUDE renderDuration duration = build.resultInfo.stoptime - build.resultInfo.starttime %] + [% INCLUDE renderDuration duration = resultInfo.stoptime - resultInfo.starttime %] [% END %] - [% IF build.resultInfo.logfile %] + [% IF resultInfo.logfile %] Logfile: @@ -373,7 +375,7 @@ [% IF !available %] Build output is no longer available - [% ELSIF build.resultInfo.keep %] + [% ELSIF resultInfo.keep %] Build output will be kept permanently [% IF c.user_exists %]
    @@ -431,6 +433,13 @@ + [% IF relatedbuilds %] +
    + +

    Related builds

    + [% INCLUDE renderBuildList builds=relatedbuilds%] +
    + [% END %] [% IF build.buildsteps %]
    @@ -476,8 +485,9 @@ var d = []; var ids = []; [% FOREACH prevbuild IN prevBuilds %][% IF prevbuild.resultInfo.starttime != 0 %] - d.push([[% prevbuild.resultInfo.starttime * 1000 %],[% prevbuild.get_column('actualBuildTime') %]]); - ids[[% prevbuild.resultInfo.starttime * 1000 %]] = [% prevbuild.id %] ; + [% pbResultInfo = prevbuild.resultInfo %] + d.push([[% pbResultInfo.starttime * 1000 %],[% prevbuild.get_column('actualBuildTime') %]]); + ids[[% pbResultInfo.starttime * 1000 %]] = [% prevbuild.id %] ; [% END %][% END %] var options = { diff --git a/src/root/common.tt b/src/root/common.tt index 9a25b3db..245527da 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -230,26 +230,27 @@ [% BLOCK renderStatus %] [% IF build.finished %] + [% buildstatus = build.resultInfo.buildstatus %] [% INCLUDE renderBuildStatusIcon size=16 %] - [% IF build.resultInfo.buildstatus == 0 %] + [% IF buildstatus == 0 %] Success - [% ELSIF build.resultInfo.buildstatus == 1 %] + [% ELSIF buildstatus == 1 %] Build returned a non-zero exit code - [% ELSIF build.resultInfo.buildstatus == 2 %] + [% ELSIF buildstatus == 2 %] A dependency of the build failed - [% ELSIF build.resultInfo.buildstatus == 4 %] + [% ELSIF buildstatus == 4 %] Cancelled by user - [% ELSIF build.resultInfo.buildstatus == 5 %] + [% ELSIF buildstatus == 5 %] Build inhibited because a dependency previously failed to build [% failedDep = build.resultInfo.failedDep %] (namely, [% failedDep.outpath %]) - [% ELSIF build.resultInfo.buildstatus == 6 %] + [% ELSIF buildstatus == 6 %] Build failed (with result) [% ELSE %] Build failed (see below) [% END %] - [% IF c.user_exists && (build.resultInfo.buildstatus == 3 || build.resultInfo.buildstatus == 4) %] + [% IF c.user_exists && (buildstatus == 3 || buildstatus == 4) %]