Commit abb677dd authored by Jonathan Schafer's avatar Jonathan Schafer

Remove project_finder_similarity_sort feature flag

This enables the similarity sort

Changelog: added
parent b131b903
......@@ -55,7 +55,7 @@ class ProjectsFinder < UnionFinder
collection = Project.wrap_with_cte(collection) if use_cte
collection = filter_projects(collection)
if params[:sort] == 'similarity' && params[:search] && Feature.enabled?(:project_finder_similarity_sort, current_user)
if params[:sort] == 'similarity' && params[:search]
collection.sorted_by_similarity_desc(params[:search])
else
sort(collection)
......
---
name: project_finder_similarity_sort
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/43136
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/263249
milestone: '13.5'
type: development
group: group::threat insights
default_enabled: false
......@@ -31,10 +31,6 @@ RSpec.describe ProjectsFinder do
let(:use_cte) { true }
let(:finder) { described_class.new(params: params.merge(use_cte: use_cte), current_user: current_user, project_ids_relation: project_ids_relation) }
before do
stub_feature_flags(project_finder_similarity_sort: false)
end
subject { finder.execute }
shared_examples 'ProjectFinder#execute examples' do
......@@ -389,10 +385,6 @@ RSpec.describe ProjectsFinder do
create(:project, :internal, group: group, name: 'projAB', path: 'projAB')
end
before do
stub_feature_flags(project_finder_similarity_sort: current_user)
end
it { is_expected.to eq([internal_project2, internal_project4, internal_project3]) }
end
end
......
......@@ -27,10 +27,6 @@ RSpec.describe Resolvers::ProjectsResolver do
private_group.add_developer(user)
end
before do
stub_feature_flags(project_finder_similarity_sort: false)
end
context 'when user is not logged in' do
let(:current_user) { nil }
......@@ -137,14 +133,8 @@ RSpec.describe Resolvers::ProjectsResolver do
let(:filters) { { search: 'projA', sort: 'similarity' } }
it 'returns projects in order of similarity to search' do
stub_feature_flags(project_finder_similarity_sort: current_user)
is_expected.to eq([named_project3, named_project1, named_project2])
end
it 'returns projects in any order if flag is off' do
is_expected.to match_array([named_project3, named_project1, named_project2])
end
end
context 'when topics filter is provided' do
......
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