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

build_metadata_presenter.rb « ci « presenters « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4871bb3a91991d12872018f825e1cf4ec25c4a9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Ci
  class BuildMetadataPresenter < Gitlab::View::Presenter::Delegated
    TIMEOUT_SOURCES = {
        unknown_timeout_source: nil,
        project_timeout_source: 'project',
        runner_timeout_source: 'runner',
        job_timeout_source: 'job'
    }.freeze

    presents :metadata

    def timeout_source
      return unless metadata.timeout_source?

      TIMEOUT_SOURCES[metadata.timeout_source.to_sym] ||
        metadata.timeout_source
    end
  end
end