Re-add the history tab (store size and build time), now as lazy-loaded tab on build page.

This commit is contained in:
Hydra
2014-01-28 10:27:48 +00:00
committed by Rob Vermaas
parent b3c1c57a5b
commit d4d9896f9f
4 changed files with 177 additions and 148 deletions

View File

@ -71,7 +71,7 @@ sub build_GET {
$c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep;
}
if ($build->finished && 0) {
if ($build->finished) {
$c->stash->{prevBuilds} = [$c->model('DB::Builds')->search(
{ project => $c->stash->{project}->name
, jobset => $c->stash->{build}->jobset->name
@ -399,6 +399,32 @@ sub runtime_deps : Chained('buildChain') PathPart('runtime-deps') {
}
sub history_graphs : Chained('buildChain') PathPart('history-graphs') {
my ($self, $c) = @_;
my $build = $c->stash->{build};
if ($build->finished) {
$c->stash->{prevBuilds} = [$c->model('DB::Builds')->search(
{ project => $c->stash->{project}->name
, jobset => $c->stash->{build}->jobset->name
, job => $c->stash->{build}->job->name
, 'me.system' => $build->system
, finished => 1
, buildstatus => 0
, 'me.id' => { '<=' => $build->id }
}
, { join => "actualBuildStep"
, "+select" => ["actualBuildStep.stoptime - actualBuildStep.starttime"]
, "+as" => ["actualBuildTime"]
, order_by => "me.id DESC"
, rows => 50
}
)
];
}
$c->stash->{template} = 'build-history-tab.tt';
}
sub nix : Chained('buildChain') PathPart('nix') CaptureArgs(0) {
my ($self, $c) = @_;