Commit c8a5781b authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'sh-fix-import-by-url-retries' into 'master'

Ensure import by URL works after a failed import

Closes #31589

See merge request gitlab-org/gitlab!27547
parents 80710af9 680c5313
......@@ -4,7 +4,13 @@ module ImportUrlParams
def import_url_params
return {} unless params.dig(:project, :import_url).present?
{ import_url: import_params_to_full_url(params[:project]) }
{
import_url: import_params_to_full_url(params[:project]),
# We need to set import_type because attempting to retry an import by URL
# could leave a stale value around. This would erroneously cause an importer
# (e.g. import/export) to run.
import_type: 'git'
}
end
def import_params_to_full_url(params)
......
---
title: Ensure import by URL works after a failed import
merge_request: 27546
author:
type: fixed
......@@ -31,7 +31,8 @@ describe ImportUrlParams do
describe '#import_url_params' do
it 'returns hash with import_url' do
expect(import_url_params).to eq(
import_url: "https://user:password@url.com"
import_url: "https://user:password@url.com",
import_type: 'git'
)
end
end
......@@ -48,7 +49,8 @@ describe ImportUrlParams do
describe '#import_url_params' do
it 'does not change the url' do
expect(import_url_params).to eq(
import_url: "https://user:password@url.com"
import_url: "https://user:password@url.com",
import_type: 'git'
)
end
end
......
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