Commit 0be01a3b authored by Dmitry Gruzd's avatar Dmitry Gruzd

Merge branch 'pedropombeiro/344918/graphql-deprecate-runner-active-field' into 'master'

GraphQL: Deprecate active field for RunnerType

See merge request gitlab-org/gitlab!79017
parents b10c389f 7cc4a9c2
...@@ -7,12 +7,20 @@ module Types ...@@ -7,12 +7,20 @@ module Types
value 'ACTIVE', value 'ACTIVE',
description: 'Runner that is not paused.', description: 'Runner that is not paused.',
deprecated: { reason: 'Use CiRunnerType.active instead', milestone: '14.6' }, deprecated: {
reason: :renamed,
replacement: 'CiRunner.paused',
milestone: '14.6'
},
value: :active value: :active
value 'PAUSED', value 'PAUSED',
description: 'Runner that is paused.', description: 'Runner that is paused.',
deprecated: { reason: 'Use CiRunnerType.active instead', milestone: '14.6' }, deprecated: {
reason: :renamed,
replacement: 'CiRunner.paused',
milestone: '14.6'
},
value: :paused value: :paused
value 'ONLINE', value 'ONLINE',
......
...@@ -29,7 +29,10 @@ module Types ...@@ -29,7 +29,10 @@ module Types
field :access_level, ::Types::Ci::RunnerAccessLevelEnum, null: false, field :access_level, ::Types::Ci::RunnerAccessLevelEnum, null: false,
description: 'Access level of the runner.' description: 'Access level of the runner.'
field :active, GraphQL::Types::Boolean, null: false, field :active, GraphQL::Types::Boolean, null: false,
description: 'Indicates the runner is allowed to receive jobs.' description: 'Indicates the runner is allowed to receive jobs.',
deprecated: { reason: 'Use paused', milestone: '14.8' }
field :paused, GraphQL::Types::Boolean, null: false,
description: 'Indicates the runner is paused and not available to run jobs.'
field :status, field :status,
Types::Ci::RunnerStatusEnum, Types::Ci::RunnerStatusEnum,
null: false, null: false,
......
...@@ -15,5 +15,9 @@ module Ci ...@@ -15,5 +15,9 @@ module Ci
def executor_name def executor_name
Ci::Runner::EXECUTOR_TYPE_TO_NAMES[executor_type&.to_sym] Ci::Runner::EXECUTOR_TYPE_TO_NAMES[executor_type&.to_sym]
end end
def paused
!active
end
end end
end end
...@@ -9015,7 +9015,7 @@ Represents the total number of issues and their weights for a particular day. ...@@ -9015,7 +9015,7 @@ Represents the total number of issues and their weights for a particular day.
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| <a id="cirunneraccesslevel"></a>`accessLevel` | [`CiRunnerAccessLevel!`](#cirunneraccesslevel) | Access level of the runner. | | <a id="cirunneraccesslevel"></a>`accessLevel` | [`CiRunnerAccessLevel!`](#cirunneraccesslevel) | Access level of the runner. |
| <a id="cirunneractive"></a>`active` | [`Boolean!`](#boolean) | Indicates the runner is allowed to receive jobs. | | <a id="cirunneractive"></a>`active` **{warning-solid}** | [`Boolean!`](#boolean) | **Deprecated** in 14.8. Use paused. |
| <a id="cirunneradminurl"></a>`adminUrl` | [`String`](#string) | Admin URL of the runner. Only available for administrators. | | <a id="cirunneradminurl"></a>`adminUrl` | [`String`](#string) | Admin URL of the runner. Only available for administrators. |
| <a id="cirunnercontactedat"></a>`contactedAt` | [`Time`](#time) | Timestamp of last contact from this runner. | | <a id="cirunnercontactedat"></a>`contactedAt` | [`Time`](#time) | Timestamp of last contact from this runner. |
| <a id="cirunnercreatedat"></a>`createdAt` | [`Time`](#time) | Timestamp of creation of this runner. | | <a id="cirunnercreatedat"></a>`createdAt` | [`Time`](#time) | Timestamp of creation of this runner. |
...@@ -9028,6 +9028,7 @@ Represents the total number of issues and their weights for a particular day. ...@@ -9028,6 +9028,7 @@ Represents the total number of issues and their weights for a particular day.
| <a id="cirunnerjobcount"></a>`jobCount` | [`Int`](#int) | Number of jobs processed by the runner (limited to 1000, plus one to indicate that more items exist). | | <a id="cirunnerjobcount"></a>`jobCount` | [`Int`](#int) | Number of jobs processed by the runner (limited to 1000, plus one to indicate that more items exist). |
| <a id="cirunnerlocked"></a>`locked` | [`Boolean`](#boolean) | Indicates the runner is locked. | | <a id="cirunnerlocked"></a>`locked` | [`Boolean`](#boolean) | Indicates the runner is locked. |
| <a id="cirunnermaximumtimeout"></a>`maximumTimeout` | [`Int`](#int) | Maximum timeout (in seconds) for jobs processed by the runner. | | <a id="cirunnermaximumtimeout"></a>`maximumTimeout` | [`Int`](#int) | Maximum timeout (in seconds) for jobs processed by the runner. |
| <a id="cirunnerpaused"></a>`paused` | [`Boolean!`](#boolean) | Indicates the runner is paused and not available to run jobs. |
| <a id="cirunnerprivateprojectsminutescostfactor"></a>`privateProjectsMinutesCostFactor` | [`Float`](#float) | Private projects' "minutes cost factor" associated with the runner (GitLab.com only). | | <a id="cirunnerprivateprojectsminutescostfactor"></a>`privateProjectsMinutesCostFactor` | [`Float`](#float) | Private projects' "minutes cost factor" associated with the runner (GitLab.com only). |
| <a id="cirunnerprojectcount"></a>`projectCount` | [`Int`](#int) | Number of projects that the runner is associated with. | | <a id="cirunnerprojectcount"></a>`projectCount` | [`Int`](#int) | Number of projects that the runner is associated with. |
| <a id="cirunnerprojects"></a>`projects` | [`ProjectConnection`](#projectconnection) | Projects the runner is associated with. For project runners only. (see [Connections](#connections)) | | <a id="cirunnerprojects"></a>`projects` | [`ProjectConnection`](#projectconnection) | Projects the runner is associated with. For project runners only. (see [Connections](#connections)) |
...@@ -16491,12 +16492,12 @@ Values for sorting runners. ...@@ -16491,12 +16492,12 @@ Values for sorting runners.
| Value | Description | | Value | Description |
| ----- | ----------- | | ----- | ----------- |
| <a id="cirunnerstatusactive"></a>`ACTIVE` **{warning-solid}** | **Deprecated** in 14.6. Use CiRunnerType.active instead. | | <a id="cirunnerstatusactive"></a>`ACTIVE` **{warning-solid}** | **Deprecated** in 14.6. This was renamed. Use: [`CiRunner.paused`](#cirunnerpaused). |
| <a id="cirunnerstatusnever_contacted"></a>`NEVER_CONTACTED` | Runner that has never contacted this instance. Set legacyMode to null to utilize this value. Will replace NOT_CONNECTED starting in 15.0. | | <a id="cirunnerstatusnever_contacted"></a>`NEVER_CONTACTED` | Runner that has never contacted this instance. Set legacyMode to null to utilize this value. Will replace NOT_CONNECTED starting in 15.0. |
| <a id="cirunnerstatusnot_connected"></a>`NOT_CONNECTED` **{warning-solid}** | **Deprecated** in 14.6. Use NEVER_CONTACTED instead. NEVER_CONTACTED will have a slightly different scope starting in 15.0, with STALE being returned instead after 3 months of no contact. | | <a id="cirunnerstatusnot_connected"></a>`NOT_CONNECTED` **{warning-solid}** | **Deprecated** in 14.6. Use NEVER_CONTACTED instead. NEVER_CONTACTED will have a slightly different scope starting in 15.0, with STALE being returned instead after 3 months of no contact. |
| <a id="cirunnerstatusoffline"></a>`OFFLINE` **{warning-solid}** | **Deprecated** in 14.6. This field will have a slightly different scope starting in 15.0, with STALE being returned after a certain period offline. | | <a id="cirunnerstatusoffline"></a>`OFFLINE` **{warning-solid}** | **Deprecated** in 14.6. This field will have a slightly different scope starting in 15.0, with STALE being returned after a certain period offline. |
| <a id="cirunnerstatusonline"></a>`ONLINE` | Runner that contacted this instance within the last 2 hours. | | <a id="cirunnerstatusonline"></a>`ONLINE` | Runner that contacted this instance within the last 2 hours. |
| <a id="cirunnerstatuspaused"></a>`PAUSED` **{warning-solid}** | **Deprecated** in 14.6. Use CiRunnerType.active instead. | | <a id="cirunnerstatuspaused"></a>`PAUSED` **{warning-solid}** | **Deprecated** in 14.6. This was renamed. Use: [`CiRunner.paused`](#cirunnerpaused). |
| <a id="cirunnerstatusstale"></a>`STALE` | Runner that has not contacted this instance within the last 3 months. Only available if legacyMode is null. Will be a possible return value starting in 15.0. | | <a id="cirunnerstatusstale"></a>`STALE` | Runner that has not contacted this instance within the last 3 months. Only available if legacyMode is null. Will be a possible return value starting in 15.0. |
### `CiRunnerType` ### `CiRunnerType`
...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['CiRunner'] do ...@@ -9,7 +9,7 @@ RSpec.describe GitlabSchema.types['CiRunner'] do
it 'contains attributes related to a runner' do it 'contains attributes related to a runner' do
expected_fields = %w[ expected_fields = %w[
id description created_at contacted_at maximum_timeout access_level active status id description created_at contacted_at maximum_timeout access_level active paused status
version short_sha revision locked run_untagged ip_address runner_type tag_list version short_sha revision locked run_untagged ip_address runner_type tag_list
project_count job_count admin_url edit_admin_url user_permissions executor_name project_count job_count admin_url edit_admin_url user_permissions executor_name
groups projects groups projects
......
...@@ -68,6 +68,7 @@ RSpec.describe 'Query.runner(id)' do ...@@ -68,6 +68,7 @@ RSpec.describe 'Query.runner(id)' do
'revision' => runner.revision, 'revision' => runner.revision,
'locked' => false, 'locked' => false,
'active' => runner.active, 'active' => runner.active,
'paused' => !runner.active,
'status' => runner.status('14.5').to_s.upcase, 'status' => runner.status('14.5').to_s.upcase,
'maximumTimeout' => runner.maximum_timeout, 'maximumTimeout' => runner.maximum_timeout,
'accessLevel' => runner.access_level.to_s.upcase, 'accessLevel' => runner.access_level.to_s.upcase,
......
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