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
ddbaca38
Commit
ddbaca38
authored
Jan 04, 2021
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check user for project_finder_similarity_sort feature
parent
f684cd89
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
app/finders/projects_finder.rb
app/finders/projects_finder.rb
+1
-1
spec/finders/projects_finder_spec.rb
spec/finders/projects_finder_spec.rb
+1
-1
spec/graphql/resolvers/projects_resolver_spec.rb
spec/graphql/resolvers/projects_resolver_spec.rb
+1
-1
No files found.
app/finders/projects_finder.rb
View file @
ddbaca38
...
...
@@ -52,7 +52,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
)
if
params
[
:sort
]
==
'similarity'
&&
params
[
:search
]
&&
Feature
.
enabled?
(
:project_finder_similarity_sort
,
current_user
)
collection
.
sorted_by_similarity_desc
(
params
[
:search
])
else
sort
(
collection
)
...
...
spec/finders/projects_finder_spec.rb
View file @
ddbaca38
...
...
@@ -353,7 +353,7 @@ RSpec.describe ProjectsFinder, :do_not_mock_admin_mode do
end
before
do
stub_feature_flags
(
project_finder_similarity_sort:
true
)
stub_feature_flags
(
project_finder_similarity_sort:
current_user
)
end
it
{
is_expected
.
to
eq
([
internal_project2
,
internal_project4
,
internal_project3
])
}
...
...
spec/graphql/resolvers/projects_resolver_spec.rb
View file @
ddbaca38
...
...
@@ -129,7 +129,7 @@ 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:
true
)
stub_feature_flags
(
project_finder_similarity_sort:
current_user
)
is_expected
.
to
eq
([
named_project3
,
named_project1
,
named_project2
])
end
...
...
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