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
a14eddb6
Commit
a14eddb6
authored
Sep 23, 2020
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove restricted_snippet_scope_search flag
parent
047a3c49
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
29 deletions
+0
-29
ee/app/helpers/ee/search_helper.rb
ee/app/helpers/ee/search_helper.rb
+0
-1
ee/config/feature_flags/development/restricted_snippet_scope_search.yml
...ure_flags/development/restricted_snippet_scope_search.yml
+0
-7
ee/lib/ee/gitlab/snippet_search_results.rb
ee/lib/ee/gitlab/snippet_search_results.rb
+0
-1
ee/spec/helpers/search_helper_spec.rb
ee/spec/helpers/search_helper_spec.rb
+0
-8
ee/spec/lib/ee/gitlab/snippet_search_results_spec.rb
ee/spec/lib/ee/gitlab/snippet_search_results_spec.rb
+0
-12
No files found.
ee/app/helpers/ee/search_helper.rb
View file @
a14eddb6
...
...
@@ -90,7 +90,6 @@ module EE
@current_user
&&
@show_snippets
&&
::
Gitlab
.
com?
&&
::
Feature
.
enabled?
(
:restricted_snippet_scope_search
,
default_enabled:
true
)
&&
::
Gitlab
::
CurrentSettings
.
search_using_elasticsearch?
(
scope:
nil
)
end
end
...
...
ee/config/feature_flags/development/restricted_snippet_scope_search.yml
deleted
100644 → 0
View file @
047a3c49
---
name
:
restricted_snippet_scope_search
introduced_by_url
:
rollout_issue_url
:
group
:
type
:
development
default_enabled
:
true
ee/lib/ee/gitlab/snippet_search_results.rb
View file @
a14eddb6
...
...
@@ -10,7 +10,6 @@ module EE
override
:finder_params
def
finder_params
return
super
unless
::
Gitlab
.
com?
return
super
unless
::
Feature
.
enabled?
(
:restricted_snippet_scope_search
,
default_enabled:
true
)
{
authorized_and_user_personal:
true
}
end
...
...
ee/spec/helpers/search_helper_spec.rb
View file @
a14eddb6
...
...
@@ -68,7 +68,6 @@ RSpec.describe SearchHelper do
describe
'#search_entries_info_template'
do
let
(
:com_value
)
{
true
}
let
(
:flag_enabled
)
{
true
}
let
(
:elasticsearch_enabled
)
{
true
}
let
(
:show_snippets
)
{
true
}
let
(
:collection
)
{
Kaminari
.
paginate_array
([
:foo
]).
page
(
1
).
per
(
10
)
}
...
...
@@ -83,7 +82,6 @@ RSpec.describe SearchHelper do
@current_user
=
user
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
com_value
)
stub_feature_flags
(
restricted_snippet_scope_search:
flag_enabled
)
stub_ee_application_setting
(
search_using_elasticsearch:
elasticsearch_enabled
)
end
...
...
@@ -105,12 +103,6 @@ RSpec.describe SearchHelper do
it_behaves_like
'returns old message'
end
context
'when flag restricted_snippet_scope_search is not enabled'
do
let
(
:flag_enabled
)
{
false
}
it_behaves_like
'returns old message'
end
context
'when elastic search is not enabled'
do
let
(
:elasticsearch_enabled
)
{
false
}
...
...
ee/spec/lib/ee/gitlab/snippet_search_results_spec.rb
View file @
a14eddb6
...
...
@@ -5,13 +5,11 @@ RSpec.describe Gitlab::SnippetSearchResults do
let_it_be
(
:snippet
)
{
create
(
:snippet
,
title:
'foo'
,
description:
'foo'
)
}
let
(
:user
)
{
snippet
.
author
}
let
(
:com_value
)
{
true
}
let
(
:flag_enabled
)
{
true
}
subject
{
described_class
.
new
(
user
,
'foo'
).
objects
(
'snippet_titles'
)
}
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
com_value
)
stub_feature_flags
(
restricted_snippet_scope_search:
flag_enabled
)
end
context
'when all requirements are met'
do
...
...
@@ -31,14 +29,4 @@ RSpec.describe Gitlab::SnippetSearchResults do
subject
end
end
context
'when flag restricted_snippet_scope_search is not enabled'
do
let
(
:flag_enabled
)
{
false
}
it
'calls the finder with the restrictive scope'
do
expect
(
SnippetsFinder
).
to
receive
(
:new
).
with
(
user
,
{}).
and_call_original
subject
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