Allow comparing an eval against the jobset one day/week/month before

This commit is contained in:
Eelco Dolstra
2013-08-28 15:46:08 +02:00
parent ccc09c565e
commit d0bcaa6284
2 changed files with 12 additions and 1 deletions

View File

@ -36,6 +36,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);
$eval2 = $c->stash->{jobset}->jobsetevals->find(
{ 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.");