Use linear version of User#ci_owned_runners

In this commit we're adding a feature flag
to test the linear version of the
User#ci_owned_runners method.

Changelog: performance
parent fabcc24b
...@@ -1614,8 +1614,14 @@ class User < ApplicationRecord ...@@ -1614,8 +1614,14 @@ class User < ApplicationRecord
.joins(:runner) .joins(:runner)
.select('ci_runners.*') .select('ci_runners.*')
base_and_descendants = if Feature.enabled?(:linear_user_ci_owned_runners, self, default_enabled: :yaml)
owned_groups.self_and_descendant_ids
else
Gitlab::ObjectHierarchy.new(owned_groups).base_and_descendants.select(:id)
end
group_runners = Ci::RunnerNamespace group_runners = Ci::RunnerNamespace
.where(namespace_id: Gitlab::ObjectHierarchy.new(owned_groups).base_and_descendants.select(:id)) .where(namespace_id: base_and_descendants)
.joins(:runner) .joins(:runner)
.select('ci_runners.*') .select('ci_runners.*')
......
---
name: linear_user_ci_owned_runners
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68848
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/339435
milestone: '14.6'
type: development
group: group::access
default_enabled: false
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment