Commit 5fd680f3 authored by Francisco Javier López's avatar Francisco Javier López Committed by Bob Van Landuyt

Use linear version ApplicationSettings#elasticsearch_limited_namespaces

parent 0f685998
---
name: linear_application_settings_elasticsearch_limited_namespaces
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68931
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/339438
milestone: '14.3'
type: development
group: group::access
default_enabled: false
......@@ -235,11 +235,7 @@ module EE
return namespaces if ignore_descendants
if ::Feature.enabled?(:linear_application_settings_elasticsearch_limited_namespaces, default_enabled: :yaml)
namespaces.self_and_descendants
else
::Gitlab::ObjectHierarchy.new(namespaces).base_and_descendants
end
namespaces.self_and_descendants
end
def pseudonymizer_available?
......
......@@ -440,25 +440,13 @@ RSpec.describe ApplicationSetting do
let!(:child_group) { create(:group, parent: groups.first) }
let!(:child_group_indexed_through_parent) { create(:group, parent: groups.last) }
shared_examples 'returns groups that are allowed to be indexed' do
specify do
create(:elasticsearch_indexed_namespace, namespace: child_group)
expect(setting.elasticsearch_limited_namespaces).to match_array(
[groups.last, child_group, child_group_indexed_through_parent])
expect(setting.elasticsearch_limited_namespaces(true)).to match_array(
[groups.last, child_group])
end
end
it_behaves_like 'returns groups that are allowed to be indexed'
context 'when feature flag :linear_application_settings_elasticsearch_limited_namespaces is disabled' do
before do
stub_feature_flags(linear_application_settings_elasticsearch_limited_namespaces: false)
end
specify do
create(:elasticsearch_indexed_namespace, namespace: child_group)
it_behaves_like 'returns groups that are allowed to be indexed'
expect(setting.elasticsearch_limited_namespaces).to match_array(
[groups.last, child_group, child_group_indexed_through_parent])
expect(setting.elasticsearch_limited_namespaces(true)).to match_array(
[groups.last, child_group])
end
end
......
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