Die tabs die

This commit is contained in:
Eelco Dolstra
2013-01-22 14:09:37 +01:00
parent 486b6037a9
commit aa28ffe3a8
12 changed files with 90 additions and 90 deletions

View File

@ -103,8 +103,8 @@ sub latestbuilds : Chained('api') PathPart('latestbuilds') Args(0) {
sub jobsetToHash {
my ($jobset) = @_;
return {
project => $jobset->project->name,
name => $jobset->name,
project => $jobset->project->name,
name => $jobset->name,
nrscheduled => $jobset->get_column("nrscheduled"),
nrsucceeded => $jobset->get_column("nrsucceeded"),
nrfailed => $jobset->get_column("nrfailed"),
@ -222,13 +222,13 @@ sub scmdiff : Chained('api') PathPart('scmdiff') Args(0) {
my $clonePath = scmPath . "/" . sha256_hex($uri);
die if ! -d $clonePath;
$branch = `(cd $clonePath; hg log --template '{branch}' -r $rev2)`;
$diff .= `(cd $clonePath; hg log -r $rev1 -r $rev2 -b $branch)`;
$diff .= `(cd $clonePath; hg diff -r $rev1:$rev2)`;
$diff .= `(cd $clonePath; hg log -r $rev1 -r $rev2 -b $branch)`;
$diff .= `(cd $clonePath; hg diff -r $rev1:$rev2)`;
} elsif ($type eq "git") {
my $clonePath = scmPath . "/" . sha256_hex($uri);
die if ! -d $clonePath;
$diff .= `(cd $clonePath; git log $rev1..$rev2)`;
$diff .= `(cd $clonePath; git diff $rev1..$rev2)`;
$diff .= `(cd $clonePath; git log $rev1..$rev2)`;
$diff .= `(cd $clonePath; git diff $rev1..$rev2)`;
}
$c->stash->{'plain'} = { data => (scalar $diff) || " " };

View File

@ -21,14 +21,14 @@ sub nixMachines {
my $result = "# GENERATED BY HYDRA\n";
foreach my $machine ($c->model("DB::BuildMachines")->all) {
if($machine->enabled) {
$result = $result . $machine->username . '@'. $machine->hostname . ' ';
foreach my $system ($machine->buildmachinesystemtypes) {
$result = $result . $system->system .',';
}
chop $result;
$result = $result . ' '. $machine->ssh_key . ' ' . $machine->maxconcurrent . ' '. $machine->speedfactor . ' ' . $machine->options . "\n";
}
if($machine->enabled) {
$result = $result . $machine->username . '@'. $machine->hostname . ' ';
foreach my $system ($machine->buildmachinesystemtypes) {
$result = $result . $system->system .',';
}
chop $result;
$result = $result . ' '. $machine->ssh_key . ' ' . $machine->maxconcurrent . ' '. $machine->speedfactor . ' ' . $machine->options . "\n";
}
}
return $result;
}
@ -284,9 +284,9 @@ sub updateMachine {
});
$machine->buildmachinesystemtypes->delete_all;
if(ref($systems) eq 'ARRAY') {
for my $s (@$systems) {
$machine->buildmachinesystemtypes->create({ system => $s}) ;
}
for my $s (@$systems) {
$machine->buildmachinesystemtypes->create({ system => $s}) ;
}
} else {
$machine->buildmachinesystemtypes->create({ system => $systems}) ;
}

View File

@ -60,7 +60,7 @@ sub view_build : Chained('build') PathPart('') Args(0) {
(my $lastBuildStep) = $build->buildsteps->search({},{order_by => "stepnr DESC", rows => 1});
my $path = defined $lastBuildStep ? $lastBuildStep->logfile : "" ;
if ($build->finished && ($build->buildstatus == 1 || $build->buildstatus == 6) && !($path eq "") && -f $lastBuildStep->logfile) {
my $logtext = logContents($path, 50);
my $logtext = logContents($path, 50);
$c->stash->{logtext} = removeAsciiEscapes($logtext);
}
@ -140,8 +140,8 @@ sub showLog {
}
elsif ($mode eq "tail-reload") {
my $url = $c->request->uri->as_string;
$url =~ s/tail-reload/tail/g;
my $url = $c->request->uri->as_string;
$url =~ s/tail-reload/tail/g;
$c->stash->{url} = $url;
$c->stash->{reload} = !$c->stash->{build}->finished && $c->stash->{build}->busy;
$c->stash->{title} = "";
@ -311,17 +311,17 @@ sub deps : Chained('build') PathPart('deps') {
@runtimepaths = split '\n', `nix-store --query --requisites --include-outputs $outpath` if isValidPath($build->outpath);
foreach my $p (@buildtimepaths) {
my $buildStep;
($buildStep) = $c->model('DB::BuildSteps')->search({ outpath => $p }, {}) ;
my %dep = ( buildstep => $buildStep, path => $p ) ;
push(@buildtimedeps, \%dep);
my $buildStep;
($buildStep) = $c->model('DB::BuildSteps')->search({ outpath => $p }, {}) ;
my %dep = ( buildstep => $buildStep, path => $p ) ;
push(@buildtimedeps, \%dep);
}
foreach my $p (@runtimepaths) {
my $buildStep;
($buildStep) = $c->model('DB::BuildSteps')->search({ outpath => $p }, {}) ;
my %dep = ( buildstep => $buildStep, path => $p ) ;
push(@runtimedeps, \%dep);
my $buildStep;
($buildStep) = $c->model('DB::BuildSteps')->search({ outpath => $p }, {}) ;
my %dep = ( buildstep => $buildStep, path => $p ) ;
push(@runtimedeps, \%dep);
}
@ -466,7 +466,7 @@ sub clone_submit : Chained('build') PathPart('clone/submit') Args(0) {
# When the expression is in a .scm file, assume it's a Guile + Guix
# build expression.
my $exprType =
$c->request->params->{"nixexprpath"} =~ /.scm$/ ? "guile" : "nix";
$c->request->params->{"nixexprpath"} =~ /.scm$/ ? "guile" : "nix";
my $jobName = trim $c->request->params->{"jobname"};
error($c, "Invalid job name: $jobName") if $jobName !~ /^$jobNameRE$/;

View File

@ -28,18 +28,18 @@ sub overview : Chained('job') PathPart('') Args(0) {
$c->stash->{currentBuilds} = [$c->stash->{job}->builds->search({finished => 1, iscurrent => 1}, { order_by => 'system' })];
$c->stash->{lastBuilds} =
[ $c->stash->{job}->builds->search({ finished => 1 },
{ order_by => 'timestamp DESC', rows => 10, columns => [@buildListColumns] }) ];
[ $c->stash->{job}->builds->search({ finished => 1 },
{ order_by => 'timestamp DESC', rows => 10, columns => [@buildListColumns] }) ];
$c->stash->{runningBuilds} = [
$c->stash->{job}->builds->search(
{ busy => 1 },
{ join => ['project']
, order_by => ["priority DESC", "timestamp"]
$c->stash->{job}->builds->search(
{ busy => 1 },
{ join => ['project']
, order_by => ["priority DESC", "timestamp"]
, '+select' => ['project.enabled']
, '+as' => ['enabled']
}
) ];
, '+as' => ['enabled']
}
) ];
$c->stash->{systems} = [$c->stash->{job}->builds->search({iscurrent => 1}, {select => ["system"], distinct => 1})];
}

View File

@ -57,7 +57,7 @@ sub jobsetIndex {
# status per system
my @systems = ();
foreach my $system (@{$c->stash->{systems}}) {
push(@systems, $system->system);
push(@systems, $system->system);
}
if($forceStatus || scalar(@{$c->stash->{activeJobs}}) <= 100) {
@ -74,10 +74,10 @@ sub jobsetIndex {
[ $c->model('DB')->resultset('ActiveJobsForJobset')->search(
{},
{ bind => [$c->stash->{project}->name, $c->stash->{jobset}->name]
, select => \@select
, as => \@as
, order_by => ["job"]
})];
, select => \@select
, as => \@as
, order_by => ["job"]
})];
}
}
@ -226,7 +226,7 @@ sub updateJobset {
# When the expression is in a .scm file, assume it's a Guile + Guix
# build expression.
my $exprType =
$c->request->params->{"nixexprpath"} =~ /.scm$/ ? "guile" : "nix";
$c->request->params->{"nixexprpath"} =~ /.scm$/ ? "guile" : "nix";
my ($nixExprPath, $nixExprInput) = nixExprPathFromParams $c;

View File

@ -11,7 +11,7 @@ sub eval : Chained('/') PathPart('eval') CaptureArgs(1) {
my ($self, $c, $evalId) = @_;
my $eval = $c->model('DB::JobsetEvals')->find($evalId)
or notFound($c, "Evaluation $evalId doesn't exist.");
or notFound($c, "Evaluation $evalId doesn't exist.");
$c->stash->{eval} = $eval;
$c->stash->{project} = $eval->project;

View File

@ -147,7 +147,7 @@ sub create_jobset_submit : Chained('project') PathPart('create-jobset/submit') A
my $jobsetName = trim $c->request->params->{name};
my $exprType =
$c->request->params->{"nixexprpath"} =~ /.scm$/ ? "guile" : "nix";
$c->request->params->{"nixexprpath"} =~ /.scm$/ ? "guile" : "nix";
error($c, "Invalid jobset name: $jobsetName") if $jobsetName !~ /^$jobsetNameRE$/;

View File

@ -23,8 +23,8 @@ sub begin :Private {
$c->stash->{tracker} = $ENV{"HYDRA_TRACKER"} ;
if (scalar(@args) == 0 || $args[0] ne "static") {
$c->stash->{nrRunningBuilds} = $c->model('DB::Builds')->search({ finished => 0, busy => 1 }, {})->count();
$c->stash->{nrQueuedBuilds} = $c->model('DB::Builds')->search({ finished => 0 })->count();
$c->stash->{nrRunningBuilds} = $c->model('DB::Builds')->search({ finished => 0, busy => 1 }, {})->count();
$c->stash->{nrQueuedBuilds} = $c->model('DB::Builds')->search({ finished => 0 })->count();
}
}
@ -202,10 +202,10 @@ sub nix_cache_info :Path('nix-cache-info') :Args(0) {
$c->stash->{'plain'} = { data =>
#"StoreDir: $Nix::Config::storeDir\n" . # FIXME
"StoreDir: /nix/store\n" .
"WantMassQuery: 0\n" .
"WantMassQuery: 0\n" .
# Give Hydra binary caches a very low priority (lower than the
# static binary cache http://nixos.org/binary-cache).
"Priority: 100\n"
"Priority: 100\n"
};
$c->forward('Hydra::View::Plain');
}