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

issues_importer.rb « importer « github_import « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 21d9ce8cd2d2bd65eaf655a820e30cf65e1321f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# frozen_string_literal: true

module Gitlab
  module GithubImport
    module Importer
      class IssuesImporter
        include ParallelScheduling

        def initialize(project, client, parallel: true)
          super

          @work_item_type_id = ::WorkItems::Type.default_issue_type.id
        end

        def importer_class
          IssueAndLabelLinksImporter
        end

        def representation_class
          Representation::Issue
        end

        def sidekiq_worker_class
          ImportIssueWorker
        end

        def object_type
          :issue
        end

        def collection_method
          :issues
        end

        def id_for_already_imported_cache(issue)
          issue.number
        end

        def collection_options
          { state: 'all', sort: 'created', direction: 'asc' }
        end

        private

        def additional_object_data
          { work_item_type_id: @work_item_type_id }
        end
      end
    end
  end
end