Commit d25a2d1c authored by Ash McKenzie's avatar Ash McKenzie

Use more modern Feature.enabled? for lookup

parent f6a5dda9
...@@ -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)
......
...@@ -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
......
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