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

project_import_status.rb « entities « api « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5daae4a70f2c4de24dec7ccd1407b10364ffe800 (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
# frozen_string_literal: true

module API
  module Entities
    class ProjectImportStatus < ProjectIdentity
      expose :import_status
      expose :import_type
      expose :correlation_id do |project, _options|
        project.import_state&.correlation_id
      end

      expose :failed_relations, using: Entities::ProjectImportFailedRelation do |project, _options|
        project.import_state&.relation_hard_failures(limit: 100) || []
      end

      expose :import_error do |project, _options|
        project.import_state&.last_error
      end

      expose :stats do |project, _options|
        if project.github_import?
          ::Gitlab::GithubImport::ObjectCounter.summary(project)
        end
      end
    end
  end
end