Skip to content

Add Maintenance mode application settings fields

What does this MR do?

This is part of the implementation of Maintenance Mode (behind a feature flag).

We are adding to application settings database the enable/disable configuration and a message explanation when in maintenance.

This is currently exposed via API (when feature flag is enabled), and will soon be hooked up to the frontend code.

Migration output

Up

➜  gitlab git:(212428-add-maintenance-mode-application-settings-fields) ✗ bin/rake db:migrate                            
== 20200628210938 AddMaintenanceModeApplicationToSettings: migrating ==========
-- column_exists?(:application_settings, :maintenance_mode)
   -> 0.0301s
-- change_table(:application_settings)
   -> 0.0027s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE application_settings\nADD CONSTRAINT check_9c6c447a13\nCHECK ( char_length(maintenance_mode_message) <= 255 )\nNOT VALID;\n")
   -> 0.0014s
-- execute("ALTER TABLE application_settings VALIDATE CONSTRAINT check_9c6c447a13;")
   -> 0.0008s
== 20200628210938 AddMaintenanceModeApplicationToSettings: migrated (0.0453s) =

Down

➜  gitlab git:(212428-add-maintenance-mode-application-settings-fields) bin/rake db:migrate:down VERSION=20200628210938
== 20200628210938 AddMaintenanceModeApplicationToSettings: reverting ==========
-- column_exists?(:application_settings, :maintenance_mode)
   -> 0.0302s
-- remove_column(:application_settings, :maintenance_mode)
   -> 0.0028s
-- column_exists?(:application_settings, :maintenance_mode_message)
   -> 0.0284s
-- remove_column(:application_settings, :maintenance_mode_message)
   -> 0.0013s
== 20200628210938 AddMaintenanceModeApplicationToSettings: reverted (0.0630s) =

Does this MR meet the acceptance criteria?

Conformity

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #212428 (closed)

Edited by Michael Kozono

Merge request reports

Loading