Commit 6d4a2362 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'pedropombeiro/333232/graphql-minutes-cost-factor' into 'master'

Add minutes cost factor to Runner GraphQL type

See merge request gitlab-org/gitlab!63748
parents 2815df83 7df453b4
...@@ -40,3 +40,5 @@ module Types ...@@ -40,3 +40,5 @@ module Types
end end
end end
end end
Types::Ci::RunnerType.prepend_mod_with('Types::Ci::RunnerType')
...@@ -7544,6 +7544,8 @@ Represents the total number of issues and their weights for a particular day. ...@@ -7544,6 +7544,8 @@ Represents the total number of issues and their weights for a particular day.
| <a id="cirunneripaddress"></a>`ipAddress` | [`String!`](#string) | IP address of the runner. | | <a id="cirunneripaddress"></a>`ipAddress` | [`String!`](#string) | IP address of the runner. |
| <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="cirunnerprivateprojectsminutescostfactor"></a>`privateProjectsMinutesCostFactor` | [`Float`](#float) | Private projects' "minutes cost factor" associated with the runner (GitLab.com only). |
| <a id="cirunnerpublicprojectsminutescostfactor"></a>`publicProjectsMinutesCostFactor` | [`Float`](#float) | Public projects' "minutes cost factor" associated with the runner (GitLab.com only). |
| <a id="cirunnerrevision"></a>`revision` | [`String!`](#string) | Revision of the runner. | | <a id="cirunnerrevision"></a>`revision` | [`String!`](#string) | Revision of the runner. |
| <a id="cirunnerrununtagged"></a>`runUntagged` | [`Boolean!`](#boolean) | Indicates the runner is able to run untagged jobs. | | <a id="cirunnerrununtagged"></a>`runUntagged` | [`Boolean!`](#boolean) | Indicates the runner is able to run untagged jobs. |
| <a id="cirunnerrunnertype"></a>`runnerType` | [`CiRunnerType!`](#cirunnertype) | Type of the runner. | | <a id="cirunnerrunnertype"></a>`runnerType` | [`CiRunnerType!`](#cirunnertype) | Type of the runner. |
......
# frozen_string_literal: true
module EE
module Types
module Ci
module RunnerType
extend ActiveSupport::Concern
prepended do
field :public_projects_minutes_cost_factor, GraphQL::FLOAT_TYPE, null: true,
description: 'Public projects\' "minutes cost factor" associated with the runner (GitLab.com only).'
field :private_projects_minutes_cost_factor, GraphQL::FLOAT_TYPE, null: true,
description: 'Private projects\' "minutes cost factor" associated with the runner (GitLab.com only).'
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabSchema.types['CiRunner'] do
it { expect(described_class.graphql_name).to eq('CiRunner') }
it 'includes the ee specific fields' do
expected_fields = %w[public_projects_minutes_cost_factor private_projects_minutes_cost_factor]
expect(described_class).to include_graphql_fields(*expected_fields)
end
end
...@@ -2,15 +2,17 @@ ...@@ -2,15 +2,17 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Types::Ci::RunnerType do RSpec.describe GitlabSchema.types['CiRunner'] do
specify { expect(described_class.graphql_name).to eq('CiRunner') } specify { expect(described_class.graphql_name).to eq('CiRunner') }
specify { expect(described_class).to require_graphql_authorizations(:read_runner) }
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 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
] ]
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to include_graphql_fields(*expected_fields)
end end
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