Commit bbc305b1 authored by Alexis Reigel's avatar Alexis Reigel

dry up available scopes to constants

parent f0d0400d
...@@ -11,7 +11,9 @@ module Ci ...@@ -11,7 +11,9 @@ module Ci
RUNNER_QUEUE_EXPIRY_TIME = 60.minutes RUNNER_QUEUE_EXPIRY_TIME = 60.minutes
ONLINE_CONTACT_TIMEOUT = 1.hour ONLINE_CONTACT_TIMEOUT = 1.hour
UPDATE_DB_RUNNER_INFO_EVERY = 40.minutes UPDATE_DB_RUNNER_INFO_EVERY = 40.minutes
AVAILABLE_SCOPES = %w[specific shared active paused online].freeze AVAILABLE_TYPES = %w[specific shared].freeze
AVAILABLE_STATUSES = %w[active paused online offline].freeze
AVAILABLE_SCOPES = (AVAILABLE_TYPES + AVAILABLE_STATUSES).freeze
FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_timeout_human_readable].freeze FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_timeout_human_readable].freeze
ignore_column :is_shared ignore_column :is_shared
......
...@@ -9,7 +9,7 @@ module API ...@@ -9,7 +9,7 @@ module API
success Entities::Runner success Entities::Runner
end end
params do params do
optional :scope, type: String, values: %w[active paused online offline], optional :scope, type: String, values: Ci::Runner::AVAILABLE_STATUSES,
desc: 'The scope of specific runners to show' desc: 'The scope of specific runners to show'
use :pagination use :pagination
end end
...@@ -22,7 +22,7 @@ module API ...@@ -22,7 +22,7 @@ module API
success Entities::Runner success Entities::Runner
end end
params do params do
optional :scope, type: String, values: %w[active paused online offline specific shared], optional :scope, type: String, values: Ci::Runner::AVAILABLE_SCOPES,
desc: 'The scope of specific runners to show' desc: 'The scope of specific runners to show'
use :pagination use :pagination
end end
...@@ -114,7 +114,7 @@ module API ...@@ -114,7 +114,7 @@ module API
success Entities::Runner success Entities::Runner
end end
params do params do
optional :scope, type: String, values: %w[active paused online offline specific shared], optional :scope, type: String, values: Ci::Runner::AVAILABLE_SCOPES,
desc: 'The scope of specific runners to show' desc: 'The scope of specific runners to show'
use :pagination use :pagination
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment