Commit 2f465dc5 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch...

Merge branch '12264-update-gitlab-geo-repository_verification_enabled-to-use-newer-feature-lookup-method' into 'master'

Geo: Use more modern Feature.enabled? for lookup

Closes #12264

See merge request gitlab-org/gitlab-ee!14268
parents bc8a1071 d25a2d1c
......@@ -123,14 +123,7 @@ module Gitlab
end
def self.repository_verification_enabled?
feature = ::Feature.get('geo_repository_verification')
# If the feature has been set, always evaluate
if ::Feature.persisted?(feature)
return feature.enabled?
else
true
end
Feature.enabled?('geo_repository_verification', default_enabled: true)
end
def self.allowed_ip?(ip)
......
......@@ -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 is set to enabled' 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
end
......@@ -242,7 +242,7 @@ describe Gitlab::Geo, :geo, :request_store do
context 'when the feature flag is set to disabled' 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
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment