Commit 32e3873b authored by Sean McGivern's avatar Sean McGivern

Merge branch 'pb-add-missing-data-to-ci-job-type' into 'master'

Add missing data to CiJob type

See merge request gitlab-org/gitlab!59805
parents 4022e65d ddffb972
...@@ -65,6 +65,12 @@ module Types ...@@ -65,6 +65,12 @@ module Types
description: 'Indicates the job is active.' description: 'Indicates the job is active.'
field :coverage, GraphQL::FLOAT_TYPE, null: true, field :coverage, GraphQL::FLOAT_TYPE, null: true,
description: 'Coverage level of the job.' description: 'Coverage level of the job.'
field :created_by_tag, GraphQL::BOOLEAN_TYPE, null: false,
description: 'Whether the job was created by a tag.'
field :manual_job, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Whether the job has a manual action.'
field :triggered, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Whether the job was triggered.'
def pipeline def pipeline
Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Pipeline, object.pipeline_id).find Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Pipeline, object.pipeline_id).find
...@@ -123,6 +129,18 @@ module Types ...@@ -123,6 +129,18 @@ module Types
def coverage def coverage
object&.coverage object&.coverage
end end
def created_by_tag
object.tag?
end
def manual_job
object.try(:action?)
end
def triggered
object.try(:trigger_request)
end
end end
end end
end end
---
title: Add missing data to CiJob type
merge_request: 59805
author:
type: added
...@@ -7075,10 +7075,12 @@ Represents the total number of issues and their weights for a particular day. ...@@ -7075,10 +7075,12 @@ Represents the total number of issues and their weights for a particular day.
| <a id="cijobcommitpath"></a>`commitPath` | [`String`](#string) | Path to the commit that triggered the job. | | <a id="cijobcommitpath"></a>`commitPath` | [`String`](#string) | Path to the commit that triggered the job. |
| <a id="cijobcoverage"></a>`coverage` | [`Float`](#float) | Coverage level of the job. | | <a id="cijobcoverage"></a>`coverage` | [`Float`](#float) | Coverage level of the job. |
| <a id="cijobcreatedat"></a>`createdAt` | [`Time!`](#time) | When the job was created. | | <a id="cijobcreatedat"></a>`createdAt` | [`Time!`](#time) | When the job was created. |
| <a id="cijobcreatedbytag"></a>`createdByTag` | [`Boolean!`](#boolean) | Whether the job was created by a tag. |
| <a id="cijobdetailedstatus"></a>`detailedStatus` | [`DetailedStatus`](#detailedstatus) | Detailed status of the job. | | <a id="cijobdetailedstatus"></a>`detailedStatus` | [`DetailedStatus`](#detailedstatus) | Detailed status of the job. |
| <a id="cijobduration"></a>`duration` | [`Int`](#int) | Duration of the job in seconds. | | <a id="cijobduration"></a>`duration` | [`Int`](#int) | Duration of the job in seconds. |
| <a id="cijobfinishedat"></a>`finishedAt` | [`Time`](#time) | When a job has finished running. | | <a id="cijobfinishedat"></a>`finishedAt` | [`Time`](#time) | When a job has finished running. |
| <a id="cijobid"></a>`id` | [`JobID`](#jobid) | ID of the job. | | <a id="cijobid"></a>`id` | [`JobID`](#jobid) | ID of the job. |
| <a id="cijobmanualjob"></a>`manualJob` | [`Boolean`](#boolean) | Whether the job has a manual action. |
| <a id="cijobname"></a>`name` | [`String`](#string) | Name of the job. | | <a id="cijobname"></a>`name` | [`String`](#string) | Name of the job. |
| <a id="cijobneeds"></a>`needs` | [`CiBuildNeedConnection`](#cibuildneedconnection) | References to builds that must complete before the jobs run. | | <a id="cijobneeds"></a>`needs` | [`CiBuildNeedConnection`](#cibuildneedconnection) | References to builds that must complete before the jobs run. |
| <a id="cijobpipeline"></a>`pipeline` | [`Pipeline`](#pipeline) | Pipeline the job belongs to. | | <a id="cijobpipeline"></a>`pipeline` | [`Pipeline`](#pipeline) | Pipeline the job belongs to. |
...@@ -7094,6 +7096,7 @@ Represents the total number of issues and their weights for a particular day. ...@@ -7094,6 +7096,7 @@ Represents the total number of issues and their weights for a particular day.
| <a id="cijobstartedat"></a>`startedAt` | [`Time`](#time) | When the job was started. | | <a id="cijobstartedat"></a>`startedAt` | [`Time`](#time) | When the job was started. |
| <a id="cijobstatus"></a>`status` | [`CiJobStatus`](#cijobstatus) | Status of the job. | | <a id="cijobstatus"></a>`status` | [`CiJobStatus`](#cijobstatus) | Status of the job. |
| <a id="cijobtags"></a>`tags` | [`[String!]`](#string) | Tags for the current job. | | <a id="cijobtags"></a>`tags` | [`[String!]`](#string) | Tags for the current job. |
| <a id="cijobtriggered"></a>`triggered` | [`Boolean`](#boolean) | Whether the job was triggered. |
### `CiJobArtifact` ### `CiJobArtifact`
......
...@@ -15,10 +15,12 @@ RSpec.describe Types::Ci::JobType do ...@@ -15,10 +15,12 @@ RSpec.describe Types::Ci::JobType do
commitPath commitPath
coverage coverage
created_at created_at
created_by_tag
detailedStatus detailedStatus
duration duration
finished_at finished_at
id id
manual_job
name name
needs needs
pipeline pipeline
...@@ -34,6 +36,7 @@ RSpec.describe Types::Ci::JobType do ...@@ -34,6 +36,7 @@ RSpec.describe Types::Ci::JobType do
started_at started_at
status status
tags tags
triggered
] ]
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_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