diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-26 16:27:27 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-26 16:27:27 +0000 |
commit | 4586d77c85647063675108b0dcdcfebed0c890ca (patch) | |
tree | 382e3d9b36243bd0da2a1c59303b2851adebe68a /app/models | |
parent | 779169d337394be7cf2b76d01b42550d7a60b488 (diff) | |
parent | 2466a51407205cc16f19c2d055ca21032675e1da (diff) | |
download | gitlab-ce-4586d77c85647063675108b0dcdcfebed0c890ca.tar.gz |
Merge branch 'feature/runner-type-filter-for-admin-view' into 'master'
Feature: Runner type filter for admin view
See merge request gitlab-org/gitlab-ce!19649
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/runner.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 3e815937f4b..31330d0682e 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -9,12 +9,24 @@ module Ci include ChronicDurationAttribute include FromUnion + enum access_level: { + not_protected: 0, + ref_protected: 1 + } + + enum runner_type: { + instance_type: 1, + group_type: 2, + project_type: 3 + } + RUNNER_QUEUE_EXPIRY_TIME = 60.minutes ONLINE_CONTACT_TIMEOUT = 1.hour UPDATE_DB_RUNNER_INFO_EVERY = 40.minutes - AVAILABLE_TYPES = %w[specific shared].freeze + AVAILABLE_TYPES_LEGACY = %w[specific shared].freeze + AVAILABLE_TYPES = runner_types.keys.freeze AVAILABLE_STATUSES = %w[active paused online offline].freeze - AVAILABLE_SCOPES = (AVAILABLE_TYPES + AVAILABLE_STATUSES).freeze + AVAILABLE_SCOPES = (AVAILABLE_TYPES_LEGACY + AVAILABLE_TYPES + AVAILABLE_STATUSES).freeze FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_timeout_human_readable].freeze ignore_column :is_shared @@ -97,17 +109,6 @@ module Ci after_destroy :cleanup_runner_queue - enum access_level: { - not_protected: 0, - ref_protected: 1 - } - - enum runner_type: { - instance_type: 1, - group_type: 2, - project_type: 3 - } - cached_attr_reader :version, :revision, :platform, :architecture, :ip_address, :contacted_at chronic_duration_attr :maximum_timeout_human_readable, :maximum_timeout |