Commit f50b95b0 authored by Rémy Coutable's avatar Rémy Coutable

Ensure the `import:github` task doesn't schedule an import job

The point of this task is to run the import in the foreground, so it
shouldn't schedule an import job!
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent a55e1501
...@@ -59,18 +59,23 @@ class GithubImport ...@@ -59,18 +59,23 @@ class GithubImport
namespace_path, _sep, name = @project_path.rpartition('/') namespace_path, _sep, name = @project_path.rpartition('/')
namespace = find_or_create_namespace(namespace_path) namespace = find_or_create_namespace(namespace_path)
Projects::CreateService.new( project = Projects::CreateService.new(
@current_user, @current_user,
name: name, name: name,
path: name, path: name,
description: @repo['description'], description: @repo['description'],
namespace_id: namespace.id, namespace_id: namespace.id,
visibility_level: visibility_level, visibility_level: visibility_level,
import_type: 'github',
import_source: @repo['full_name'],
import_url: @repo['clone_url'].sub('://', "://#{@options[:token]}@"),
skip_wiki: @repo['has_wiki'] skip_wiki: @repo['has_wiki']
).execute ).execute
project.update!(
import_type: 'github',
import_source: @repo['full_name'],
import_url: @repo['clone_url'].sub('://', "://#{@options[:token]}@")
)
project
end end
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