* In job inputs of type "build", allow the project and jobset names of
[?]
Mar 20, 2009, 2:50 PM
NI5BVF2VLMDA7REXTV455SUCQAYMKPKNKQSRII2SJJGG2TCX4CTACDependencies
- [2]
5GRJZZOR - [3]
S5PV6IIM* Represent jobs explicitly in the DB. - [4]
F2G7Z2XK* Doh. - [5]
FDE3BJAP* Refactoring. - [6]
POPU2ATH* hydra_scheduler: use eval-jobs. - [7]
SHZLOM5M* eval-jobs -> hydra_eval_jobs. - [8]
NLJJZVHO* Use ->update({...}) properly. - [9]
3E6IP3R3* Add the name of the jobset to ReleaseSetJobs, otherwise we can't - [10]
E6IC7YIK* Release sets: need to include the jobset name to disambiguate - [11]
EBUKGUD5* Ordering by timestamp isn't a good idea here since a newer revision - [12]
2T42QGZD* Register builds as GC roots so they don't get deleted. - [13]
IN272KZW* Automatically keep all builds in the latest successful release in - [14]
X27GNHDV* Basic job info in the database. - [15]
ZVTSOVHN* Support Subversion checkouts. - [16]
7ZHHVD6Q* Inputs of type "build" must now be declared explicitly. - [17]
H7CNGK4O* Log evaluation errors etc. in the DB. - [18]
M3WSK4CB - [19]
3ZCEPLNO - [20]
M552HLIA* Support variant builds. - [21]
AFTXA575* $HYDRA_DATA environment variable. - [22]
GCHNNFZP - [*]
2GK5DOU7* Downloading closures. - [*]
N22GPKYT* Put info about logs / build products in the DB. - [*]
TLZ2SPBR
Change contents
- replacement in src/lib/Hydra/Helper/Nix.pm at line 121
$query .= " and (select count(*) from buildinputs where build = $id and name = '$name' and value = '$value') = 1";$query .= " and exists (select 1 from buildinputs where build = $id and name = '$name' and value = '$value')"; - edit in src/script/hydra_scheduler.pl at line 33[26.2182][26.2182]
}sub parseJobName {# Parse a job specification of the form `<project>:<jobset>:<job># [attrs]'. The project, jobset and attrs may be omitted. The# attrs have the form `name = "value"'.my ($s) = @_;our $key;our %attrs = ();# hm, maybe I should stop programming Perl before it's too late...$s =~ / ^ (?: (?: ([\w\-]+) : )? ([\w\-]+) : )? ([\w\-]+) \s*(\[ \s* (([\w]+) (?{ $key = $^N; }) \s* = \s* \"([\w\-]+) (?{ $attrs{$key} = $^N; }) \"\s* )* \])? $/xor die "invalid job specifier `$s'";return ($1, $2, $3, \%attrs);}sub attrsToSQL {my ($attrs, $id) = @_;my $query = "1 = 1";foreach my $name (keys %{$attrs}) {my $value = $attrs->{$name};$name =~ /^[\w\-]+$/ or die;$value =~ /^[\w\-]+$/ or die;# !!! Yes, this is horribly injection-prone... (though# name/value are filtered above). Should use SQL::Abstract,# but it can't deal with subqueries. At least we should use# placeholders.$query .= " and exists (select 1 from buildinputs where build = $id and name = '$name' and value = '$value')";}return $query; - replacement in src/script/hydra_scheduler.pl at line 193
my $jobName = $alt->value or die;my ($projectName, $jobsetName, $jobName, $attrs) = parseJobName($alt->value);$projectName ||= $project->name;$jobsetName ||= $jobset->name; - replacement in src/script/hydra_scheduler.pl at line 199
{finished => 1, project => $project->name, jobset => $jobset->name, job => $jobName, buildStatus => 0},{join => 'resultInfo', order_by => "me.id DESC", rows => 1});{ finished => 1, project => $projectName, jobset => $jobsetName, job => $jobName, buildStatus => 0 },{ join => 'resultInfo', order_by => "me.id DESC", rows => 1, where => \ attrsToSQL($attrs, "me.id") }); - replacement in src/script/hydra_scheduler.pl at line 205
print STDERR "no previous build available for `$jobName'";print STDERR "input `", $input->name, "': no previous build available\n"; - edit in src/script/hydra_scheduler.pl at line 208
#print STDERR "input `", $input->name, "': using build ", $prevBuild->id, "\n"; - replacement in src/script/hydra_scheduler.pl at line 358
sub checkJobSet {sub checkJobset { - edit in src/script/hydra_scheduler.pl at line 362[5.2026]→[5.2026:2048](∅→∅),[5.2048]→[5.1141:1193](∅→∅),[5.1193]→[5.2113:2121](∅→∅),[5.2113]→[5.2113:2121](∅→∅),[5.328]→[5.3941:3942](∅→∅),[5.3941]→[5.3941:3942](∅→∅)
$db->txn_do(sub {$jobset->update({lastcheckedtime => time});}); - edit in src/script/hydra_scheduler.pl at line 398
$jobset->update({lastcheckedtime => time}); - replacement in src/script/hydra_scheduler.pl at line 420
sub checkJobs {sub checkJobsetWrapped {my ($project, $jobset) = @_;print "considering jobset ", $jobset->name, " in ", $project->name, "\n";eval {checkJobset($project, $jobset);};if ($@) {my $msg = $@;print "error evaluating jobset ", $jobset->name, ": $msg";$db->txn_do(sub {$jobset->update({lastcheckedtime => time});setJobsetError($jobset, $msg);});}} - edit in src/script/hydra_scheduler.pl at line 440
sub checkJobs { - replacement in src/script/hydra_scheduler.pl at line 443[5.4467]→[5.10009:10063](∅→∅),[5.10009]→[5.10009:10063](∅→∅),[5.10063]→[5.4468:4554](∅→∅),[5.4554]→[5.1832:1899](∅→∅),[5.10115]→[5.1832:1899](∅→∅),[5.1899]→[5.4555:4665](∅→∅),[5.4665]→[5.5368:5413](∅→∅),[5.5413]→[5.4711:4735](∅→∅),[5.4711]→[5.4711:4735](∅→∅)
foreach my $jobset ($project->jobsets->all) {print "considering jobset ", $jobset->name, " in ", $project->name, "\n";eval {checkJobSet($project, $jobset);};if ($@) {print "error evaluating jobset ", $jobset->name, ": $@";setJobsetError($jobset, $@);}}checkJobsetWrapped($project, $_) foreach $project->jobsets->all; - edit in src/script/hydra_scheduler.pl at line 445
- replacement in src/script/hydra_scheduler.pl at line 453
checkJobSet($jobset->project, $jobset);checkJobsetWrapped($jobset->project, $jobset);