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
bb4687e4
Commit
bb4687e4
authored
May 08, 2020
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make elasticsearch check more thorough
So that allowed scopes are not overridden when limit_indexing is on
parent
bf44d054
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
ee/app/services/ee/search/global_service.rb
ee/app/services/ee/search/global_service.rb
+3
-1
ee/changelogs/unreleased/217158-nomethoderror-undefined-method-without_count-for-kaminari-pagin.yml
...ror-undefined-method-without_count-for-kaminari-pagin.yml
+6
-0
ee/spec/services/search/global_service_spec.rb
ee/spec/services/search/global_service_spec.rb
+18
-0
No files found.
ee/app/services/ee/search/global_service.rb
View file @
bb4687e4
...
...
@@ -42,9 +42,11 @@ module EE
override
:allowed_scopes
def
allowed_scopes
return
super
unless
use_elasticsearch?
strong_memoize
(
:ee_allowed_scopes
)
do
super
.
tap
do
|
ce_scopes
|
ce_scopes
.
concat
(
%w[notes wiki_blobs blobs commits]
)
if
::
Gitlab
::
CurrentSettings
.
elasticsearch_search?
ce_scopes
.
concat
(
%w[notes wiki_blobs blobs commits]
)
end
end
end
...
...
ee/changelogs/unreleased/217158-nomethoderror-undefined-method-without_count-for-kaminari-pagin.yml
0 → 100644
View file @
bb4687e4
---
title
:
Fix 500 errors caused by globally searching for scopes which cannot be used without
Elasticsearch
merge_request
:
31508
author
:
type
:
fixed
ee/spec/services/search/global_service_spec.rb
View file @
bb4687e4
...
...
@@ -169,4 +169,22 @@ describe Search::GlobalService do
end
end
end
describe
'#allowed_scopes'
do
context
'when ES is used'
do
it
'includes ES-specific scopes'
do
expect
(
described_class
.
new
(
user
,
{}).
allowed_scopes
).
to
include
(
'commits'
)
end
end
context
'when ES is not used'
do
before
do
stub_ee_application_setting
(
elasticsearch_limit_indexing:
true
)
end
it
'does not include ES-specific scopes'
do
expect
(
described_class
.
new
(
user
,
{}).
allowed_scopes
).
not_to
include
(
'commits'
)
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