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