Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
abb677dd
Commit
abb677dd
authored
Jun 29, 2021
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove project_finder_similarity_sort feature flag
This enables the similarity sort Changelog: added
parent
b131b903
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
27 deletions
+1
-27
app/finders/projects_finder.rb
app/finders/projects_finder.rb
+1
-1
config/feature_flags/development/project_finder_similarity_sort.yml
...ture_flags/development/project_finder_similarity_sort.yml
+0
-8
spec/finders/projects_finder_spec.rb
spec/finders/projects_finder_spec.rb
+0
-8
spec/graphql/resolvers/projects_resolver_spec.rb
spec/graphql/resolvers/projects_resolver_spec.rb
+0
-10
No files found.
app/finders/projects_finder.rb
View file @
abb677dd
...
@@ -55,7 +55,7 @@ class ProjectsFinder < UnionFinder
...
@@ -55,7 +55,7 @@ class ProjectsFinder < UnionFinder
collection
=
Project
.
wrap_with_cte
(
collection
)
if
use_cte
collection
=
Project
.
wrap_with_cte
(
collection
)
if
use_cte
collection
=
filter_projects
(
collection
)
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
])
collection
.
sorted_by_similarity_desc
(
params
[
:search
])
else
else
sort
(
collection
)
sort
(
collection
)
...
...
config/feature_flags/development/project_finder_similarity_sort.yml
deleted
100644 → 0
View file @
b131b903
---
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
spec/finders/projects_finder_spec.rb
View file @
abb677dd
...
@@ -31,10 +31,6 @@ RSpec.describe ProjectsFinder do
...
@@ -31,10 +31,6 @@ RSpec.describe ProjectsFinder do
let
(
:use_cte
)
{
true
}
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
)
}
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
}
subject
{
finder
.
execute
}
shared_examples
'ProjectFinder#execute examples'
do
shared_examples
'ProjectFinder#execute examples'
do
...
@@ -389,10 +385,6 @@ RSpec.describe ProjectsFinder do
...
@@ -389,10 +385,6 @@ RSpec.describe ProjectsFinder do
create
(
:project
,
:internal
,
group:
group
,
name:
'projAB'
,
path:
'projAB'
)
create
(
:project
,
:internal
,
group:
group
,
name:
'projAB'
,
path:
'projAB'
)
end
end
before
do
stub_feature_flags
(
project_finder_similarity_sort:
current_user
)
end
it
{
is_expected
.
to
eq
([
internal_project2
,
internal_project4
,
internal_project3
])
}
it
{
is_expected
.
to
eq
([
internal_project2
,
internal_project4
,
internal_project3
])
}
end
end
end
end
...
...
spec/graphql/resolvers/projects_resolver_spec.rb
View file @
abb677dd
...
@@ -27,10 +27,6 @@ RSpec.describe Resolvers::ProjectsResolver do
...
@@ -27,10 +27,6 @@ RSpec.describe Resolvers::ProjectsResolver do
private_group
.
add_developer
(
user
)
private_group
.
add_developer
(
user
)
end
end
before
do
stub_feature_flags
(
project_finder_similarity_sort:
false
)
end
context
'when user is not logged in'
do
context
'when user is not logged in'
do
let
(
:current_user
)
{
nil
}
let
(
:current_user
)
{
nil
}
...
@@ -137,14 +133,8 @@ RSpec.describe Resolvers::ProjectsResolver do
...
@@ -137,14 +133,8 @@ RSpec.describe Resolvers::ProjectsResolver do
let
(
:filters
)
{
{
search:
'projA'
,
sort:
'similarity'
}
}
let
(
:filters
)
{
{
search:
'projA'
,
sort:
'similarity'
}
}
it
'returns projects in order of similarity to search'
do
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
])
is_expected
.
to
eq
([
named_project3
,
named_project1
,
named_project2
])
end
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
end
context
'when topics filter is provided'
do
context
'when topics filter is provided'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment