From cc1fcf657c21331a21360cb96feac35c7173ea6d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 3 Oct 2013 01:54:42 +0200 Subject: [PATCH] Show aborted/cancelled builds separately in jobset eval pages --- src/lib/Hydra/Controller/JobsetEval.pm | 13 ++++++++----- src/root/jobset-eval.tt | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Controller/JobsetEval.pm b/src/lib/Hydra/Controller/JobsetEval.pm index 703d200d..8b152394 100644 --- a/src/lib/Hydra/Controller/JobsetEval.pm +++ b/src/lib/Hydra/Controller/JobsetEval.pm @@ -39,11 +39,11 @@ sub view : Chained('eval') PathPart('') Args(0) { if ($compare =~ /^\d+$/) { $eval2 = $c->model('DB::JobsetEvals')->find($compare) or notFound($c, "Evaluation $compare doesn't exist."); - } elsif ($compare =~ /^-(\d+)$/) { - my $t = int($1); + } elsif ($compare =~ /^-(\d+)$/) { + my $t = int($1); $eval2 = $c->stash->{jobset}->jobsetevals->find( - { hasnewbuilds => 1, timestamp => {'<=', $eval->timestamp - $t} }, - { order_by => "timestamp desc", rows => 1}); + { hasnewbuilds => 1, timestamp => {'<=', $eval->timestamp - $t} }, + { order_by => "timestamp desc", rows => 1}); } elsif (defined $compare && $compare =~ /^($jobsetNameRE)$/) { my $j = $c->stash->{project}->jobsets->find({name => $compare}) or notFound($c, "Jobset $compare doesn't exist."); @@ -78,6 +78,7 @@ sub view : Chained('eval') PathPart('') Args(0) { $c->stash->{new} = []; $c->stash->{removed} = []; $c->stash->{unfinished} = []; + $c->stash->{aborted} = []; my $n = 0; foreach my $build (@builds) { @@ -90,7 +91,9 @@ sub view : Chained('eval') PathPart('') Args(0) { if ($d == 0) { $n++; $found = 1; - if ($build->finished == 0 || $build2->finished == 0) { + if ($build->buildstatus == 3 || $build->buildstatus == 4) { + push @{$c->stash->{aborted}}, $build; + } elsif ($build->finished == 0 || $build2->finished == 0) { push @{$c->stash->{unfinished}}, $build; } elsif ($build->buildstatus == 0 && $build2->buildstatus == 0) { push @{$c->stash->{stillSucceed}}, $build; diff --git a/src/root/jobset-eval.tt b/src/root/jobset-eval.tt index 061651b6..e6d579ef 100644 --- a/src/root/jobset-eval.tt +++ b/src/root/jobset-eval.tt @@ -46,6 +46,9 @@ c.uri_for(c.controller('JobsetEval').action_for('view'), [% END %] + [% IF aborted.size > 0 %] +
  • Aborted jobs
  • + [% END %] [% IF nowFail.size > 0 %]
  • Newly-failing jobs
  • [% END %] @@ -83,6 +86,10 @@ c.uri_for(c.controller('JobsetEval').action_for('view'),
    +
    + [% INCLUDE renderSome builds=aborted %] +
    +
    [% INCLUDE renderSome builds=nowFail %]