Commit 34788a54 authored by Stan Hu's avatar Stan Hu

Merge branch 'tle-allow-saving-deprecated-import-sources' into 'master'

Allow saving deprecated `import_sources`

See merge request gitlab-org/gitlab!48644
parents cb10b157 5f391b62
...@@ -88,7 +88,7 @@ module API ...@@ -88,7 +88,7 @@ module API
end end
optional :html_emails_enabled, type: Boolean, desc: 'By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format.' optional :html_emails_enabled, type: Boolean, desc: 'By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format.'
optional :import_sources, type: Array[String], coerce_with: Validations::Types::CommaSeparatedToArray.coerce, optional :import_sources, type: Array[String], coerce_with: Validations::Types::CommaSeparatedToArray.coerce,
values: %w[github bitbucket bitbucket_server gitlab fogbugz git gitlab_project gitea manifest phabricator], values: %w[github bitbucket bitbucket_server gitlab google_code fogbugz git gitlab_project gitea manifest phabricator],
desc: 'Enabled sources for code import during project creation. OmniAuth must be configured for GitHub, Bitbucket, and GitLab.com' desc: 'Enabled sources for code import during project creation. OmniAuth must be configured for GitHub, Bitbucket, and GitLab.com'
optional :max_artifacts_size, type: Integer, desc: "Set the maximum file size for each job's artifacts" optional :max_artifacts_size, type: Integer, desc: "Set the maximum file size for each job's artifacts"
optional :max_attachment_size, type: Integer, desc: 'Maximum attachment size in MB' optional :max_attachment_size, type: Integer, desc: 'Maximum attachment size in MB'
......
...@@ -15,6 +15,7 @@ module Gitlab ...@@ -15,6 +15,7 @@ module Gitlab
ImportSource.new('bitbucket', 'Bitbucket Cloud', Gitlab::BitbucketImport::Importer), ImportSource.new('bitbucket', 'Bitbucket Cloud', Gitlab::BitbucketImport::Importer),
ImportSource.new('bitbucket_server', 'Bitbucket Server', Gitlab::BitbucketServerImport::Importer), ImportSource.new('bitbucket_server', 'Bitbucket Server', Gitlab::BitbucketServerImport::Importer),
ImportSource.new('gitlab', 'GitLab.com', Gitlab::GitlabImport::Importer), ImportSource.new('gitlab', 'GitLab.com', Gitlab::GitlabImport::Importer),
ImportSource.new('google_code', 'Google Code', nil),
ImportSource.new('fogbugz', 'FogBugz', Gitlab::FogbugzImport::Importer), ImportSource.new('fogbugz', 'FogBugz', Gitlab::FogbugzImport::Importer),
ImportSource.new('git', 'Repo by URL', nil), ImportSource.new('git', 'Repo by URL', nil),
ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer), ImportSource.new('gitlab_project', 'GitLab export', Gitlab::ImportExport::Importer),
......
...@@ -11,6 +11,7 @@ RSpec.describe Gitlab::ImportSources do ...@@ -11,6 +11,7 @@ RSpec.describe Gitlab::ImportSources do
'Bitbucket Cloud' => 'bitbucket', 'Bitbucket Cloud' => 'bitbucket',
'Bitbucket Server' => 'bitbucket_server', 'Bitbucket Server' => 'bitbucket_server',
'GitLab.com' => 'gitlab', 'GitLab.com' => 'gitlab',
'Google Code' => 'google_code',
'FogBugz' => 'fogbugz', 'FogBugz' => 'fogbugz',
'Repo by URL' => 'git', 'Repo by URL' => 'git',
'GitLab export' => 'gitlab_project', 'GitLab export' => 'gitlab_project',
...@@ -31,6 +32,7 @@ RSpec.describe Gitlab::ImportSources do ...@@ -31,6 +32,7 @@ RSpec.describe Gitlab::ImportSources do
bitbucket bitbucket
bitbucket_server bitbucket_server
gitlab gitlab
google_code
fogbugz fogbugz
git git
gitlab_project gitlab_project
...@@ -67,6 +69,7 @@ RSpec.describe Gitlab::ImportSources do ...@@ -67,6 +69,7 @@ RSpec.describe Gitlab::ImportSources do
'bitbucket' => Gitlab::BitbucketImport::Importer, 'bitbucket' => Gitlab::BitbucketImport::Importer,
'bitbucket_server' => Gitlab::BitbucketServerImport::Importer, 'bitbucket_server' => Gitlab::BitbucketServerImport::Importer,
'gitlab' => Gitlab::GitlabImport::Importer, 'gitlab' => Gitlab::GitlabImport::Importer,
'google_code' => nil,
'fogbugz' => Gitlab::FogbugzImport::Importer, 'fogbugz' => Gitlab::FogbugzImport::Importer,
'git' => nil, 'git' => nil,
'gitlab_project' => Gitlab::ImportExport::Importer, 'gitlab_project' => Gitlab::ImportExport::Importer,
...@@ -88,6 +91,7 @@ RSpec.describe Gitlab::ImportSources do ...@@ -88,6 +91,7 @@ RSpec.describe Gitlab::ImportSources do
'bitbucket' => 'Bitbucket Cloud', 'bitbucket' => 'Bitbucket Cloud',
'bitbucket_server' => 'Bitbucket Server', 'bitbucket_server' => 'Bitbucket Server',
'gitlab' => 'GitLab.com', 'gitlab' => 'GitLab.com',
'google_code' => 'Google Code',
'fogbugz' => 'FogBugz', 'fogbugz' => 'FogBugz',
'git' => 'Repo by URL', 'git' => 'Repo by URL',
'gitlab_project' => 'GitLab export', 'gitlab_project' => 'GitLab export',
......
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