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
0a320733
Commit
0a320733
authored
Mar 15, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fields to the graphql job_type
parent
15f5a4eb
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
+4
-0
changelogs/unreleased/jivanvl-add-fields-to-job-type-graphql.yml
...ogs/unreleased/jivanvl-add-fields-to-job-type-graphql.yml
+5
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+2
-0
spec/graphql/types/ci/job_type_spec.rb
spec/graphql/types/ci/job_type_spec.rb
+2
-0
No files found.
app/graphql/types/ci/job_type.rb
View file @
0a320733
...
@@ -6,6 +6,8 @@ module Types
...
@@ -6,6 +6,8 @@ module Types
graphql_name
'CiJob'
graphql_name
'CiJob'
authorize
:read_commit_status
authorize
:read_commit_status
field
:id
,
GraphQL
::
ID_TYPE
,
null:
false
,
description:
'ID of the job.'
field
:pipeline
,
Types
::
Ci
::
PipelineType
,
null:
true
,
field
:pipeline
,
Types
::
Ci
::
PipelineType
,
null:
true
,
description:
'Pipeline the job belongs to.'
description:
'Pipeline the job belongs to.'
field
:name
,
GraphQL
::
STRING_TYPE
,
null:
true
,
field
:name
,
GraphQL
::
STRING_TYPE
,
null:
true
,
...
@@ -22,6 +24,8 @@ module Types
...
@@ -22,6 +24,8 @@ module Types
description:
'When a job has finished running.'
description:
'When a job has finished running.'
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
:short_sha
,
type:
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Short SHA1 ID of the commit.'
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
...
...
changelogs/unreleased/jivanvl-add-fields-to-job-type-graphql.yml
0 → 100644
View file @
0a320733
---
title
:
Add id and short_sha GraphQL fields to jobType in the CI namespace
merge_request
:
56714
author
:
type
:
changed
doc/api/graphql/reference/index.md
View file @
0a320733
...
@@ -1198,10 +1198,12 @@ An edge in a connection.
...
@@ -1198,10 +1198,12 @@ An edge in a connection.
|
`detailedStatus`
|
[
`DetailedStatus`
](
#detailedstatus
)
| Detailed status of the job. |
|
`detailedStatus`
|
[
`DetailedStatus`
](
#detailedstatus
)
| Detailed status of the job. |
|
`duration`
|
[
`Int`
](
#int
)
| Duration of the job in seconds. |
|
`duration`
|
[
`Int`
](
#int
)
| Duration of the job in seconds. |
|
`finishedAt`
|
[
`Time`
](
#time
)
| When a job has finished running. |
|
`finishedAt`
|
[
`Time`
](
#time
)
| When a job has finished running. |
|
`id`
|
[
`ID!`
](
#id
)
| ID of the job. |
|
`name`
|
[
`String`
](
#string
)
| Name of the job. |
|
`name`
|
[
`String`
](
#string
)
| Name of the job. |
|
`needs`
|
[
`CiBuildNeedConnection`
](
#cibuildneedconnection
)
| References to builds that must complete before the jobs run. |
|
`needs`
|
[
`CiBuildNeedConnection`
](
#cibuildneedconnection
)
| References to builds that must complete before the jobs run. |
|
`pipeline`
|
[
`Pipeline`
](
#pipeline
)
| Pipeline the job belongs to. |
|
`pipeline`
|
[
`Pipeline`
](
#pipeline
)
| Pipeline the job belongs to. |
|
`scheduledAt`
|
[
`Time`
](
#time
)
| Schedule for the build. |
|
`scheduledAt`
|
[
`Time`
](
#time
)
| Schedule for the build. |
|
`shortSha`
|
[
`String!`
](
#string
)
| Short SHA1 ID of the commit. |
### `CiJobArtifact`
### `CiJobArtifact`
...
...
spec/graphql/types/ci/job_type_spec.rb
View file @
0a320733
...
@@ -8,6 +8,8 @@ RSpec.describe Types::Ci::JobType do
...
@@ -8,6 +8,8 @@ RSpec.describe Types::Ci::JobType do
it
'exposes the expected fields'
do
it
'exposes the expected fields'
do
expected_fields
=
%i[
expected_fields
=
%i[
id
shortSha
pipeline
pipeline
name
name
needs
needs
...
...
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