* In job inputs of type "build", allow the project and jobset names of

[?]
Mar 20, 2009, 2:50 PM
NI5BVF2VLMDA7REXTV455SUCQAYMKPKNKQSRII2SJJGG2TCX4CTAC

Dependencies

  • [2] 5GRJZZOR
  • [3] S5PV6IIM * Represent jobs explicitly in the DB.
  • [4] F2G7Z2XK * Doh.
  • [5] M3WSK4CB
  • [6] 2T42QGZD * Register builds as GC roots so they don't get deleted.
  • [7] M552HLIA * Support variant builds.
  • [8] 3ZCEPLNO
  • [9] IN272KZW * Automatically keep all builds in the latest successful release in
  • [10] SHZLOM5M * eval-jobs -> hydra_eval_jobs.
  • [11] NLJJZVHO * Use ->update({...}) properly.
  • [12] POPU2ATH * hydra_scheduler: use eval-jobs.
  • [13] ZVTSOVHN * Support Subversion checkouts.
  • [14] H7CNGK4O * Log evaluation errors etc. in the DB.
  • [15] FDE3BJAP * Refactoring.
  • [16] GCHNNFZP
  • [17] E6IC7YIK * Release sets: need to include the jobset name to disambiguate
  • [18] EBUKGUD5 * Ordering by timestamp isn't a good idea here since a newer revision
  • [19] AFTXA575 * $HYDRA_DATA environment variable.
  • [20] X27GNHDV * Basic job info in the database.
  • [21] 7ZHHVD6Q * Inputs of type "build" must now be declared explicitly.
  • [22] 3E6IP3R3 * Add the name of the jobset to ReleaseSetJobs, otherwise we can't
  • [*] 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
    [5.1254][5.1254:1377]()
    $query .= " and (select count(*) from buildinputs where build = $id and name = '$name' and value = '$value') = 1";
    [5.1254]
    [5.1377]
    $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* )* \])? $
    /x
    or 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
    [5.213][5.213:255]()
    my $jobName = $alt->value or die;
    [5.213]
    [5.255]
    my ($projectName, $jobsetName, $jobName, $attrs) = parseJobName($alt->value);
    $projectName ||= $project->name;
    $jobsetName ||= $jobset->name;
  • replacement in src/script/hydra_scheduler.pl at line 199
    [5.386][5.5354:5470](),[5.5470][4.0:74]()
    {finished => 1, project => $project->name, jobset => $jobset->name, job => $jobName, buildStatus => 0},
    {join => 'resultInfo', order_by => "me.id DESC", rows => 1});
    [5.386]
    [5.585]
    { 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
    [5.658][5.658:729]()
    print STDERR "no previous build available for `$jobName'";
    [5.658]
    [5.729]
    print STDERR "input `", $input->name, "': no previous build available\n";
  • edit in src/script/hydra_scheduler.pl at line 208
    [5.765]
    [5.765]
    #print STDERR "input `", $input->name, "': using build ", $prevBuild->id, "\n";
  • replacement in src/script/hydra_scheduler.pl at line 358
    [5.3982][5.3617:3635](),[5.3617][5.3617:3635]()
    sub checkJobSet {
    [5.3982]
    [5.3635]
    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
    [3.6163]
    [3.6163]
    $jobset->update({lastcheckedtime => time});
  • replacement in src/script/hydra_scheduler.pl at line 420
    [5.9884][5.9884:9900]()
    sub checkJobs {
    [5.9884]
    [5.9900]
    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
    [5.9901]
    [5.1752]
    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, $@);
    }
    }
    [5.4467]
    [5.10169]
    checkJobsetWrapped($project, $_) foreach $project->jobsets->all;
  • edit in src/script/hydra_scheduler.pl at line 445
    [5.10175][5.10175:10180]()
  • replacement in src/script/hydra_scheduler.pl at line 453
    [2.228][2.228:272]()
    checkJobSet($jobset->project, $jobset);
    [2.228]
    [2.272]
    checkJobsetWrapped($jobset->project, $jobset);