Commit f2c70d82 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '20444-remove-feature-flag' into 'master'

Remove project_search_by_full_path feature flag

See merge request gitlab-org/gitlab!29448
parents e0a9eb64 a8068ea6
...@@ -591,7 +591,7 @@ class Project < ApplicationRecord ...@@ -591,7 +591,7 @@ class Project < ApplicationRecord
# #
# query - The search query as a String. # query - The search query as a String.
def search(query, include_namespace: false) def search(query, include_namespace: false)
if include_namespace && Feature.enabled?(:project_search_by_full_path, default_enabled: true) if include_namespace
joins(:route).fuzzy_search(query, [Route.arel_table[:path], Route.arel_table[:name], :description]) joins(:route).fuzzy_search(query, [Route.arel_table[:path], Route.arel_table[:name], :description])
else else
fuzzy_search(query, [:path, :name, :description]) fuzzy_search(query, [:path, :name, :description])
......
...@@ -1740,11 +1740,6 @@ describe Project do ...@@ -1740,11 +1740,6 @@ describe Project do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) } let_it_be(:project) { create(:project, group: group) }
context 'when feature is enabled' do
before do
stub_feature_flags(project_search_by_full_path: true)
end
it 'returns projects that match the group path' do it 'returns projects that match the group path' do
expect(described_class.search(group.path, include_namespace: true)).to eq([project]) expect(described_class.search(group.path, include_namespace: true)).to eq([project])
end end
...@@ -1754,21 +1749,6 @@ describe Project do ...@@ -1754,21 +1749,6 @@ describe Project do
end end
end end
context 'when feature is disabled' do
before do
stub_feature_flags(project_search_by_full_path: false)
end
it 'returns no results when searching by group path' do
expect(described_class.search(group.path, include_namespace: true)).to be_empty
end
it 'returns no results when searching by full path' do
expect(described_class.search(project.full_path, include_namespace: true)).to be_empty
end
end
end
describe 'with pending_delete project' do describe 'with pending_delete project' do
let(:pending_delete_project) { create(:project, pending_delete: true) } let(:pending_delete_project) { create(:project, pending_delete: true) }
......
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