diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
commit | e4384360a16dd9a19d4d2d25d0ef1f2b862ed2a6 (patch) | |
tree | 2fcdfa7dcdb9db8f5208b2562f4b4e803d671243 /app/services/application_settings/update_service.rb | |
parent | ffda4e7bcac36987f936b4ba515995a6698698f0 (diff) |
Add latest changes from gitlab-org/gitlab@16-2-stable-eev16.2.0-rc42
Diffstat (limited to 'app/services/application_settings/update_service.rb')
-rw-r--r-- | app/services/application_settings/update_service.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/services/application_settings/update_service.rb b/app/services/application_settings/update_service.rb index 7728982779e..6d484c4fa22 100644 --- a/app/services/application_settings/update_service.rb +++ b/app/services/application_settings/update_service.rb @@ -26,6 +26,7 @@ module ApplicationSettings end update_terms(@params.delete(:terms)) + update_default_branch_protection_defaults(@params[:default_branch_protection]) add_to_outbound_local_requests_whitelist(@params.delete(:add_to_outbound_local_requests_whitelist)) @@ -77,6 +78,19 @@ module ApplicationSettings @application_setting.reset_memoized_terms end + def update_default_branch_protection_defaults(default_branch_protection) + return unless default_branch_protection.present? + + # We are migrating default_branch_protection from an integer + # column to a jsonb column. While completing the rest of the + # work, we want to start translating the updates sent to the + # existing column into the json. Eventually, we will be updating + # the jsonb column directly and deprecating the original update + # path. Until then, we want to sync up both columns. + protection = Gitlab::Access::BranchProtection.new(default_branch_protection.to_i) + @application_setting.default_branch_protection_defaults = protection.to_hash + end + def process_performance_bar_allowed_group_id group_full_path = params.delete(:performance_bar_allowed_group_path) enable_param_on = Gitlab::Utils.to_boolean(params.delete(:performance_bar_enabled)) |