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

runner_status_enum.rb « ci « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8501ce20204e66fdb0221b03f595a6d7b4b24fc2 (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
# frozen_string_literal: true

module Types
  module Ci
    class RunnerStatusEnum < BaseEnum
      graphql_name 'CiRunnerStatus'

      ::Ci::Runner::AVAILABLE_STATUSES.each do |status|
        description = case status
                      when 'active'
                        "A runner that is not paused."
                      when 'online'
                        "A runner that contacted this instance within the last #{::Ci::Runner::ONLINE_CONTACT_TIMEOUT.inspect}."
                      when 'offline'
                        "A runner that has not contacted this instance within the last #{::Ci::Runner::ONLINE_CONTACT_TIMEOUT.inspect}."
                      when 'not_connected'
                        "A runner that has never contacted this instance."
                      else
                        "A runner that is #{status.to_s.tr('_', ' ')}."
                      end

        value status.to_s.upcase,
              description: description,
              value: status.to_sym
      end
    end
  end
end