Commit e9428f5c authored by Gabriel Mazetto's avatar Gabriel Mazetto Committed by Ash McKenzie

Put maintenance mode behind feature flags

parent 786bbfeb
......@@ -78,7 +78,7 @@ module EE
attrs << :group_owners_can_manage_default_branch_protection
end
if License.feature_available?(:geo)
if ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode)
attrs << :maintenance_mode
attrs << :maintenance_mode_message
end
......
......@@ -20,8 +20,8 @@ module EE
expose :updating_name_disabled_for_users, if: ->(_instance, _opts) { ::License.feature_available?(:disable_name_update_for_users) }
expose :npm_package_requests_forwarding, if: ->(_instance, _opts) { ::License.feature_available?(:packages) }
expose :group_owners_can_manage_default_branch_protection, if: ->(_instance, _opts) { ::License.feature_available?(:default_branch_protection_restriction_in_groups) }
expose :maintenance_mode, if: ->(_instance, _opts) { ::License.feature_available?(:geo) }
expose :maintenance_mode_message, if: ->(_instance, _opts) { ::License.feature_available?(:geo) }
expose :maintenance_mode, if: ->(_instance, _opts) { ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode) }
expose :maintenance_mode_message, if: ->(_instance, _opts) { ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode) }
end
end
end
......
......@@ -47,7 +47,7 @@ module EE
attrs = attrs.except(:group_owners_can_manage_default_branch_protection)
end
unless License.feature_available?(:geo)
unless ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode)
attrs = attrs.except(:maintenance_mode, :maintenance_mode_message)
end
......
......@@ -126,6 +126,10 @@ RSpec.describe Admin::ApplicationSettingsController do
end
context 'updating maintenance mode setting' do
before do
stub_feature_flags(maintenance_mode: true)
end
let(:settings) do
{
maintenance_mode: true,
......
......@@ -192,6 +192,10 @@ RSpec.describe API::Settings, 'EE Settings' do
end
context 'maintenance mode' do
before do
stub_feature_flags(maintenance_mode: true)
end
let(:settings) do
{
maintenance_mode: true,
......
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