Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-03-23 14:52:50 +0300
committerJames Lopez <james@jameslopez.es>2016-03-23 14:52:50 +0300
commit6967871fc567cbadd63f26f1ef87c4008cc6387b (patch)
treead2b4ab71f2a10452c500678c3cbc597de645735 /lib/gitlab/fogbugz_import
parent8da04f6b64884c642e8e4b630a30e6400e47b09e (diff)
fogbugz importer, also refactored migration again to make it easier to add new importers
Diffstat (limited to 'lib/gitlab/fogbugz_import')
-rw-r--r--lib/gitlab/fogbugz_import/importer.rb13
-rw-r--r--lib/gitlab/fogbugz_import/project_creator.rb2
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/gitlab/fogbugz_import/importer.rb b/lib/gitlab/fogbugz_import/importer.rb
index db580b5e578..c33b3541dd8 100644
--- a/lib/gitlab/fogbugz_import/importer.rb
+++ b/lib/gitlab/fogbugz_import/importer.rb
@@ -8,9 +8,12 @@ module Gitlab
import_data = project.import_data.try(:data)
repo_data = import_data['repo'] if import_data
- @repo = FogbugzImport::Repository.new(repo_data)
-
- @known_labels = Set.new
+ if import_data_credentials && import_data_credentials['repo']
+ @repo = FogbugzImport::Repository.new(repo_data)
+ @known_labels = Set.new
+ else
+ raise Projects::ImportService::Error, "Unable to find project import data credentials for project ID: #{@project.id}"
+ end
end
def execute
@@ -30,6 +33,10 @@ module Gitlab
private
+ def import_data_credentials
+ @import_data_credentials ||= project.import_data.credentials if project.import_data
+ end
+
def user_map
@user_map ||= begin
user_map = Hash.new
diff --git a/lib/gitlab/fogbugz_import/project_creator.rb b/lib/gitlab/fogbugz_import/project_creator.rb
index e0163499e30..73d6272720a 100644
--- a/lib/gitlab/fogbugz_import/project_creator.rb
+++ b/lib/gitlab/fogbugz_import/project_creator.rb
@@ -25,7 +25,7 @@ module Gitlab
).execute
project.create_import_data(
- data: {
+ credentials: {
'repo' => repo.raw_data,
'user_map' => user_map,
'fb_session' => fb_session