Refactoring Gitlab::GithubImport::Importer

parent 364e63fa
...@@ -14,13 +14,7 @@ module Gitlab ...@@ -14,13 +14,7 @@ module Gitlab
end end
def execute def execute
import_issues import_issues && import_pull_requests && import_wiki
import_pull_requests
import_wiki
true
rescue Gitlab::Shell::Error
false
end end
private private
...@@ -39,6 +33,10 @@ module Gitlab ...@@ -39,6 +33,10 @@ module Gitlab
end end
end end
end end
true
rescue ActiveRecord::RecordInvalid
false
end end
def import_pull_requests def import_pull_requests
...@@ -53,6 +51,10 @@ module Gitlab ...@@ -53,6 +51,10 @@ module Gitlab
import_comments_on_diff(pull_request.number, merge_request) import_comments_on_diff(pull_request.number, merge_request)
end end
end end
true
rescue ActiveRecord::RecordInvalid
false
end end
def import_comments(issue_number, noteable) def import_comments(issue_number, noteable)
...@@ -78,6 +80,10 @@ module Gitlab ...@@ -78,6 +80,10 @@ module Gitlab
gitlab_shell.import_repository(wiki.path_with_namespace, wiki.import_url) gitlab_shell.import_repository(wiki.path_with_namespace, wiki.import_url)
project.update_attribute(:wiki_enabled, true) project.update_attribute(:wiki_enabled, true)
end end
true
rescue Gitlab::Shell::Error
false
end end
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