summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-06-15 13:06:49 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-06-28 11:32:34 +0100
commit34f57b462bc14ad194cf890a4585d403bdbde55c (patch)
tree6edd502ba8b3c0bca4e8b77492ac0936d3c52cf2 /app/services
parent8e8eb97861a8a93625590274af8382e9333cbf91 (diff)
downloadgitlab-ce-34f57b462bc14ad194cf890a4585d403bdbde55c.tar.gz
Fix current feature related specs
Diffstat (limited to 'app/services')
-rw-r--r--app/services/ci/register_job_service.rb8
-rw-r--r--app/services/groups/destroy_service.rb2
-rw-r--r--app/services/users/destroy_service.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb
index af84d4c7427..27bdb6b9a2f 100644
--- a/app/services/ci/register_job_service.rb
+++ b/app/services/ci/register_job_service.rb
@@ -54,9 +54,9 @@ module Ci
def builds_for_shared_runner
new_builds.
# don't run projects which have not enabled shared runners and builds
- joins(:project).where(projects: { shared_runners_enabled: true })
- .joins('LEFT JOIN project_features ON ci_builds.project_id = project_features.project_id')
- .where('project_features.builds_access_level IS NULL or project_features.builds_access_level > 0').
+ joins(:project).where(projects: { shared_runners_enabled: true, pending_delete: false }).
+ joins('LEFT JOIN project_features ON ci_builds.project_id = project_features.project_id').
+ where('project_features.builds_access_level IS NULL or project_features.builds_access_level > 0').
# Implement fair scheduling
# this returns builds that are ordered by number of running builds
@@ -66,7 +66,7 @@ module Ci
end
def builds_for_specific_runner
- new_builds.where(project: runner.projects.with_builds_enabled).order('created_at ASC')
+ new_builds.where(project: runner.projects.without_deleted.with_builds_enabled).order('created_at ASC')
end
def running_builds_for_shared_runners
diff --git a/app/services/groups/destroy_service.rb b/app/services/groups/destroy_service.rb
index 497fdb09cdc..d40d280140a 100644
--- a/app/services/groups/destroy_service.rb
+++ b/app/services/groups/destroy_service.rb
@@ -10,7 +10,7 @@ module Groups
def execute
group.prepare_for_destroy
- group.projects.with_deleted.each do |project|
+ group.projects.each do |project|
# Execute the destruction of the models immediately to ensure atomic cleanup.
# Skip repository removal because we remove directory with namespace
# that contain all these repositories
diff --git a/app/services/users/destroy_service.rb b/app/services/users/destroy_service.rb
index 673afb8b5b9..9d7237c2fbb 100644
--- a/app/services/users/destroy_service.rb
+++ b/app/services/users/destroy_service.rb
@@ -35,7 +35,7 @@ module Users
Groups::DestroyService.new(group, current_user).execute
end
- user.personal_projects.with_deleted.each do |project|
+ user.personal_projects.each do |project|
# Skip repository removal because we remove directory with namespace
# that contain all this repositories
::Projects::DestroyService.new(project, current_user, skip_repo: true).execute