Commit e8c4ce24 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '339439-fj-use-linear_groups_template_finder_extended_group_search' into 'master'

Use linear version GroupsWithTemplatesFinder#extended_group_search

See merge request gitlab-org/gitlab!74595
parents 30cfc3c3 62533dd1
---
name: linear_groups_template_finder_extended_group_search
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68936
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/339439
milestone: '14.3'
type: development
group: group::access
default_enabled: false
......@@ -18,6 +18,7 @@ class GroupsWithTemplatesFinder
attr_reader :group_id
def extended_group_search
# We're adding an extra query that will be removed once we remove the feature flag in https://gitlab.com/gitlab-org/gitlab/-/issues/339439
groups = if Feature.enabled?(:linear_groups_template_finder_extended_group_search_ancestors_scopes, current_group, default_enabled: :yaml)
Group.with_project_templates.self_and_ancestors
else
......@@ -26,14 +27,7 @@ class GroupsWithTemplatesFinder
.base_and_ancestors
end
groups_with_plan = groups.with_feature_available_in_plan(:group_project_templates)
# We're adding an extra query that will be removed once we remove the feature flag in https://gitlab.com/gitlab-org/gitlab/-/issues/339439
if ::Feature.enabled?(:linear_groups_template_finder_extended_group_search, current_group, default_enabled: :yaml)
groups_with_plan.self_and_descendants
else
Gitlab::ObjectHierarchy.new(groups_with_plan).base_and_descendants
end
groups.with_feature_available_in_plan(:group_project_templates).self_and_descendants
end
def simple_group_search(groups)
......
......@@ -99,14 +99,6 @@ RSpec.describe GroupsWithTemplatesFinder, :saas do
it_behaves_like 'group template finder examples'
context 'when feature flag :linear_groups_template_finder_extended_group_search is disabled' do
before do
stub_feature_flags(linear_groups_template_finder_extended_group_search: false)
end
it_behaves_like 'group template finder examples'
end
context 'when feature flag :linear_groups_template_finder_extended_group_search_ancestors_scopes is disabled' do
before do
stub_feature_flags(linear_groups_template_finder_extended_group_search_ancestors_scopes: false)
......@@ -114,13 +106,4 @@ RSpec.describe GroupsWithTemplatesFinder, :saas do
it_behaves_like 'group template finder examples'
end
context 'when all linear feature flags are disabled' do
before do
stub_feature_flags(linear_groups_template_finder_extended_group_search: false)
stub_feature_flags(linear_groups_template_finder_extended_group_search_ancestors_scopes: false)
end
it_behaves_like 'group template finder examples'
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