Enable linear ApplicationSettings ancestors queries

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

Changelog: added
EE: true
parent d74d0483
---
name: linear_application_setting_ancestor_scopes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70579
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341346
milestone: '14.4'
type: development
group: group::access
default_enabled: false
...@@ -385,14 +385,9 @@ module EE ...@@ -385,14 +385,9 @@ module EE
def elasticsearch_limited_project_exists?(project) def elasticsearch_limited_project_exists?(project)
project_namespaces = ::Namespace.where(id: project.namespace_id) project_namespaces = ::Namespace.where(id: project.namespace_id)
indexed_namespaces = if ::Feature.enabled?(:linear_application_setting_ancestor_scopes, default_enabled: :yaml) self_and_ancestors_namespaces = project_namespaces.self_and_ancestors.joins(:elasticsearch_indexed_namespace)
project_namespaces.self_and_ancestors
else indexed_namespaces = ::Project.where('EXISTS (?)', self_and_ancestors_namespaces)
::Gitlab::ObjectHierarchy.new(project_namespaces).base_and_ancestors
end
indexed_namespaces = indexed_namespaces.joins(:elasticsearch_indexed_namespace)
indexed_namespaces = ::Project.where('EXISTS (?)', indexed_namespaces)
indexed_projects = ::Project.where('EXISTS (?)', ElasticsearchIndexedProject.where(project_id: project.id)) indexed_projects = ::Project.where('EXISTS (?)', ElasticsearchIndexedProject.where(project_id: project.id))
::Project ::Project
......
...@@ -457,14 +457,6 @@ RSpec.describe ApplicationSetting do ...@@ -457,14 +457,6 @@ RSpec.describe ApplicationSetting do
end end
it_behaves_like 'whether the project is indexed' it_behaves_like 'whether the project is indexed'
context 'when feature flag :linear_application_setting_ancestor_scopes is disabled' do
before do
stub_feature_flags(linear_application_setting_ancestor_scopes: false)
end
it_behaves_like 'whether the project is indexed'
end
end end
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