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

build_trace.rb « ci « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b9a7410264138b6ae2ae3429e75b105d9bbab21f (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 Ci
  class BuildTrace
    attr_reader :trace, :build

    delegate :state, :append, :truncated, :offset, :size, :total, to: :trace, allow_nil: true
    delegate :id, :status, :complete?, to: :build, prefix: true

    def initialize(build:, stream:, state:)
      @build = build

      if stream.valid?
        stream.limit
        @trace = Gitlab::Ci::Ansi2json.convert(
          stream.stream,
          state,
          verify_state: Feature.enabled?(:sign_and_verify_ansi2json_state, build.project)
        )
      end
    end

    def lines
      @trace&.lines
    end
  end
end