summaryrefslogtreecommitdiff
path: root/lib/api/entities/ci/pipeline.rb
blob: a8033a21044ea7053318b16f8b1be0ab1fdf0624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module API
  module Entities
    module Ci
      class Pipeline < PipelineBasic
        expose :before_sha, :tag, :yaml_errors

        expose :user, with: Entities::UserBasic
        expose :created_at, :updated_at, :started_at, :finished_at, :committed_at
        expose :duration
        expose :queued_duration
        expose :coverage do |pipeline|
          pipeline.present.coverage
        end
        expose :detailed_status, using: DetailedStatusEntity do |pipeline, options|
          pipeline.detailed_status(options[:current_user])
        end
      end
    end
  end
end