From fd36d79581f5895e342606ae4b370869affa4610 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Tue, 18 Nov 2014 11:00:15 +0100 Subject: [PATCH] Fix Changes section on build page. Now shows the changes of the first evaluation a build was part of compared to the previous one. Also separated previous builds from the changes section, as that was confusing sometimes. --- src/lib/Hydra/Controller/Build.pm | 5 +++++ src/root/build.tt | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 9a702ea8..8e4ea4e0 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -107,6 +107,11 @@ sub build_GET { entity => $build ); + my ($eval2) = $c->stash->{eval}->jobset->jobsetevals->search( + { hasnewbuilds => 1, id => { '<', $c->stash->{eval}->id } }, + { order_by => "id DESC", rows => 1 }); + $c->stash->{otherEval} = $eval2 if defined $eval2; + # If this is an aggregate build, get its constituents. $c->stash->{constituents} = [$c->stash->{build}->constituents_->search({}, {order_by => ["job"]})]; } diff --git a/src/root/build.tt b/src/root/build.tt index 742e5293..6929fb28 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -224,8 +224,13 @@ [% INCLUDE renderBuildSteps type="Failed" %] [% END %] - [% IF prevSuccessfulBuild %] + [% IF otherEval %]

Changes

+ [% INCLUDE renderInputDiff inputs2=eval.jobsetevalinputs inputs1=otherEval.jobsetevalinputs %] + [% END %] + + [% IF prevSuccessfulBuild %] +

Previous builds

@@ -250,7 +255,6 @@ [% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %] [% END %] -
Last successful build [% INCLUDE renderDateTime timestamp = prevSuccessfulBuild.timestamp %][% INCLUDE renderInputDiff inputs1=prevSuccessfulBuild.inputs inputs2=firstBrokenBuild.inputs %][% INCLUDE renderInputDiff inputs1=prevSuccessfulBuild.inputs inputs2=build.inputs %]
[% END %] @@ -380,11 +384,6 @@ [% INCLUDE renderInputs inputs=build.inputs %] - [% IF prevBuild %] -

Changes since previous [% INCLUDE renderBuildLink build=prevBuild %]

- [% INCLUDE renderInputDiff inputs2=build.inputs inputs1=prevBuild.inputs %] - [% END %] - [% ELSIF eval %] [% INCLUDE renderInputs inputs=eval.jobsetevalinputs %]