Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e9428f5c
Commit
e9428f5c
authored
Jun 29, 2020
by
Gabriel Mazetto
Committed by
Ash McKenzie
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put maintenance mode behind feature flags
parent
786bbfeb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
4 deletions
+12
-4
ee/app/controllers/ee/admin/application_settings_controller.rb
...p/controllers/ee/admin/application_settings_controller.rb
+1
-1
ee/lib/ee/api/entities/application_setting.rb
ee/lib/ee/api/entities/application_setting.rb
+2
-2
ee/lib/ee/api/settings.rb
ee/lib/ee/api/settings.rb
+1
-1
ee/spec/controllers/admin/application_settings_controller_spec.rb
...controllers/admin/application_settings_controller_spec.rb
+4
-0
ee/spec/requests/api/settings_spec.rb
ee/spec/requests/api/settings_spec.rb
+4
-0
No files found.
ee/app/controllers/ee/admin/application_settings_controller.rb
View file @
e9428f5c
...
...
@@ -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
...
...
ee/lib/ee/api/entities/application_setting.rb
View file @
e9428f5c
...
...
@@ -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
...
...
ee/lib/ee/api/settings.rb
View file @
e9428f5c
...
...
@@ -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
...
...
ee/spec/controllers/admin/application_settings_controller_spec.rb
View file @
e9428f5c
...
...
@@ -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
,
...
...
ee/spec/requests/api/settings_spec.rb
View file @
e9428f5c
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment