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
7e91780e
Commit
7e91780e
authored
Apr 01, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue_198156' into 'master'
Fix epics search query See merge request gitlab-org/gitlab!28380
parents
51aad1dd
dcdbc377
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
ee/app/finders/epics_finder.rb
ee/app/finders/epics_finder.rb
+6
-1
ee/spec/finders/epics_finder_spec.rb
ee/spec/finders/epics_finder_spec.rb
+15
-0
No files found.
ee/app/finders/epics_finder.rb
View file @
7e91780e
...
@@ -55,7 +55,6 @@ class EpicsFinder < IssuableFinder
...
@@ -55,7 +55,6 @@ class EpicsFinder < IssuableFinder
items
=
init_collection
items
=
init_collection
items
=
by_created_at
(
items
)
items
=
by_created_at
(
items
)
items
=
by_updated_at
(
items
)
items
=
by_updated_at
(
items
)
items
=
by_search
(
items
)
items
=
by_author
(
items
)
items
=
by_author
(
items
)
items
=
by_timeframe
(
items
)
items
=
by_timeframe
(
items
)
items
=
by_state
(
items
)
items
=
by_state
(
items
)
...
@@ -64,6 +63,12 @@ class EpicsFinder < IssuableFinder
...
@@ -64,6 +63,12 @@ class EpicsFinder < IssuableFinder
items
=
by_iids
(
items
)
items
=
by_iids
(
items
)
items
=
starts_with_iid
(
items
)
items
=
starts_with_iid
(
items
)
# This has to be last as we use a CTE as an optimization fence
# for counts by passing the force_cte param and enabling the
# attempt_group_search_optimizations feature flag
# https://www.postgresql.org/docs/current/static/queries-with.html
items
=
by_search
(
items
)
sort
(
items
)
sort
(
items
)
end
end
...
...
ee/spec/finders/epics_finder_spec.rb
View file @
7e91780e
...
@@ -272,6 +272,21 @@ describe EpicsFinder do
...
@@ -272,6 +272,21 @@ describe EpicsFinder do
expect
{
epics
(
iid_starts_with:
'-1'
)
}.
to
raise_error
(
ArgumentError
)
expect
{
epics
(
iid_starts_with:
'-1'
)
}.
to
raise_error
(
ArgumentError
)
end
end
end
end
context
'when using group cte for search'
do
context
'and two labels more search string are present'
do
let_it_be
(
:label1
)
{
create
(
:label
)
}
let_it_be
(
:label2
)
{
create
(
:label
)
}
let!
(
:labeled_epic
)
{
create
(
:labeled_epic
,
group:
group
,
title:
'filtered epic'
,
labels:
[
label1
,
label2
])
}
it
'returns correct epics'
do
filtered_epics
=
epics
(
attempt_group_search_optimizations:
true
,
label_name:
[
label1
.
title
,
label2
.
title
],
search:
'filtered'
)
expect
(
filtered_epics
).
to
contain_exactly
(
labeled_epic
)
end
end
end
end
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