* Represent jobs explicitly in the DB.

This commit is contained in:
Eelco Dolstra
2009-03-13 14:49:25 +00:00
parent a39a28dffb
commit ae364b9e5f
25 changed files with 178 additions and 57 deletions

View File

@ -54,7 +54,7 @@ sub getLatestBuilds {
{
my $attrs =
{ project => $build->get_column('project')
, job => $build->job
, job => $build->get_column('job')
, system => $build->system
, finished => 1
};

View File

@ -124,7 +124,7 @@ sub attrsToSQL {
sub getPrimaryBuildsForReleaseSet {
my ($project, $primaryJob) = @_;
my @primaryBuilds = $project->builds->search(
{ job => $primaryJob->job, finished => 1 },
{ job => $primaryJob->get_column('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(
{ job => $job->job, finished => 1 },
{ job => $job->get_column('job'), finished => 1 },
{ join => 'resultInfo', rows => 1
, order_by => ["buildstatus", "timestamp"]
, where => \ attrsToSQL($job->attrs, "build.id")