Support push notification of repository changes
[?]
Feb 25, 2013, 8:04 PM
PCKLFRT5IZVLG47GQQ23GBSROKUR4CUEZW4PRVGREHNDFTCZ7VBACDependencies
- [2]
3WUMSTU5Use getMainOutput - [3]
J74UTA3IHandle the case where a jobset has never been evaluated - [4]
GCHNNFZP - [5]
TIOBBINA* Some renaming. - [6]
PMNWRTGJAdd multiple output support - [7]
HOI5XQHS* Don't use a config file by default. This frees up $HYDRA_CONFIG so - [8]
OVR2RWBIhydra-evaluator: Always pick the jobset that hasn't been evaluated longest - [9]
JM3DPYOMgenerated schema with new dbix class schema loader, grrrrrr - [10]
ND75XNSQAllow showing all evaluations that contain a given build - [11]
LBNVQXUB* Build the /build stuff in a separate controller. - [12]
RFE6T5LG* Store jobset evaluations in the database explicitly. This includes - [13]
NI5BVF2V* In job inputs of type "build", allow the project and jobset names of - [14]
SB2V735VKeep track of the database schema version - [15]
WQXF2T3Dhydra-evaluator: Don't require $HYDRA_CONFIG - [16]
2SP37OH2Send ETag and Expires headers - [17]
X27GNHDV* Basic job info in the database. - [18]
QTFVCDIFadded hide feature for project/jobset - [19]
5GRJZZOR - [20]
Y6AHH4THRemove the logfile and logSize columns from the database - [21]
VBUNNYXGFix path to the session data - [22]
HSVVEKTY* Start of a JSON API to get information about a specific build. - [23]
FGQPXZIXhydra: make nr of build to keep configurable per jobset - [*]
BKOIYITRadded some json responses - [*]
TH674WKJadd log diff to compare logs to previous builds - [*]
LMETCA7GCleanup - [*]
HQGXL4MXAdd validation for project and jobset names - [*]
CS7T2XFI - [*]
4D4U5IPY* Allow jobsets to be disabled. - [*]
J5UVLXOK* Start of a basic Catalyst web interface. - [*]
N22GPKYT* Put info about logs / build products in the DB. - [*]
7ZYBTNJJrevert unmeant previous change which caused errors to stay, even after successful evaluation of jobs - [*]
2YXO5ZGQHydra/28: Rename "scheduler" to "evaluator" - [*]
KN3VYE5P* Cleaned up the foreign key constraints. - [*]
D5QIOJGP* Move everything up one directory.
Change contents
- edit in src/lib/Hydra/Controller/API.pm at line 3
use utf8; - edit in src/lib/Hydra/Controller/API.pm at line 23
}sub end : ActionClass('RenderView') {my ($self, $c) = @_;if (scalar @{$c->error}) {$c->stash->{json}->{error} = join "\n", @{$c->error};$c->forward('View::JSON');$c->clear_errors;} - edit in src/lib/Hydra/Controller/API.pm at line 285
}sub triggerJobset {my ($self, $c, $jobset) = @_;txn_do($c->model('DB')->schema, sub {$jobset->update({ triggertime => time });});push @{$c->{stash}->{json}->{jobsetsTriggered}}, $jobset->project->name . ":" . $jobset->name;}sub push : Chained('api') PathPart('push') Args(0) {my ($self, $c) = @_;$c->{stash}->{json}->{jobsetsTriggered} = [];my @jobsets = split /,/, ($c->request->params->{jobsets} // "");foreach my $s (@jobsets) {my ($p, $j) = parseJobsetName($s);my $jobset = $c->model('DB::Jobsets')->find($p, $j) or notFound($c, "Jobset ‘$p:$j’ does not exist.");next unless $jobset->project->enabled && $jobset->enabled;triggerJobset($self, $c, $jobset);}my @repos = split /,/, ($c->request->params->{repos} // "");foreach my $r (@repos) {triggerJobset($self, $c, $_) foreach $c->model('DB::Jobsets')->search({ 'project.enabled' => 1, 'me.enabled' => 1 },{ join => 'project', where => \ [ 'exists (select 1 from JobsetInputAlts where project = me.project and jobset = me.name and value = ?)', [ 'value', $r ] ]});}$c->forward('View::JSON'); - replacement in src/lib/Hydra/Controller/Build.pm at line 566
# !!! strip the json prefix$c->stash->{jsonBuildId} = $build->id;$c->stash->{jsonDrvPath} = $build->drvpath;$c->stash->{json}->{buildId} = $build->id;$c->stash->{json}->{drvPath} = $build->drvpath; - replacement in src/lib/Hydra/Controller/Build.pm at line 569
$c->stash->{jsonOutPath} = $out->path if defined $out;$c->stash->{json}->{outPath} = $out->path if defined $out; - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 16
parseJobsetName - edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 173
sub parseJobsetName {my ($s) = @_;$s =~ /^($projectNameRE):($jobsetNameRE)$/ or die "invalid jobset specifier ‘$s’\n";return ($1, $2);} - edit in src/lib/Hydra/Schema/Jobsets.pm at line 65
data_type: 'integer'is_nullable: 1=head2 triggertime - edit in src/lib/Hydra/Schema/Jobsets.pm at line 122
"triggertime",{ data_type => "integer", is_nullable => 1 }, - replacement in src/lib/Hydra/Schema/Jobsets.pm at line 255
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9smV/zbSSxQNLiBcnADFXA# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-02-25 19:10:12# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SvBgR0iH9NjVH4jvBATYPA - replacement in src/lib/Hydra.pm at line 48
expose_stash => qr/^json/,expose_stash => 'json' - replacement in src/script/hydra-evaluator at line 24
my $minCheckInterval = 1;my $minCheckInterval = 5 * 60; - edit in src/script/hydra-evaluator at line 234
my $triggerTime = $jobset->triggertime; - edit in src/script/hydra-evaluator at line 247
});}if (defined $triggerTime) {txn_do($db, sub {# Only clear the trigger time if the jobset hasn't been# triggered in the meantime. In that case, we need to# evaluate again.my $new = $jobset->get_from_storage();$jobset->update({ triggertime => undef })if $new->triggertime == $triggerTime; - edit in src/script/hydra-evaluator at line 263
# Check the jobset that hasn't been checked for the longest time. - edit in src/script/hydra-evaluator at line 264
# If any jobset has been triggered by a push, check it. - replacement in src/script/hydra-evaluator at line 266
{ 'project.enabled' => 1, 'me.enabled' => 1{ 'project.enabled' => 1, 'me.enabled' => 1, 'triggertime' => { '!=', undef },, -or => [ 'lastcheckedtime' => undef, 'lastcheckedtime' => { '<', time() - $minCheckInterval } ] },{ join => 'project', order_by => [ 'triggertime' ], rows => 1 });# Otherwise, check the jobset that hasn't been checked for the# longest time (but don't check more often than the minimal check# interval).($jobset) = $db->resultset('Jobsets')->search({ 'project.enabled' => 1, 'me.enabled' => 1, - replacement in src/script/hydra-evaluator at line 276
{ join => 'project', order_by => [ 'lastcheckedtime nulls first' ], rows => 1 });{ join => 'project', order_by => [ 'lastcheckedtime nulls first' ], rows => 1 })unless defined $jobset; - edit in src/sql/hydra.sql at line 57
triggerTime integer, -- set if we were triggered by a push event - file addition: upgrade-10.sql[36.3004]
alter table Jobsets add column triggerTime integer;