Commit 2de2fa05 authored by George Koltsov's avatar George Koltsov

Do not schedule project import when migrating using GitLab Migration

  - When migrating projects using GitLab Migration an exception is raised
    NoMethodError undefined method `start_with?` that is caused by
    Projects::CreateService
  - Fix this bug by not scheduling project import in this case

Changelog: fixed
parent 1270174a
......@@ -243,7 +243,7 @@ module Projects
def import_schedule
if @project.errors.empty?
@project.import_state.schedule if @project.import? && !@project.bare_repository_import?
@project.import_state.schedule if @project.import? && !@project.bare_repository_import? && !@project.gitlab_project_migration?
else
fail(error: @project.errors.full_messages.join(', '))
end
......
......@@ -376,6 +376,18 @@ RSpec.describe Projects::CreateService, '#execute' do
imported_project
end
describe 'import scheduling' do
context 'when project import type is gitlab project migration' do
it 'does not schedule project import' do
opts[:import_type] = 'gitlab_project_migration'
project = create_project(user, opts)
expect(project.import_state.status).to eq('none')
end
end
end
end
context 'builds_enabled global setting' do
......
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