Commit f231544d authored by Allen Cook's avatar Allen Cook Committed by Etienne Baqué

Resolve Missing Repository Error During Migration

parent e4a38770
......@@ -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