Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-05-27 14:49:43 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-31 11:46:19 +0300
commit5c34c3fcd5f100b401b59d5a0f8e4fa0c899c8f5 (patch)
treee4183555224d17e2c7cd5c7d9a79b572d5d3686a /app/services
parent0a2f5065f26f259ed66359f3754ecc21505fea0d (diff)
Fix weird Rails bug that leads to `runner_id=null` in SQL query
Diffstat (limited to 'app/services')
-rw-r--r--app/services/ci/register_job_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb
index 4291631913a..9d288ca8038 100644
--- a/app/services/ci/register_job_service.rb
+++ b/app/services/ci/register_job_service.rb
@@ -89,7 +89,9 @@ module Ci
end
def builds_for_group_runner
- hierarchy_groups = Gitlab::GroupHierarchy.new(runner.groups).base_and_descendants
+ # Workaround for weird Rails bug, that makes `runner.groups.to_sql` to return `runner_id = NULL`
+ groups = Group.joins(:runner_namespaces).merge(runner.runner_namespaces)
+ hierarchy_groups = Gitlab::GroupHierarchy.new(groups).base_and_descendants
projects = Project.where(namespace_id: hierarchy_groups)
.with_group_runners_enabled
.with_builds_enabled