Commit 62dd4d22 authored by Miguel Rincon's avatar Miguel Rincon

Add editAdminUrl to Runner GraphQL API

This change adds a "edit_admin_url" field to the Runner entity in
GraphQL to contain an edit runner page URL.

Changelog: added
parent 90ab79b4
...@@ -56,6 +56,8 @@ module Types ...@@ -56,6 +56,8 @@ module Types
description: "Number of jobs processed by the runner (limited to #{JOB_COUNT_LIMIT}, plus one to indicate that more items exist)." description: "Number of jobs processed by the runner (limited to #{JOB_COUNT_LIMIT}, plus one to indicate that more items exist)."
field :admin_url, GraphQL::Types::String, null: true, field :admin_url, GraphQL::Types::String, null: true,
description: 'Admin URL of the runner. Only available for administrators.' description: 'Admin URL of the runner. Only available for administrators.'
field :edit_admin_url, GraphQL::Types::String, null: true,
description: 'Admin form URL of the runner. Only available for administrators.'
field :executor_name, GraphQL::Types::String, null: true, field :executor_name, GraphQL::Types::String, null: true,
description: 'Executor last advertised by the runner.', description: 'Executor last advertised by the runner.',
method: :executor_name, method: :executor_name,
...@@ -70,6 +72,10 @@ module Types ...@@ -70,6 +72,10 @@ module Types
Gitlab::Routing.url_helpers.admin_runner_url(runner) if can_admin_runners? Gitlab::Routing.url_helpers.admin_runner_url(runner) if can_admin_runners?
end end
def edit_admin_url
Gitlab::Routing.url_helpers.edit_admin_runner_url(runner) if can_admin_runners?
end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def project_count def project_count
BatchLoader::GraphQL.for(runner.id).batch(key: :runner_project_count) do |ids, loader, args| BatchLoader::GraphQL.for(runner.id).batch(key: :runner_project_count) do |ids, loader, args|
......
...@@ -8914,6 +8914,7 @@ Represents the total number of issues and their weights for a particular day. ...@@ -8914,6 +8914,7 @@ Represents the total number of issues and their weights for a particular day.
| <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. |
| <a id="cirunnerdescription"></a>`description` | [`String`](#string) | Description of the runner. | | <a id="cirunnerdescription"></a>`description` | [`String`](#string) | Description of the runner. |
| <a id="cirunnereditadminurl"></a>`editAdminUrl` | [`String`](#string) | Admin form URL of the runner. Only available for administrators. |
| <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. |
| <a id="cirunneripaddress"></a>`ipAddress` | [`String`](#string) | IP address of the runner. | | <a id="cirunneripaddress"></a>`ipAddress` | [`String`](#string) | IP address of the runner. |
...@@ -11,7 +11,7 @@ RSpec.describe GitlabSchema.types['CiRunner'] do ...@@ -11,7 +11,7 @@ RSpec.describe GitlabSchema.types['CiRunner'] 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 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 edit_admin_url user_permissions executor_name
] ]
expect(described_class).to include_graphql_fields(*expected_fields) expect(described_class).to include_graphql_fields(*expected_fields)
......
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