Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
29291f79
Commit
29291f79
authored
Mar 26, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tags field to Jobs Type
parent
430620cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
0 deletions
+13
-0
app/graphql/types/ci/job_type.rb
app/graphql/types/ci/job_type.rb
+6
-0
changelogs/unreleased/jivanvl-add-tags-job-type-graphql.yml
changelogs/unreleased/jivanvl-add-tags-job-type-graphql.yml
+5
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
spec/graphql/types/ci/job_type_spec.rb
spec/graphql/types/ci/job_type_spec.rb
+1
-0
No files found.
app/graphql/types/ci/job_type.rb
View file @
29291f79
...
@@ -26,6 +26,8 @@ module Types
...
@@ -26,6 +26,8 @@ module Types
description:
'Whether this job is allowed to fail.'
description:
'Whether this job is allowed to fail.'
field
:duration
,
GraphQL
::
INT_TYPE
,
null:
true
,
field
:duration
,
GraphQL
::
INT_TYPE
,
null:
true
,
description:
'Duration of the job in seconds.'
description:
'Duration of the job in seconds.'
field
:tags
,
[
GraphQL
::
STRING_TYPE
],
null:
true
,
description:
'Tags for the current job.'
# Life-cycle timestamps:
# Life-cycle timestamps:
field
:created_at
,
Types
::
TimeType
,
null:
false
,
field
:created_at
,
Types
::
TimeType
,
null:
false
,
...
@@ -68,6 +70,10 @@ module Types
...
@@ -68,6 +70,10 @@ module Types
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
::
Ci
::
Pipeline
,
object
.
pipeline_id
).
find
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
::
Ci
::
Pipeline
,
object
.
pipeline_id
).
find
end
end
def
tags
object
.
tags
.
map
{
|
tag
|
tag
.
name
}
if
object
.
is_a?
(
::
Ci
::
Build
)
end
def
detailed_status
def
detailed_status
object
.
detailed_status
(
context
[
:current_user
])
object
.
detailed_status
(
context
[
:current_user
])
end
end
...
...
changelogs/unreleased/jivanvl-add-tags-job-type-graphql.yml
0 → 100644
View file @
29291f79
---
title
:
Add tags field to jobType in the CI namespace
merge_request
:
57631
author
:
type
:
changed
doc/api/graphql/reference/index.md
View file @
29291f79
...
@@ -1235,6 +1235,7 @@ An edge in a connection.
...
@@ -1235,6 +1235,7 @@ An edge in a connection.
|
`stage`
|
[
`CiStage`
](
#cistage
)
| Stage of the job. |
|
`stage`
|
[
`CiStage`
](
#cistage
)
| Stage of the job. |
|
`startedAt`
|
[
`Time`
](
#time
)
| When the job was started. |
|
`startedAt`
|
[
`Time`
](
#time
)
| When the job was started. |
|
`status`
|
[
`CiJobStatus`
](
#cijobstatus
)
| Status of the job. |
|
`status`
|
[
`CiJobStatus`
](
#cijobstatus
)
| Status of the job. |
|
`tags`
|
[
`[String!]`
](
#string
)
| Tags for the current job. |
### `CiJobArtifact`
### `CiJobArtifact`
...
...
spec/graphql/types/ci/job_type_spec.rb
View file @
29291f79
...
@@ -33,6 +33,7 @@ RSpec.describe Types::Ci::JobType do
...
@@ -33,6 +33,7 @@ RSpec.describe Types::Ci::JobType do
stage
stage
started_at
started_at
status
status
tags
]
]
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment