Commit c07aac51 authored by Aakriti Gupta's avatar Aakriti Gupta Committed by Michael Kozono

Remove maintenance mode feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

parent dd6ec7c3
---
name: maintenance_mode
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28158
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/217895
milestone: '12.10'
type: development
group: group::geo
default_enabled: false
...@@ -57,7 +57,7 @@ module EE ...@@ -57,7 +57,7 @@ module EE
attrs += EE::ApplicationSettingsHelper.merge_request_appovers_rules_attributes attrs += EE::ApplicationSettingsHelper.merge_request_appovers_rules_attributes
end end
if ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode) if ::Gitlab::Geo.license_allows?
attrs << :maintenance_mode attrs << :maintenance_mode
attrs << :maintenance_mode_message attrs << :maintenance_mode_message
end end
......
- return unless ::Gitlab::Geo.license_allows? && Feature.enabled?(:maintenance_mode) - return unless ::Gitlab::Geo.license_allows?
%section.settings.no-animate#js-maintenance-mode-toggle{ class: ('expanded' if expanded_by_default?) } %section.settings.no-animate#js-maintenance-mode-toggle{ class: ('expanded' if expanded_by_default?) }
.settings-header .settings-header
......
---
title: Release maintenance mode
merge_request: 53895
author:
type: added
...@@ -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?(:package_forwarding) } expose :npm_package_requests_forwarding, if: ->(_instance, _opts) { ::License.feature_available?(:package_forwarding) }
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) { ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode) } expose :maintenance_mode, if: ->(_instance, _opts) { ::Gitlab::Geo.license_allows? }
expose :maintenance_mode_message, if: ->(_instance, _opts) { ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode) } expose :maintenance_mode_message, if: ->(_instance, _opts) { ::Gitlab::Geo.license_allows? }
expose :git_two_factor_session_expiry, if: ->(_instance, _opts) { License.feature_available?(:git_two_factor_enforcement) && ::Feature.enabled?(:two_factor_for_cli) } expose :git_two_factor_session_expiry, if: ->(_instance, _opts) { License.feature_available?(:git_two_factor_enforcement) && ::Feature.enabled?(:two_factor_for_cli) }
end end
end end
......
...@@ -52,7 +52,7 @@ module EE ...@@ -52,7 +52,7 @@ module EE
attrs = attrs.except(:git_two_factor_session_expiry) attrs = attrs.except(:git_two_factor_session_expiry)
end end
unless ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode) unless ::Gitlab::Geo.license_allows?
attrs = attrs.except(:maintenance_mode, :maintenance_mode_message) attrs = attrs.except(:maintenance_mode, :maintenance_mode_message)
end end
......
...@@ -30,18 +30,10 @@ RSpec.describe 'admin/application_settings/general.html.haml' do ...@@ -30,18 +30,10 @@ RSpec.describe 'admin/application_settings/general.html.haml' do
end end
end end
context 'when maintenance_mode feature is enabled' do context 'when license allows' do
it 'shows the Maintenance mode section' do it 'shows the Maintenance mode section' do
expect(rendered).to have_css('#js-maintenance-mode-toggle') expect(rendered).to have_css('#js-maintenance-mode-toggle')
end end
end end
context 'when maintenance_mode feature is disabled' do
let(:maintenance_mode_flag) { false }
it 'does not show the Maintenance mode section' do
expect(rendered).not_to have_css('#js-maintenance-mode-toggle')
end
end
end end
end end
...@@ -121,7 +121,6 @@ module Gitlab ...@@ -121,7 +121,6 @@ module Gitlab
end end
def self.maintenance_mode? def self.maintenance_mode?
return false unless ::Feature.enabled?(:maintenance_mode)
return false unless ::Gitlab::CurrentSettings.current_application_settings? return false unless ::Gitlab::CurrentSettings.current_application_settings?
::Gitlab::CurrentSettings.maintenance_mode ::Gitlab::CurrentSettings.maintenance_mode
......
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