forked from lix-project/hydra
Hydra: In case of failure, also show changes between last succesful build and the first failed build after this
This commit is contained in:
parent
33ef55815e
commit
caa0f1a255
|
@ -22,6 +22,7 @@ sub build : Chained('/') PathPart CaptureArgs(1) {
|
||||||
|
|
||||||
$c->stash->{prevBuild} = getPreviousBuild($c, $c->stash->{build});
|
$c->stash->{prevBuild} = getPreviousBuild($c, $c->stash->{build});
|
||||||
$c->stash->{prevSuccessfulBuild} = getPreviousSuccessfulBuild($c, $c->stash->{build});
|
$c->stash->{prevSuccessfulBuild} = getPreviousSuccessfulBuild($c, $c->stash->{build});
|
||||||
|
$c->stash->{firstBrokenBuild} = getNextBuild($c, $c->stash->{prevSuccessfulBuild});
|
||||||
|
|
||||||
$c->stash->{mappers} = [$c->model('DB::UriRevMapper')->all];
|
$c->stash->{mappers} = [$c->model('DB::UriRevMapper')->all];
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use Hydra::Helper::Nix;
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(
|
our @EXPORT = qw(
|
||||||
getBuild getPreviousBuild getPreviousSuccessfulBuild getBuildStats joinWithResultInfo getChannelData
|
getBuild getPreviousBuild getNextBuild getPreviousSuccessfulBuild getBuildStats joinWithResultInfo getChannelData
|
||||||
error notFound
|
error notFound
|
||||||
requireLogin requireProjectOwner requireAdmin requirePost isAdmin isProjectOwner
|
requireLogin requireProjectOwner requireAdmin requirePost isAdmin isProjectOwner
|
||||||
trim
|
trim
|
||||||
|
@ -35,6 +35,20 @@ sub getPreviousBuild {
|
||||||
return $prevBuild;
|
return $prevBuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub getNextBuild {
|
||||||
|
my ($c, $build) = @_;
|
||||||
|
(my $nextBuild) = $c->model('DB::Builds')->search(
|
||||||
|
{ finished => 1
|
||||||
|
, system => $build->system
|
||||||
|
, project => $build->project->name
|
||||||
|
, jobset => $build->jobset->name
|
||||||
|
, job => $build->job->name
|
||||||
|
, 'me.id' => { '>' => $build->id }
|
||||||
|
}, {rows => 1, order_by => "id ASC"});
|
||||||
|
|
||||||
|
return $nextBuild;
|
||||||
|
}
|
||||||
|
|
||||||
sub getPreviousSuccessfulBuild {
|
sub getPreviousSuccessfulBuild {
|
||||||
my ($c, $build) = @_;
|
my ($c, $build) = @_;
|
||||||
(my $prevBuild) = joinWithResultInfo($c, $c->model('DB::Builds'))->search(
|
(my $prevBuild) = joinWithResultInfo($c, $c->model('DB::Builds'))->search(
|
||||||
|
|
|
@ -183,6 +183,16 @@
|
||||||
[% INCLUDE renderBuildSteps type="Failed" %]
|
[% INCLUDE renderBuildSteps type="Failed" %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
[% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %]
|
||||||
|
<h2>Changes</h2>
|
||||||
|
<p>
|
||||||
|
Build [% INCLUDE renderFullBuildLink build=firstBrokenBuild %] is the first build failure after the previous successful build of this job. The changes that might have caused the failure are:
|
||||||
|
</p>
|
||||||
|
[% INCLUDE renderInputDiff build2=prevSuccessfulBuild , build1=firstBrokenBuild %]
|
||||||
|
<br />
|
||||||
|
<p/>
|
||||||
|
[% END %]
|
||||||
|
|
||||||
[% IF build.resultInfo.buildstatus != 0 && prevSuccessfulBuild %]
|
[% IF build.resultInfo.buildstatus != 0 && prevSuccessfulBuild %]
|
||||||
<h2>Changes</h2>
|
<h2>Changes</h2>
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in a new issue