* Add the name of the jobset to ReleaseSetJobs, otherwise we can't

distinguish between jobs with the same name in different jobsets
  (e.g. "trunk" vs "stdenv-branch" for Nixpkgs).
* Renamed the "attrName" field of Builds to "job".
* Renamed the "id" field of BuildSteps to "build".
This commit is contained in:
Eelco Dolstra
2009-03-12 14:18:30 +00:00
parent fec08462ee
commit a623ad157e
29 changed files with 96 additions and 88 deletions

View File

@ -49,13 +49,13 @@ sub getLatestBuilds {
my @res = ();
foreach my $job ($builds->search({},
{group_by => ['project', 'attrname', 'system']}))
foreach my $build ($builds->search({},
{group_by => ['project', 'job', 'system']}))
{
my $attrs =
{ project => $job->get_column('project')
, attrname => $job->attrname
, system => $job->system
{ project => $build->get_column('project')
, job => $build->job
, system => $build->system
, finished => 1
};
my ($build) = $builds->search({ %$attrs, %$extraAttrs },

View File

@ -124,7 +124,7 @@ sub attrsToSQL {
sub getPrimaryBuildsForReleaseSet {
my ($project, $primaryJob) = @_;
my @primaryBuilds = $project->builds->search(
{ attrname => $primaryJob->job, finished => 1 },
{ job => $primaryJob->job, finished => 1 },
{ join => 'resultInfo', order_by => "timestamp DESC"
, '+select' => ["resultInfo.releasename"], '+as' => ["releasename"]
, where => \ attrsToSQL($primaryJob->attrs, "me.id")
@ -154,7 +154,7 @@ sub getRelease {
# as input. If there are multiple, prefer successful
# ones, and then oldest. !!! order_by buildstatus is hacky
($thisBuild) = $primaryBuild->dependentBuilds->search(
{ attrname => $job->job, finished => 1 },
{ job => $job->job, finished => 1 },
{ join => 'resultInfo', rows => 1
, order_by => ["buildstatus", "timestamp"]
, where => \ attrsToSQL($job->attrs, "build.id")