some refactoring in the migration. Also fixed github import issue and updated spec

This commit is contained in:
James Lopez
2016-03-04 12:21:53 +01:00
parent cefefb2ade
commit 06b36c00d5
4 changed files with 25 additions and 9 deletions
+10 -2
View File
@@ -20,13 +20,21 @@ module Gitlab
visibility_level: repo.private ? Gitlab::VisibilityLevel::PRIVATE : Gitlab::VisibilityLevel::PUBLIC,
import_type: "github",
import_source: repo.full_name,
import_url: repo.clone_url.sub("https://", "https://#{@session_data[:github_access_token]}@"),
import_url: repo.clone_url,
wiki_enabled: !repo.has_wiki? # If repo has wiki we'll import it later
).execute
project.create_import_data(data: { "github_session" => session_data } )
create_import_data(project)
project
end
private
def create_import_data(project)
project.create_import_data(
credentials: session_data.delete(:github_access_token),
data: { "github_session" => session_data })
end
end
end
end