Commit 29291f79 authored by Jose Vargas's avatar Jose Vargas

Add tags field to Jobs Type

parent 430620cd
......@@ -26,6 +26,8 @@ module Types
description: 'Whether this job is allowed to fail.'
field :duration, GraphQL::INT_TYPE, null: true,
description: 'Duration of the job in seconds.'
field :tags, [GraphQL::STRING_TYPE], null: true,
description: 'Tags for the current job.'
# Life-cycle timestamps:
field :created_at, Types::TimeType, null: false,
......@@ -68,6 +70,10 @@ module Types
Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Pipeline, object.pipeline_id).find
end
def tags
object.tags.map { |tag| tag.name } if object.is_a?(::Ci::Build)
end
def detailed_status
object.detailed_status(context[:current_user])
end
......
---
title: Add tags field to jobType in the CI namespace
merge_request: 57631
author:
type: changed
......@@ -1235,6 +1235,7 @@ An edge in a connection.
| `stage` | [`CiStage`](#cistage) | Stage of the job. |
| `startedAt` | [`Time`](#time) | When the job was started. |
| `status` | [`CiJobStatus`](#cijobstatus) | Status of the job. |
| `tags` | [`[String!]`](#string) | Tags for the current job. |
### `CiJobArtifact`
......
......@@ -33,6 +33,7 @@ RSpec.describe Types::Ci::JobType do
stage
started_at
status
tags
]
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