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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
1a5cc87d
Commit
1a5cc87d
authored
Feb 18, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@13-9-stable-ee
parent
a0a166e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
lib/gitlab.rb
lib/gitlab.rb
+10
-0
spec/lib/gitlab_spec.rb
spec/lib/gitlab_spec.rb
+7
-2
No files found.
lib/gitlab.rb
View file @
1a5cc87d
...
...
@@ -123,6 +123,16 @@ module Gitlab
def
self
.
maintenance_mode?
return
false
unless
::
Gitlab
::
CurrentSettings
.
current_application_settings?
# `maintenance_mode` column was added to the `current_settings` table in 13.2
# When upgrading from < 13.2 to >=13.8 `maintenance_mode` will not be
# found in settings.
# `Gitlab::CurrentSettings#uncached_application_settings` in
# lib/gitlab/current_settings.rb is expected to handle such cases, and use
# the default value for the setting instead, but in this case, it doesn't,
# see https://gitlab.com/gitlab-org/gitlab/-/issues/321836
# As a work around, we check if the setting method is available
return
false
unless
::
Gitlab
::
CurrentSettings
.
respond_to?
(
:maintenance_mode
)
::
Gitlab
::
CurrentSettings
.
maintenance_mode
end
end
spec/lib/gitlab_spec.rb
View file @
1a5cc87d
...
...
@@ -363,8 +363,13 @@ RSpec.describe Gitlab do
expect
(
described_class
.
maintenance_mode?
).
to
eq
(
false
)
end
it
'returns false when maintenance mode feature flag is disabled'
do
stub_feature_flags
(
maintenance_mode:
false
)
it
'returns false when maintenance mode column is not present'
do
stub_maintenance_mode_setting
(
true
)
allow
(
::
Gitlab
::
CurrentSettings
.
current_application_settings
)
.
to
receive
(
:respond_to?
)
.
with
(
:maintenance_mode
,
false
)
.
and_return
(
false
)
expect
(
described_class
.
maintenance_mode?
).
to
eq
(
false
)
end
...
...
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