From 63db13be3fee1001b1a6cd3ef4568a7e6801167a Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Fri, 15 Jan 2010 14:18:12 +0000 Subject: [PATCH] hydra: in case of cached build, add link to build that built the storepath --- src/lib/Hydra/Controller/Build.pm | 6 ++++++ src/root/build.tt | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 8bc129be..6322f257 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -38,6 +38,12 @@ sub view_build : Chained('build') PathPart('') Args(0) { my $logfile = $build->schedulingInfo->logfile; $c->stash->{logtext} = `cat $logfile` if -e $logfile; } + + if (defined $build->resultInfo && $build->resultInfo->iscachedbuild) { + (my $cachedBuildStep) = $c->model('DB::BuildSteps')->search({ outpath => $build->outpath }, {}) ; + $c->stash->{cachedBuild} = $cachedBuildStep->build; + } + } diff --git a/src/root/build.tt b/src/root/build.tt index 09cd78fa..9f9366d7 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -150,6 +150,13 @@ [% INCLUDE renderDateTime timestamp = build.timestamp %] [% IF build.finished && build.resultInfo.buildstatus != 4 %] + [% IF build.resultInfo.iscachedbuild %] + + Cached build: + [% cachedBuild.id %] + + [% END %] + Build started: [% IF build.resultInfo.starttime %][% INCLUDE renderDateTime timestamp = build.resultInfo.starttime %][% ELSE %](cached build)[% END %]