Commit 5e510997 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '341346-fj-remove-linear-application-settings-ancestors-ff' into 'master'

Enable linear ApplicationSettings ancestors queries

See merge request gitlab-org/gitlab!72500
parents bff6c914 6ab1a7ae
---
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
def elasticsearch_limited_project_exists?(project)
project_namespaces = ::Namespace.where(id: project.namespace_id)
indexed_namespaces = if ::Feature.enabled?(:linear_application_setting_ancestor_scopes, default_enabled: :yaml)
project_namespaces.self_and_ancestors
else
::Gitlab::ObjectHierarchy.new(project_namespaces).base_and_ancestors
end
self_and_ancestors_namespaces = project_namespaces.self_and_ancestors.joins(:elasticsearch_indexed_namespace)
indexed_namespaces = indexed_namespaces.joins(:elasticsearch_indexed_namespace)
indexed_namespaces = ::Project.where('EXISTS (?)', indexed_namespaces)
indexed_namespaces = ::Project.where('EXISTS (?)', self_and_ancestors_namespaces)
indexed_projects = ::Project.where('EXISTS (?)', ElasticsearchIndexedProject.where(project_id: project.id))
::Project
......
......@@ -457,14 +457,6 @@ RSpec.describe ApplicationSetting do
end
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
......
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