LatestSucceededForJob{,set}: Filter with jobset_id

This commit is contained in:
Graham Christensen 2020-02-05 17:02:56 -05:00
parent 66fbbd9692
commit f0f41eaaff
No known key found for this signature in database
GPG key ID: FE918C3A98C1030F
4 changed files with 7 additions and 7 deletions

View file

@ -172,7 +172,7 @@ sub get_builds : Chained('job') PathPart('') CaptureArgs(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
$c->stash->{allBuilds} = $c->stash->{job}->builds; $c->stash->{allBuilds} = $c->stash->{job}->builds;
$c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceededForJob') $c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceededForJob')
->search({}, {bind => [$c->stash->{project}->name, $c->stash->{jobset}->name, $c->stash->{job}->name]}); ->search({}, {bind => [$c->stash->{jobset}->name, $c->stash->{job}->name]});
$c->stash->{channelBaseName} = $c->stash->{channelBaseName} =
$c->stash->{project}->name . "-" . $c->stash->{jobset}->name . "-" . $c->stash->{job}->name; $c->stash->{project}->name . "-" . $c->stash->{jobset}->name . "-" . $c->stash->{job}->name;
} }

View file

@ -162,7 +162,7 @@ sub get_builds : Chained('jobsetChain') PathPart('') CaptureArgs(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
$c->stash->{allBuilds} = $c->stash->{jobset}->builds; $c->stash->{allBuilds} = $c->stash->{jobset}->builds;
$c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceededForJobset') $c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceededForJobset')
->search({}, {bind => [$c->stash->{project}->name, $c->stash->{jobset}->name]}); ->search({}, {bind => [$c->stash->{jobset}->name]});
$c->stash->{channelBaseName} = $c->stash->{channelBaseName} =
$c->stash->{project}->name . "-" . $c->stash->{jobset}->name; $c->stash->{project}->name . "-" . $c->stash->{jobset}->name;
} }

View file

@ -637,8 +637,8 @@ QUERY
makeQueries('', ""); makeQueries('', "");
makeQueries('ForProject', "and project = ?"); makeQueries('ForProject', "and project = ?");
makeQueries('ForJobset', "and project = ? and jobset = ?"); makeQueries('ForJobset', "and jobset_id = (select id from jobsets j where j.name = ?)");
makeQueries('ForJob', "and project = ? and jobset = ? and job = ?"); makeQueries('ForJob', "and jobset_id = (select id from jobsets j where j.name = ?) and job = ?");
my %hint = ( my %hint = (

View file

@ -143,7 +143,7 @@ sub fetchInputSystemBuild {
$jobsetName ||= $jobset->name; $jobsetName ||= $jobset->name;
my @latestBuilds = $db->resultset('LatestSucceededForJob') my @latestBuilds = $db->resultset('LatestSucceededForJob')
->search({}, {bind => [$projectName, $jobsetName, $jobName]}); ->search({}, {bind => [$jobsetName, $jobName]});
my @validBuilds = (); my @validBuilds = ();
foreach my $build (@latestBuilds) { foreach my $build (@latestBuilds) {