Commit 54972507 authored by Jose Vargas's avatar Jose Vargas

Add more fields to the graphql job_type

This adds the duration and finished_at fields
to the aforementioned graphql type
parent 5aecf245
......@@ -18,6 +18,10 @@ module Types
description: 'Schedule for the build.'
field :artifacts, Types::Ci::JobArtifactType.connection_type, null: true,
description: 'Artifacts generated by the job.'
field :finished_at, Types::TimeType, null: true,
description: 'When a job has finished running.'
field :duration, GraphQL::INT_TYPE, null: true,
description: 'Duration of the job in seconds.'
def pipeline
Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Pipeline, object.pipeline_id).find
......
---
title: Add duration and finishedAt GraphQL fields to jobType in the CI namespace
merge_request: 54358
author:
type: changed
This diff is collapsed.
This diff is collapsed.
......@@ -669,6 +669,8 @@ Autogenerated return type of CiCdSettingsUpdate.
| ----- | ---- | ----------- |
| `artifacts` | CiJobArtifactConnection | Artifacts generated by the job. |
| `detailedStatus` | DetailedStatus | Detailed status of the job. |
| `duration` | Int | Duration of the job in seconds. |
| `finishedAt` | Time | When a job has finished running. |
| `name` | String | Name of the job. |
| `needs` | CiBuildNeedConnection | References to builds that must complete before the jobs run. |
| `pipeline` | Pipeline | Pipeline the job belongs to. |
......
......@@ -14,6 +14,8 @@ RSpec.describe Types::Ci::JobType do
detailedStatus
scheduledAt
artifacts
finished_at
duration
]
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