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
description: 'Indicates the job is active.'
field :coverage, GraphQL::FLOAT_TYPE, null: true,
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
Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Pipeline, object.pipeline_id).find
......@@ -123,6 +129,18 @@ module Types
def coverage
object&.coverage
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
---
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.
| <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="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="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="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="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. |
......@@ -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="cijobstatus"></a>`status` | [`CiJobStatus`](#cijobstatus) | Status of the 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`
......
......@@ -15,10 +15,12 @@ RSpec.describe Types::Ci::JobType do
commitPath
coverage
created_at
created_by_tag
detailedStatus
duration
finished_at
id
manual_job
name
needs
pipeline
......@@ -34,6 +36,7 @@ RSpec.describe Types::Ci::JobType do
started_at
status
tags
triggered
]
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