Commit e13eeea0 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch...

Merge branch '343686-gitlab-migration-nomethoderror-undefined-method-start_with-for-nil-nilclass' into 'master'

Resolve Missing Repository Error During Migration

See merge request gitlab-org/gitlab!75943
parents 90ca0ee8 f231544d
......@@ -16,6 +16,8 @@ module BulkImports
def load(context, data)
url = data['httpUrlToRepo']
return unless url.present?
url = url.sub("://", "://oauth2:#{context.configuration.access_token}@")
project = context.portable
......
......@@ -47,6 +47,17 @@ RSpec.describe BulkImports::Projects::Pipelines::RepositoryPipeline do
end
end
context 'project has no repository' do
let(:project_data) { { 'httpUrlToRepo' => '' } }
it 'skips repository import' do
expect(context.portable).not_to receive(:ensure_repository)
expect(context.portable.repository).not_to receive(:fetch_as_mirror)
pipeline.run
end
end
context 'blocked local networks' do
let(:project_data) { { 'httpUrlToRepo' => 'http://localhost/foo.git' } }
......
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