Hydra: In case of failure, also show changes between last succesful build and the first failed build after this
This commit is contained in:
@ -22,6 +22,7 @@ sub build : Chained('/') PathPart CaptureArgs(1) {
|
||||
|
||||
$c->stash->{prevBuild} = getPreviousBuild($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];
|
||||
|
||||
|
@ -7,7 +7,7 @@ use Hydra::Helper::Nix;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(
|
||||
getBuild getPreviousBuild getPreviousSuccessfulBuild getBuildStats joinWithResultInfo getChannelData
|
||||
getBuild getPreviousBuild getNextBuild getPreviousSuccessfulBuild getBuildStats joinWithResultInfo getChannelData
|
||||
error notFound
|
||||
requireLogin requireProjectOwner requireAdmin requirePost isAdmin isProjectOwner
|
||||
trim
|
||||
@ -35,6 +35,20 @@ sub getPreviousBuild {
|
||||
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 {
|
||||
my ($c, $build) = @_;
|
||||
(my $prevBuild) = joinWithResultInfo($c, $c->model('DB::Builds'))->search(
|
||||
|
Reference in New Issue
Block a user