Class: Gitlab::PhabricatorImport::Importer

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Importer

Returns a new instance of Importer.


16
17
18
# File 'lib/gitlab/phabricator_import/importer.rb', line 16

def initialize(project)
  @project = project
end

Class Method Details

.async?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/gitlab/phabricator_import/importer.rb', line 6

def self.async?
  true
end

.imports_repository?Boolean

Returns:

  • (Boolean)

10
11
12
13
14
# File 'lib/gitlab/phabricator_import/importer.rb', line 10

def self.imports_repository?
  # This does not really import a repository, but we want to skip all
  # repository related tasks in the `Projects::ImportService`
  true
end

Instance Method Details

#executeObject


20
21
22
23
24
25
26
27
28
29
# File 'lib/gitlab/phabricator_import/importer.rb', line 20

def execute
  Gitlab::Import::SetAsyncJid.set_jid(project.import_state)
  schedule_first_tasks_page

  true
rescue => e
  fail_import(e.message)

  false
end