Commit f9173071 authored by Miguel Rincon's avatar Miguel Rincon

Add createdAt to Runner GraphQL API

This change adds the "create_at" field to the Runner entity in GraphQL.

Changelog: added
parent 7e5236e6
...@@ -18,8 +18,10 @@ module Types ...@@ -18,8 +18,10 @@ module Types
description: 'ID of the runner.' description: 'ID of the runner.'
field :description, GraphQL::Types::String, null: true, field :description, GraphQL::Types::String, null: true,
description: 'Description of the runner.' description: 'Description of the runner.'
field :created_at, Types::TimeType, null: true,
description: 'Timestamp of creation of this runner.'
field :contacted_at, Types::TimeType, null: true, field :contacted_at, Types::TimeType, null: true,
description: 'Last contact from the runner.', description: 'Timestamp of last contact from this runner.',
method: :contacted_at method: :contacted_at
field :maximum_timeout, GraphQL::Types::Int, null: true, field :maximum_timeout, GraphQL::Types::Int, null: true,
description: 'Maximum timeout (in seconds) for jobs processed by the runner.' description: 'Maximum timeout (in seconds) for jobs processed by the runner.'
......
...@@ -8911,7 +8911,8 @@ Represents the total number of issues and their weights for a particular day. ...@@ -8911,7 +8911,8 @@ Represents the total number of issues and their weights for a particular day.
| <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` | [`Boolean!`](#boolean) | Indicates the runner is allowed to receive jobs. |
| <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) | Last contact from the 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="cirunnerdescription"></a>`description` | [`String`](#string) | Description of the runner. | | <a id="cirunnerdescription"></a>`description` | [`String`](#string) | Description of the runner. |
| <a id="cirunnerexecutorname"></a>`executorName` | [`String`](#string) | Executor last advertised by the runner. Available only when feature flag `graphql_ci_runner_executor` is enabled. This flag is disabled by default, because the feature is experimental and is subject to change without notice. | | <a id="cirunnerexecutorname"></a>`executorName` | [`String`](#string) | Executor last advertised by the runner. Available only when feature flag `graphql_ci_runner_executor` is enabled. This flag is disabled by default, because the feature is experimental and is subject to change without notice. |
| <a id="cirunnerid"></a>`id` | [`CiRunnerID!`](#cirunnerid) | ID of the runner. | | <a id="cirunnerid"></a>`id` | [`CiRunnerID!`](#cirunnerid) | ID of the runner. |
...@@ -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 contacted_at maximum_timeout access_level active status id description created_at contacted_at maximum_timeout access_level active 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 user_permissions executor_name project_count job_count admin_url user_permissions executor_name
] ]
......
...@@ -57,6 +57,7 @@ RSpec.describe 'Query.runner(id)' do ...@@ -57,6 +57,7 @@ RSpec.describe 'Query.runner(id)' do
expect(runner_data).to match a_hash_including( expect(runner_data).to match a_hash_including(
'id' => "gid://gitlab/Ci::Runner/#{runner.id}", 'id' => "gid://gitlab/Ci::Runner/#{runner.id}",
'description' => runner.description, 'description' => runner.description,
'createdAt' => runner.created_at&.iso8601,
'contactedAt' => runner.contacted_at&.iso8601, 'contactedAt' => runner.contacted_at&.iso8601,
'version' => runner.version, 'version' => runner.version,
'shortSha' => runner.short_sha, 'shortSha' => runner.short_sha,
......
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