Skip to content
Snippets Groups Projects
Unverified Commit f5f28291 authored by Pedro Pombeiro's avatar Pedro Pombeiro
Browse files

GraphQL: Add maintenance_note_html field

to RunnerType

Changelog: added
parent 6ce9b8fa
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -86,6 +86,12 @@ class RunnerType < BaseObject
field :version, GraphQL::Types::String, null: true,
description: 'Version of the runner.'
 
markdown_field :maintenance_note_html, null: true
def maintenance_note_html_resolver
::MarkupHelper.markdown(object.maintenance_note, context.to_h.dup)
end
def job_count
# We limit to 1 above the JOB_COUNT_LIMIT to indicate that more items exist after JOB_COUNT_LIMIT
runner.builds.limit(JOB_COUNT_LIMIT + 1).count
Loading
Loading
Loading
Loading
@@ -9582,6 +9582,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="cirunnerlocked"></a>`locked` | [`Boolean`](#boolean) | Indicates the runner is locked. |
| <a id="cirunnermaintenancenote"></a>`maintenanceNote` | [`String`](#string) | Runner's maintenance notes. |
| <a id="cirunnermaintenancenotehtml"></a>`maintenanceNoteHtml` | [`String`](#string) | The GitLab Flavored Markdown rendering of `maintenance_note`. |
| <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="cirunnerplatformname"></a>`platformName` | [`String`](#string) | Platform provided by the runner. |
Loading
Loading
@@ -12,7 +12,7 @@
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
project_count job_count admin_url edit_admin_url user_permissions executor_name architecture_name platform_name
maintenance_note groups projects jobs token_expires_at
maintenance_note maintenance_note_html groups projects jobs token_expires_at
]
 
expect(described_class).to include_graphql_fields(*expected_fields)
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@
create(:ci_runner, :instance, description: 'Runner 1', contacted_at: 2.hours.ago,
active: true, version: 'adfe156', revision: 'a', locked: true, ip_address: '127.0.0.1', maximum_timeout: 600,
access_level: 0, tag_list: %w[tag1 tag2], run_untagged: true, executor_type: :custom,
maintenance_note: 'Test maintenance note')
maintenance_note: '**Test maintenance note**')
end
 
let_it_be(:inactive_instance_runner) do
Loading
Loading
@@ -66,6 +66,8 @@
'architectureName' => runner.architecture,
'platformName' => runner.platform,
'maintenanceNote' => runner.maintenance_note,
'maintenanceNoteHtml' =>
runner.maintainer_note.present? ? a_string_including('<strong>Test maintenance note</strong>') : '',
'jobCount' => 0,
'jobs' => a_hash_including("count" => 0, "nodes" => [], "pageInfo" => anything),
'projectCount' => nil,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment