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
bea159ab
Commit
bea159ab
authored
Apr 28, 2020
by
Eugenia Grieff
Committed by
Jan Provaznik
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove feature flag board_search_optimization
- Update ListService to remove flag condition - Update Specs
parent
52661728
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
99 deletions
+22
-99
app/controllers/boards/issues_controller.rb
app/controllers/boards/issues_controller.rb
+0
-3
app/services/boards/issues/list_service.rb
app/services/boards/issues/list_service.rb
+2
-7
ee/spec/controllers/boards/issues_controller_spec.rb
ee/spec/controllers/boards/issues_controller_spec.rb
+12
-56
ee/spec/services/ee/boards/issues/list_service_spec.rb
ee/spec/services/ee/boards/issues/list_service_spec.rb
+8
-33
No files found.
app/controllers/boards/issues_controller.rb
View file @
bea159ab
...
...
@@ -20,9 +20,6 @@ module Boards
skip_before_action
:authenticate_user!
,
only:
[
:index
]
before_action
:validate_id_list
,
only:
[
:bulk_move
]
before_action
:can_move_issues?
,
only:
[
:bulk_move
]
before_action
do
push_frontend_feature_flag
(
:board_search_optimization
,
board
.
group
,
default_enabled:
true
)
end
def
index
list_service
=
Boards
::
Issues
::
ListService
.
new
(
board_parent
,
current_user
,
filter_params
)
...
...
app/services/boards/issues/list_service.rb
View file @
bea159ab
...
...
@@ -12,7 +12,7 @@ module Boards
def
execute
return
fetch_issues
.
order_closed_date_desc
if
list
&
.
closed?
fetch_issues
.
order_by_position_and_priority
(
with_cte:
can_attempt_search_optimization
?
)
fetch_issues
.
order_by_position_and_priority
(
with_cte:
params
[
:search
].
present
?
)
end
# rubocop: disable CodeReuse/ActiveRecord
...
...
@@ -91,7 +91,7 @@ module Boards
end
def
set_attempt_search_optimizations
return
unless
can_attempt_search_optimization
?
return
unless
params
[
:search
].
present
?
if
board
.
group_board?
params
[
:attempt_group_search_optimizations
]
=
true
...
...
@@ -130,11 +130,6 @@ module Boards
def
board_group
board
.
group_board?
?
parent
:
parent
.
group
end
def
can_attempt_search_optimization?
params
[
:search
].
present?
&&
Feature
.
enabled?
(
:board_search_optimization
,
board_group
,
default_enabled:
true
)
end
end
end
end
...
...
ee/spec/controllers/boards/issues_controller_spec.rb
View file @
bea159ab
...
...
@@ -73,11 +73,6 @@ describe Boards::IssuesController do
end
context
'with search param'
do
context
'when board_search_optimization is enabled'
do
before
do
stub_feature_flags
(
board_search_optimization:
true
)
end
it
'returns matching issues using optimized search'
do
create
(
:labeled_issue
,
project:
project_1
,
labels:
[
planning
],
title:
'Test Issue'
)
create
(
:labeled_issue
,
project:
project_1
,
labels:
[
planning
],
title:
'Sample Issue'
)
...
...
@@ -88,23 +83,6 @@ describe Boards::IssuesController do
expect
(
json_response
[
'issues'
].
length
).
to
eq
1
end
end
context
'when board_search_optimization is disabled'
do
before
do
stub_feature_flags
(
board_search_optimization:
false
)
end
it
'returns empty result'
do
create
(
:labeled_issue
,
project:
project_1
,
labels:
[
planning
],
title:
'Test Issue'
)
create
(
:labeled_issue
,
project:
project_1
,
labels:
[
planning
],
title:
'Sample Issue'
)
list_issues
user:
user
,
board:
board
,
list:
list1
,
search:
'Te'
expect
(
response
).
to
match_response_schema
(
'issues'
)
expect
(
json_response
[
'issues'
].
length
).
to
eq
0
end
end
end
end
context
'with invalid list id'
do
...
...
@@ -131,11 +109,6 @@ describe Boards::IssuesController do
end
context
'with search param'
do
context
'when board_search_optimization is enabled'
do
before
do
stub_feature_flags
(
board_search_optimization:
true
)
end
it
'returns matching issues using optimized search'
do
create
(
:issue
,
project:
project_1
,
title:
'Issue XI'
)
create
(
:issue
,
project:
project_1
,
title:
'Issue XX'
)
...
...
@@ -146,23 +119,6 @@ describe Boards::IssuesController do
expect
(
json_response
[
'issues'
].
length
).
to
eq
1
end
end
context
'when board_search_optimization is disabled'
do
before
do
stub_feature_flags
(
board_search_optimization:
false
)
end
it
'returns empty result'
do
create
(
:issue
,
project:
project_1
,
title:
'Issue XI'
)
create
(
:issue
,
project:
project_1
,
title:
'Issue XX'
)
list_issues
user:
user
,
board:
board
,
search:
'XI'
expect
(
response
).
to
match_response_schema
(
'issues'
)
expect
(
json_response
[
'issues'
].
length
).
to
eq
0
end
end
end
end
context
'with unauthorized user'
do
...
...
ee/spec/services/ee/boards/issues/list_service_spec.rb
View file @
bea159ab
...
...
@@ -153,21 +153,12 @@ describe Boards::Issues::ListService, services: true do
end
context
'when search param is present'
do
shared_examples
'returns correct result using 3 characters'
do
it
'returns correct issues'
do
params
=
{
board_id:
board
.
id
,
search:
'Iss'
}
issues
=
described_class
.
new
(
parent
,
user
,
params
).
execute
expect
(
issues
).
to
contain_exactly
(
opened_issue1
,
opened_issue2
,
reopened_issue1
)
end
end
context
'when board_search_optimization feature is enabled'
do
before
do
stub_feature_flags
(
board_search_optimization:
true
)
end
it_behaves_like
'returns correct result using 3 characters'
it
'returns correct issues using 2 characters'
do
params
=
{
board_id:
board
.
id
,
search:
'Is'
}
...
...
@@ -176,21 +167,5 @@ describe Boards::Issues::ListService, services: true do
expect
(
issues
).
to
contain_exactly
(
opened_issue1
,
opened_issue2
,
reopened_issue1
)
end
end
context
'when board_search_optimization feature is disabled'
do
before
do
stub_feature_flags
(
board_search_optimization:
false
)
end
it_behaves_like
'returns correct result using 3 characters'
it
'returns empty result using 2 characters'
do
params
=
{
board_id:
board
.
id
,
search:
'Is'
}
issues
=
described_class
.
new
(
parent
,
user
,
params
).
execute
expect
(
issues
).
to
be_empty
end
end
end
end
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