diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-06-05 10:39:59 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-06-05 10:39:59 +0300 |
commit | 809a50fcbf5ecfbf5ec02671f1ca2710a96f58d3 (patch) | |
tree | 0b77ad7a705f6477b03d0f83634a73e3cf36f7d1 /app/services/ci/register_job_service.rb | |
parent | 114c26ccf0f10788271c6108774e72809a7f93e1 (diff) | |
parent | 04236363bce399fbde36f396fdcf51d61735e1b0 (diff) |
Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
Conflicts:
app/models/ci/pipeline.rb
Diffstat (limited to 'app/services/ci/register_job_service.rb')
-rw-r--r-- | app/services/ci/register_job_service.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb index 4291631913a..925775aea0b 100644 --- a/app/services/ci/register_job_service.rb +++ b/app/services/ci/register_job_service.rb @@ -89,7 +89,10 @@ 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 |