Remove deprecated `repository_storage` attribute
In favor of the new `repository_storages`
This commit is contained in:
parent
ea1012ccb4
commit
c11ed138a0
|
@ -315,7 +315,9 @@ class ApplicationSetting < ActiveRecord::Base
|
||||||
Array(read_attribute(:repository_storages))
|
Array(read_attribute(:repository_storages))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# DEPRECATED
|
||||||
# repository_storage is still required in the API. Remove in 9.0
|
# repository_storage is still required in the API. Remove in 9.0
|
||||||
|
# Still used in API v3
|
||||||
def repository_storage
|
def repository_storage
|
||||||
repository_storages.first
|
repository_storages.first
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,7 +42,6 @@ Example response:
|
||||||
"gravatar_enabled" : true,
|
"gravatar_enabled" : true,
|
||||||
"sign_in_text" : null,
|
"sign_in_text" : null,
|
||||||
"container_registry_token_expire_delay": 5,
|
"container_registry_token_expire_delay": 5,
|
||||||
"repository_storage": "default",
|
|
||||||
"repository_storages": ["default"],
|
"repository_storages": ["default"],
|
||||||
"koding_enabled": false,
|
"koding_enabled": false,
|
||||||
"koding_url": null,
|
"koding_url": null,
|
||||||
|
@ -81,7 +80,6 @@ PUT /application/settings
|
||||||
| `after_sign_out_path` | string | no | Where to redirect users after logout |
|
| `after_sign_out_path` | string | no | Where to redirect users after logout |
|
||||||
| `container_registry_token_expire_delay` | integer | no | Container Registry token duration in minutes |
|
| `container_registry_token_expire_delay` | integer | no | Container Registry token duration in minutes |
|
||||||
| `repository_storages` | array of strings | no | A list of names of enabled storage paths, taken from `gitlab.yml`. New projects will be created in one of these stores, chosen at random. |
|
| `repository_storages` | array of strings | no | A list of names of enabled storage paths, taken from `gitlab.yml`. New projects will be created in one of these stores, chosen at random. |
|
||||||
| `repository_storage` | string | no | The first entry in `repository_storages`. Deprecated, but retained for compatibility reasons |
|
|
||||||
| `enabled_git_access_protocol` | string | no | Enabled protocols for Git access. Allowed values are: `ssh`, `http`, and `nil` to allow both protocols. |
|
| `enabled_git_access_protocol` | string | no | Enabled protocols for Git access. Allowed values are: `ssh`, `http`, and `nil` to allow both protocols. |
|
||||||
| `koding_enabled` | boolean | no | Enable Koding integration. Default is `false`. |
|
| `koding_enabled` | boolean | no | Enable Koding integration. Default is `false`. |
|
||||||
| `koding_url` | string | yes (if `koding_enabled` is `true`) | The Koding instance URL for integration. |
|
| `koding_url` | string | yes (if `koding_enabled` is `true`) | The Koding instance URL for integration. |
|
||||||
|
@ -121,7 +119,7 @@ Example response:
|
||||||
"user_oauth_applications": true,
|
"user_oauth_applications": true,
|
||||||
"after_sign_out_path": "",
|
"after_sign_out_path": "",
|
||||||
"container_registry_token_expire_delay": 5,
|
"container_registry_token_expire_delay": 5,
|
||||||
"repository_storage": "default",
|
"repository_storages": ["default"],
|
||||||
"koding_enabled": false,
|
"koding_enabled": false,
|
||||||
"koding_url": null,
|
"koding_url": null,
|
||||||
"plantuml_enabled": false,
|
"plantuml_enabled": false,
|
||||||
|
|
|
@ -20,59 +20,6 @@ module API
|
||||||
success Entities::ApplicationSetting
|
success Entities::ApplicationSetting
|
||||||
end
|
end
|
||||||
params do
|
params do
|
||||||
# CE
|
|
||||||
at_least_one_of_ce = [
|
|
||||||
:admin_notification_email,
|
|
||||||
:after_sign_out_path,
|
|
||||||
:after_sign_up_text,
|
|
||||||
:akismet_enabled,
|
|
||||||
:container_registry_token_expire_delay,
|
|
||||||
:default_artifacts_expire_in,
|
|
||||||
:default_branch_protection,
|
|
||||||
:default_group_visibility,
|
|
||||||
:default_project_visibility,
|
|
||||||
:default_projects_limit,
|
|
||||||
:default_snippet_visibility,
|
|
||||||
:disabled_oauth_sign_in_sources,
|
|
||||||
:domain_blacklist_enabled,
|
|
||||||
:domain_whitelist,
|
|
||||||
:email_author_in_body,
|
|
||||||
:enabled_git_access_protocol,
|
|
||||||
:gravatar_enabled,
|
|
||||||
:help_page_hide_commercial_content,
|
|
||||||
:help_page_text,
|
|
||||||
:help_page_support_url,
|
|
||||||
:home_page_url,
|
|
||||||
:housekeeping_enabled,
|
|
||||||
:html_emails_enabled,
|
|
||||||
:import_sources,
|
|
||||||
:koding_enabled,
|
|
||||||
:max_artifacts_size,
|
|
||||||
:max_attachment_size,
|
|
||||||
:max_pages_size,
|
|
||||||
:metrics_enabled,
|
|
||||||
:plantuml_enabled,
|
|
||||||
:polling_interval_multiplier,
|
|
||||||
:recaptcha_enabled,
|
|
||||||
:repository_checks_enabled,
|
|
||||||
:repository_storage,
|
|
||||||
:require_two_factor_authentication,
|
|
||||||
:restricted_visibility_levels,
|
|
||||||
:send_user_confirmation_email,
|
|
||||||
:sentry_enabled,
|
|
||||||
:clientside_sentry_enabled,
|
|
||||||
:session_expire_delay,
|
|
||||||
:shared_runners_enabled,
|
|
||||||
:sidekiq_throttling_enabled,
|
|
||||||
:sign_in_text,
|
|
||||||
:password_authentication_enabled,
|
|
||||||
:signin_enabled,
|
|
||||||
:signup_enabled,
|
|
||||||
:terminal_max_session_time,
|
|
||||||
:user_default_external,
|
|
||||||
:user_oauth_applications,
|
|
||||||
:version_check_enabled
|
|
||||||
]
|
|
||||||
optional :default_branch_protection, type: Integer, values: [0, 1, 2], desc: 'Determine if developers can push to master'
|
optional :default_branch_protection, type: Integer, values: [0, 1, 2], desc: 'Determine if developers can push to master'
|
||||||
optional :default_project_visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The default project visibility'
|
optional :default_project_visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The default project visibility'
|
||||||
optional :default_snippet_visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The default snippet visibility'
|
optional :default_snippet_visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The default snippet visibility'
|
||||||
|
@ -151,7 +98,7 @@ module API
|
||||||
given clientside_sentry_enabled: ->(val) { val } do
|
given clientside_sentry_enabled: ->(val) { val } do
|
||||||
requires :clientside_sentry_dsn, type: String, desc: 'Clientside Sentry Data Source Name'
|
requires :clientside_sentry_dsn, type: String, desc: 'Clientside Sentry Data Source Name'
|
||||||
end
|
end
|
||||||
optional :repository_storage, type: String, desc: 'Storage paths for new projects'
|
optional :repository_storages, type: Array[String], desc: 'Storage paths for new projects'
|
||||||
optional :repository_checks_enabled, type: Boolean, desc: "GitLab will periodically run 'git fsck' in all project and wiki repositories to look for silent disk corruption issues."
|
optional :repository_checks_enabled, type: Boolean, desc: "GitLab will periodically run 'git fsck' in all project and wiki repositories to look for silent disk corruption issues."
|
||||||
optional :koding_enabled, type: Boolean, desc: 'Enable Koding'
|
optional :koding_enabled, type: Boolean, desc: 'Enable Koding'
|
||||||
given koding_enabled: ->(val) { val } do
|
given koding_enabled: ->(val) { val } do
|
||||||
|
|
|
@ -11,7 +11,7 @@ describe API::Settings, 'Settings' do
|
||||||
expect(json_response).to be_an Hash
|
expect(json_response).to be_an Hash
|
||||||
expect(json_response['default_projects_limit']).to eq(42)
|
expect(json_response['default_projects_limit']).to eq(42)
|
||||||
expect(json_response['password_authentication_enabled']).to be_truthy
|
expect(json_response['password_authentication_enabled']).to be_truthy
|
||||||
expect(json_response['repository_storage']).to eq('default')
|
expect(json_response['repository_storages']).to eq(['default'])
|
||||||
expect(json_response['koding_enabled']).to be_falsey
|
expect(json_response['koding_enabled']).to be_falsey
|
||||||
expect(json_response['koding_url']).to be_nil
|
expect(json_response['koding_url']).to be_nil
|
||||||
expect(json_response['plantuml_enabled']).to be_falsey
|
expect(json_response['plantuml_enabled']).to be_falsey
|
||||||
|
@ -33,7 +33,7 @@ describe API::Settings, 'Settings' do
|
||||||
put api("/application/settings", admin),
|
put api("/application/settings", admin),
|
||||||
default_projects_limit: 3,
|
default_projects_limit: 3,
|
||||||
password_authentication_enabled: false,
|
password_authentication_enabled: false,
|
||||||
repository_storage: 'custom',
|
repository_storages: ['custom'],
|
||||||
koding_enabled: true,
|
koding_enabled: true,
|
||||||
koding_url: 'http://koding.example.com',
|
koding_url: 'http://koding.example.com',
|
||||||
plantuml_enabled: true,
|
plantuml_enabled: true,
|
||||||
|
@ -47,7 +47,6 @@ describe API::Settings, 'Settings' do
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
expect(json_response['default_projects_limit']).to eq(3)
|
expect(json_response['default_projects_limit']).to eq(3)
|
||||||
expect(json_response['password_authentication_enabled']).to be_falsey
|
expect(json_response['password_authentication_enabled']).to be_falsey
|
||||||
expect(json_response['repository_storage']).to eq('custom')
|
|
||||||
expect(json_response['repository_storages']).to eq(['custom'])
|
expect(json_response['repository_storages']).to eq(['custom'])
|
||||||
expect(json_response['koding_enabled']).to be_truthy
|
expect(json_response['koding_enabled']).to be_truthy
|
||||||
expect(json_response['koding_url']).to eq('http://koding.example.com')
|
expect(json_response['koding_url']).to eq('http://koding.example.com')
|
||||||
|
|
Loading…
Reference in New Issue