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
8078e245
Commit
8078e245
authored
Aug 25, 2021
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use linear version ApplicationSettings#elasticsearch_limited_namespaces
Changelog: performance EE: true
parent
fe5831c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
10 deletions
+33
-10
config/feature_flags/development/linear_application_settings_elasticsearch_limited_namespaces.yml
...application_settings_elasticsearch_limited_namespaces.yml
+8
-0
ee/app/models/ee/application_setting.rb
ee/app/models/ee/application_setting.rb
+5
-1
ee/spec/models/application_setting_spec.rb
ee/spec/models/application_setting_spec.rb
+20
-9
No files found.
config/feature_flags/development/linear_application_settings_elasticsearch_limited_namespaces.yml
0 → 100644
View file @
8078e245
---
name
:
linear_application_settings_elasticsearch_limited_namespaces
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68931
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/339438
milestone
:
'
14.3'
type
:
development
group
:
group::access
default_enabled
:
false
ee/app/models/ee/application_setting.rb
View file @
8078e245
...
...
@@ -231,7 +231,11 @@ module EE
return
namespaces
if
ignore_descendants
::
Gitlab
::
ObjectHierarchy
.
new
(
namespaces
).
base_and_descendants
if
::
Feature
.
enabled?
(
:linear_application_settings_elasticsearch_limited_namespaces
,
default_enabled: :yaml
)
namespaces
.
self_and_descendants
else
::
Gitlab
::
ObjectHierarchy
.
new
(
namespaces
).
base_and_descendants
end
end
def
pseudonymizer_available?
...
...
ee/spec/models/application_setting_spec.rb
View file @
8078e245
...
...
@@ -400,18 +400,29 @@ RSpec.describe ApplicationSetting do
context
'with groups'
do
let
(
:groups
)
{
create_list
(
:group
,
2
)
}
let!
(
:indexed_namespace
)
{
create
:elasticsearch_indexed_namespace
,
namespace:
groups
.
last
}
let!
(
:indexed_namespace
)
{
create
(
:elasticsearch_indexed_namespace
,
namespace:
groups
.
last
)
}
let!
(
:child_group
)
{
create
(
:group
,
parent:
groups
.
first
)
}
let!
(
:child_group_indexed_through_parent
)
{
create
(
:group
,
parent:
groups
.
last
)
}
shared_examples
'returns groups that are allowed to be indexed'
do
specify
do
create
(
:elasticsearch_indexed_namespace
,
namespace:
child_group
)
expect
(
setting
.
elasticsearch_limited_namespaces
).
to
match_array
(
[
groups
.
last
,
child_group
,
child_group_indexed_through_parent
])
expect
(
setting
.
elasticsearch_limited_namespaces
(
true
)).
to
match_array
(
[
groups
.
last
,
child_group
])
end
end
it
'returns groups that are allowed to be indexed'
do
child_group
=
create
(
:group
,
parent:
groups
.
first
)
create
:elasticsearch_indexed_namespace
,
namespace:
child_group
it_behaves_like
'returns groups that are allowed to be indexed'
child_group_indexed_through_parent
=
create
(
:group
,
parent:
groups
.
last
)
context
'when feature flag :linear_application_settings_elasticsearch_limited_namespaces is disabled'
do
before
do
stub_feature_flags
(
linear_application_settings_elasticsearch_limited_namespaces:
false
)
end
expect
(
setting
.
elasticsearch_limited_namespaces
).
to
match_array
(
[
groups
.
last
,
child_group
,
child_group_indexed_through_parent
])
expect
(
setting
.
elasticsearch_limited_namespaces
(
true
)).
to
match_array
(
[
groups
.
last
,
child_group
])
it_behaves_like
'returns groups that are allowed to be indexed'
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