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
d25a2d1c
Commit
d25a2d1c
authored
Jun 19, 2019
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more modern Feature.enabled? for lookup
parent
f6a5dda9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
ee/lib/gitlab/geo.rb
ee/lib/gitlab/geo.rb
+1
-8
ee/spec/lib/gitlab/geo_spec.rb
ee/spec/lib/gitlab/geo_spec.rb
+2
-2
No files found.
ee/lib/gitlab/geo.rb
View file @
d25a2d1c
...
@@ -123,14 +123,7 @@ module Gitlab
...
@@ -123,14 +123,7 @@ module Gitlab
end
end
def
self
.
repository_verification_enabled?
def
self
.
repository_verification_enabled?
feature
=
::
Feature
.
get
(
'geo_repository_verification'
)
Feature
.
enabled?
(
'geo_repository_verification'
,
default_enabled:
true
)
# If the feature has been set, always evaluate
if
::
Feature
.
persisted?
(
feature
)
return
feature
.
enabled?
else
true
end
end
end
def
self
.
allowed_ip?
(
ip
)
def
self
.
allowed_ip?
(
ip
)
...
...
ee/spec/lib/gitlab/geo_spec.rb
View file @
d25a2d1c
...
@@ -234,7 +234,7 @@ describe Gitlab::Geo, :geo, :request_store do
...
@@ -234,7 +234,7 @@ describe Gitlab::Geo, :geo, :request_store do
context
'when the feature flag has been set'
do
context
'when the feature flag has been set'
do
context
'when the feature flag is set to enabled'
do
context
'when the feature flag is set to enabled'
do
it
'returns true'
do
it
'returns true'
do
Feature
.
enable
(
'geo_repository_verification'
)
stub_feature_flags
(
geo_repository_verification:
true
)
expect
(
described_class
.
repository_verification_enabled?
).
to
eq
true
expect
(
described_class
.
repository_verification_enabled?
).
to
eq
true
end
end
...
@@ -242,7 +242,7 @@ describe Gitlab::Geo, :geo, :request_store do
...
@@ -242,7 +242,7 @@ describe Gitlab::Geo, :geo, :request_store do
context
'when the feature flag is set to disabled'
do
context
'when the feature flag is set to disabled'
do
it
'returns false'
do
it
'returns false'
do
Feature
.
disable
(
'geo_repository_verification'
)
stub_feature_flags
(
geo_repository_verification:
false
)
expect
(
described_class
.
repository_verification_enabled?
).
to
eq
false
expect
(
described_class
.
repository_verification_enabled?
).
to
eq
false
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