diff options
author | James Lopez <james@jameslopez.es> | 2016-03-23 12:52:50 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-03-23 12:52:50 +0100 |
commit | 6967871fc567cbadd63f26f1ef87c4008cc6387b (patch) | |
tree | ad2b4ab71f2a10452c500678c3cbc597de645735 /lib | |
parent | 8da04f6b64884c642e8e4b630a30e6400e47b09e (diff) | |
download | gitlab-ce-6967871fc567cbadd63f26f1ef87c4008cc6387b.tar.gz |
fogbugz importer, also refactored migration again to make it easier to add new importers
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/fogbugz_import/importer.rb | 13 | ||||
-rw-r--r-- | lib/gitlab/fogbugz_import/project_creator.rb | 2 |
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 |