Enable linear ancestors for groups

In this commit, we're removing the feature flag
`linear_group_ancestor_scopes` to allow group queries
using linear queries.

Changelog: added
parent 2b5e3a6a
...@@ -194,13 +194,8 @@ class Group < Namespace ...@@ -194,13 +194,8 @@ class Group < Namespace
def ids_with_disabled_email(groups) def ids_with_disabled_email(groups)
inner_groups = Group.where('id = namespaces_with_emails_disabled.id') inner_groups = Group.where('id = namespaces_with_emails_disabled.id')
inner_ancestors = if Feature.enabled?(:linear_group_ancestor_scopes, default_enabled: :yaml) inner_query = inner_groups
inner_groups.self_and_ancestors .self_and_ancestors
else
Gitlab::ObjectHierarchy.new(inner_groups).base_and_ancestors
end
inner_query = inner_ancestors
.where(emails_disabled: true) .where(emails_disabled: true)
.select('1') .select('1')
.limit(1) .limit(1)
......
---
name: linear_group_ancestor_scopes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70495
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341115
milestone: '14.4'
type: development
group: group::access
default_enabled: false
...@@ -2648,14 +2648,6 @@ RSpec.describe Group do ...@@ -2648,14 +2648,6 @@ RSpec.describe Group do
end end
it_behaves_like 'returns namespaces with disabled email' it_behaves_like 'returns namespaces with disabled email'
context 'when feature flag :linear_group_ancestor_scopes is disabled' do
before do
stub_feature_flags(linear_group_ancestor_scopes: false)
end
it_behaves_like 'returns namespaces with disabled email'
end
end end
describe '.timelogs' do describe '.timelogs' do
......
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