Commit 00eb70d2 authored by Robert Speicher's avatar Robert Speicher

Merge branch '225258-extend-applicationsettings-to-support-default_branch_name' into 'master'

Extend `ApplicationSettings` to support `default_branch_name`

See merge request gitlab-org/gitlab!35681
parents 758a70e6 68db0ade
...@@ -227,6 +227,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -227,6 +227,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:raw_blob_request_limit, :raw_blob_request_limit,
:namespace_storage_size_limit, :namespace_storage_size_limit,
:issues_create_limit, :issues_create_limit,
:default_branch_name,
disabled_oauth_sign_in_sources: [], disabled_oauth_sign_in_sources: [],
import_sources: [], import_sources: [],
repository_storages: [], repository_storages: [],
......
...@@ -190,6 +190,7 @@ module ApplicationSettingsHelper ...@@ -190,6 +190,7 @@ module ApplicationSettingsHelper
:container_expiration_policies_enable_historic_entries, :container_expiration_policies_enable_historic_entries,
:container_registry_token_expire_delay, :container_registry_token_expire_delay,
:default_artifacts_expire_in, :default_artifacts_expire_in,
:default_branch_name,
:default_branch_protection, :default_branch_protection,
:default_ci_config_path, :default_ci_config_path,
:default_group_visibility, :default_group_visibility,
......
...@@ -50,6 +50,7 @@ module ApplicationSettingImplementation ...@@ -50,6 +50,7 @@ module ApplicationSettingImplementation
default_artifacts_expire_in: '30 days', default_artifacts_expire_in: '30 days',
default_branch_protection: Settings.gitlab['default_branch_protection'], default_branch_protection: Settings.gitlab['default_branch_protection'],
default_ci_config_path: nil, default_ci_config_path: nil,
default_branch_name: nil,
default_group_visibility: Settings.gitlab.default_projects_features['visibility_level'], default_group_visibility: Settings.gitlab.default_projects_features['visibility_level'],
default_project_creation: Settings.gitlab['default_project_creation'], default_project_creation: Settings.gitlab['default_project_creation'],
default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'], default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'],
......
---
title: Add default_branch_name to ApplicationSettings visible attrs
merge_request: 35681
author:
type: other
...@@ -128,6 +128,13 @@ RSpec.describe Admin::ApplicationSettingsController do ...@@ -128,6 +128,13 @@ RSpec.describe Admin::ApplicationSettingsController do
expect(ApplicationSetting.current.repository_storages_weighted_default).to eq(75) expect(ApplicationSetting.current.repository_storages_weighted_default).to eq(75)
end end
it "updates default_branch_name setting" do
put :update, params: { application_setting: { default_branch_name: "example_branch_name" } }
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.default_branch_name).to eq("example_branch_name")
end
context 'external policy classification settings' do context 'external policy classification settings' do
let(:settings) do let(:settings) do
{ {
......
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