Class: Gitlab::BitbucketImport::Importer

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/bitbucket_import/importer.rb

Constant Summary collapse

LABELS =
[{ title: 'bug', color: '#FF0000' },
{ title: 'enhancement', color: '#428BCA' },
{ title: 'proposal', color: '#69D100' },
{ title: 'task', color: '#7F8C8D' }].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Importer

Returns a new instance of Importer.


13
14
15
16
17
18
19
20
# File 'lib/gitlab/bitbucket_import/importer.rb', line 13

def initialize(project)
  @project = project
  @client = Bitbucket::Client.new(project.import_data.credentials)
  @formatter = Gitlab::ImportFormatter.new
  @labels = {}
  @errors = []
  @users = {}
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client


11
12
13
# File 'lib/gitlab/bitbucket_import/importer.rb', line 11

def client
  @client
end

#errorsObject (readonly)

Returns the value of attribute errors


11
12
13
# File 'lib/gitlab/bitbucket_import/importer.rb', line 11

def errors
  @errors
end

#projectObject (readonly)

Returns the value of attribute project


11
12
13
# File 'lib/gitlab/bitbucket_import/importer.rb', line 11

def project
  @project
end

#usersObject (readonly)

Returns the value of attribute users


11
12
13
# File 'lib/gitlab/bitbucket_import/importer.rb', line 11

def users
  @users
end

Instance Method Details

#executeObject


22
23
24
25
26
27
28
29
30
# File 'lib/gitlab/bitbucket_import/importer.rb', line 22

def execute
  import_wiki
  import_issues
  import_pull_requests
  handle_errors
  metrics.track_finished_import

  true
end