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
f4f0e1b8
Commit
f4f0e1b8
authored
Oct 23, 2019
by
Jesse Hall
Committed by
Sean McGivern
Oct 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #33792, users can filter by bad author name and search term in group issues and MRs
parent
ecbdf803
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+1
-0
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+14
-0
spec/finders/merge_requests_finder_spec.rb
spec/finders/merge_requests_finder_spec.rb
+12
-0
No files found.
app/finders/issuable_finder.rb
View file @
f4f0e1b8
...
...
@@ -483,6 +483,7 @@ class IssuableFinder
# rubocop: disable CodeReuse/ActiveRecord
def
by_search
(
items
)
return
items
unless
search
return
items
if
items
.
is_a?
(
ActiveRecord
::
NullRelation
)
if
use_cte_for_search?
cte
=
Gitlab
::
SQL
::
RecursiveCTE
.
new
(
klass
.
table_name
)
...
...
spec/finders/issues_finder_spec.rb
View file @
f4f0e1b8
...
...
@@ -163,6 +163,20 @@ describe IssuesFinder do
end
end
context
'filtering by nonexistent author ID and issue term using CTE for search'
do
let
(
:params
)
do
{
author_id:
'does-not-exist'
,
search:
'git'
,
attempt_group_search_optimizations:
true
}
end
it
'returns no results'
do
expect
(
issues
).
to
be_empty
end
end
context
'filtering by milestone'
do
let
(
:params
)
{
{
milestone_title:
milestone
.
title
}
}
...
...
spec/finders/merge_requests_finder_spec.rb
View file @
f4f0e1b8
...
...
@@ -23,6 +23,18 @@ describe MergeRequestsFinder do
expect
(
merge_requests
).
to
contain_exactly
(
merge_request1
)
end
it
'filters by nonexistent author ID and MR term using CTE for search'
do
params
=
{
author_id:
'does-not-exist'
,
search:
'git'
,
attempt_group_search_optimizations:
true
}
merge_requests
=
described_class
.
new
(
user
,
params
).
execute
expect
(
merge_requests
).
to
be_empty
end
it
'filters by projects'
do
params
=
{
projects:
[
project2
.
id
,
project3
.
id
]
}
...
...
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