From ed132cf1fc2a1ee43f923a68e68ee7edf1fedd5e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 3 Oct 2013 15:05:53 +0200 Subject: [PATCH] Remove obsolete JobStatus source --- src/lib/Hydra/Controller/Job.pm | 2 -- src/lib/Hydra/Controller/Jobset.pm | 2 -- src/lib/Hydra/Controller/Project.pm | 2 -- src/lib/Hydra/Controller/Root.pm | 1 - src/lib/Hydra/Schema/Builds.pm | 28 ---------------------------- tests/query-all-tables.pl | 4 ++-- 6 files changed, 2 insertions(+), 37 deletions(-) diff --git a/src/lib/Hydra/Controller/Job.pm b/src/lib/Hydra/Controller/Job.pm index 389a0791..fc37972d 100644 --- a/src/lib/Hydra/Controller/Job.pm +++ b/src/lib/Hydra/Controller/Job.pm @@ -71,8 +71,6 @@ sub overview : Chained('job') PathPart('') Args(0) { sub get_builds : Chained('job') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; $c->stash->{allBuilds} = $c->stash->{job}->builds; - $c->stash->{jobStatus} = $c->model('DB')->resultset('JobStatusForJob') - ->search({}, {bind => [$c->stash->{project}->name, $c->stash->{jobset}->name, $c->stash->{job}->name]}); $c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceededForJob') ->search({}, {bind => [$c->stash->{project}->name, $c->stash->{jobset}->name, $c->stash->{job}->name]}); $c->stash->{channelBaseName} = diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index 209acd4d..daa7ecb6 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -183,8 +183,6 @@ sub jobs_tab : Chained('jobsetChain') PathPart('jobs-tab') Args(0) { sub get_builds : Chained('jobsetChain') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; $c->stash->{allBuilds} = $c->stash->{jobset}->builds; - $c->stash->{jobStatus} = $c->model('DB')->resultset('JobStatusForJobset') - ->search({}, {bind => [$c->stash->{project}->name, $c->stash->{jobset}->name]}); $c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceededForJobset') ->search({}, {bind => [$c->stash->{project}->name, $c->stash->{jobset}->name]}); $c->stash->{channelBaseName} = diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index 78a8b09f..1d0c7753 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -202,8 +202,6 @@ sub updateProject { sub get_builds : Chained('projectChain') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; $c->stash->{allBuilds} = $c->stash->{project}->builds; - $c->stash->{jobStatus} = $c->model('DB')->resultset('JobStatusForProject') - ->search({}, {bind => [$c->stash->{project}->name]}); $c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceededForProject') ->search({}, {bind => [$c->stash->{project}->name]}); $c->stash->{channelBaseName} = $c->stash->{project}->name; diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 2854f889..5986f72f 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -150,7 +150,6 @@ sub machines :Local Args(0) { sub get_builds : Chained('/') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; $c->stash->{allBuilds} = $c->model('DB::Builds'); - $c->stash->{jobStatus} = $c->model('DB')->resultset('JobStatus'); $c->stash->{latestSucceeded} = $c->model('DB')->resultset('LatestSucceeded'); $c->stash->{channelBaseName} = "everything"; $c->stash->{total} = $c->model('DB::NrBuilds')->find('finished')->count; diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index e6daced1..59b06d77 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -576,34 +576,6 @@ sub makeQueries { my $activeJobs = "(select distinct project, jobset, job, system from Builds where isCurrent = 1 $constraint)"; - makeSource( - "JobStatus$name", - # Urgh, can't use "*" in the "select" here because of the status change join. - < c.id and - ((x.buildStatus = 0 and c.buildStatus != 0) or - (x.buildStatus != 0 and c.buildStatus = 0))) -QUERY - ); - makeSource( "LatestSucceeded$name", <new; my @sources = $db->schema->sources; my $nrtables = scalar(@sources); -use Test::Simple tests => 42; +use Test::Simple tests => 38; foreach my $source (@sources) { my $title = "Basic select query for $source"; if ($source eq "SchemaVersion" || $source eq "NrBuilds") { ok(scalar($db->resultset($source)->all) == 1, $title); - } elsif( $source !~ m/^(LatestSucceeded|JobStatus)/) { + } elsif( $source !~ m/^LatestSucceeded/) { ok(scalar($db->resultset($source)->all) == 0, $title); } else { ok(scalar($db->resultset($source)->search({},{ bind => ["", "", ""] })) == 0, $title);