From 492fe121ea3a42f3b377d2f3b2a129211fb6bd62 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Jan 2014 16:06:47 +0100 Subject: [PATCH] Jobset eval page: Fix handling of aborted/cancelled builds The fix in 85d51074 was not quite right. --- src/lib/Hydra/Controller/JobsetEval.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/Hydra/Controller/JobsetEval.pm b/src/lib/Hydra/Controller/JobsetEval.pm index a2d8187c..5014bfe2 100644 --- a/src/lib/Hydra/Controller/JobsetEval.pm +++ b/src/lib/Hydra/Controller/JobsetEval.pm @@ -82,10 +82,7 @@ sub view : Chained('eval') PathPart('') Args(0) { my $n = 0; foreach my $build (@builds) { - if ($build->finished != 0 && ($build->buildstatus == 3 || $build->buildstatus == 4)) { - push @{$c->stash->{aborted}}, $build; - next; - } + my $aborted = $build->finished != 0 && ($build->buildstatus == 3 || $build->buildstatus == 4); my $d; my $found = 0; while ($n < scalar(@builds2)) { @@ -95,7 +92,9 @@ sub view : Chained('eval') PathPart('') Args(0) { if ($d == 0) { $n++; $found = 1; - if ($build->finished == 0 || $build2->finished == 0) { + if ($aborted) { + # do nothing + } elsif ($build->finished == 0 || $build2->finished == 0) { push @{$c->stash->{unfinished}}, $build; } elsif ($build->buildstatus == 0 && $build2->buildstatus == 0) { push @{$c->stash->{stillSucceed}}, $build; @@ -111,7 +110,11 @@ sub view : Chained('eval') PathPart('') Args(0) { push @{$c->stash->{removed}}, { job => $build2->get_column('job'), system => $build2->get_column('system') }; $n++; } - push @{$c->stash->{new}}, $build if !$found; + if ($aborted) { + push @{$c->stash->{aborted}}, $build; + } else { + push @{$c->stash->{new}}, $build if !$found; + } } $c->stash->{full} = ($c->req->params->{full} || "0") eq "1";