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
898e67f1
Commit
898e67f1
authored
Oct 13, 2020
by
Laura Montemayor
Committed by
Shinya Maeda
Oct 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds status to jobs, stages, and groups
* Adds the specs * Adds schema and docs
parent
ac0af237
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
198 additions
and
41 deletions
+198
-41
app/graphql/types/ci/detailed_status_type.rb
app/graphql/types/ci/detailed_status_type.rb
+9
-9
app/graphql/types/ci/group_type.rb
app/graphql/types/ci/group_type.rb
+3
-0
app/graphql/types/ci/job_type.rb
app/graphql/types/ci/job_type.rb
+3
-0
app/graphql/types/ci/stage_type.rb
app/graphql/types/ci/stage_type.rb
+3
-0
changelogs/unreleased/lm-add-status-graphql.yml
changelogs/unreleased/lm-add-status-graphql.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+24
-9
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+53
-15
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+11
-8
lib/gitlab/ci/status/canceled.rb
lib/gitlab/ci/status/canceled.rb
+4
-0
lib/gitlab/ci/status/created.rb
lib/gitlab/ci/status/created.rb
+4
-0
lib/gitlab/ci/status/failed.rb
lib/gitlab/ci/status/failed.rb
+4
-0
lib/gitlab/ci/status/manual.rb
lib/gitlab/ci/status/manual.rb
+4
-0
lib/gitlab/ci/status/pending.rb
lib/gitlab/ci/status/pending.rb
+4
-0
lib/gitlab/ci/status/preparing.rb
lib/gitlab/ci/status/preparing.rb
+4
-0
lib/gitlab/ci/status/running.rb
lib/gitlab/ci/status/running.rb
+4
-0
lib/gitlab/ci/status/scheduled.rb
lib/gitlab/ci/status/scheduled.rb
+4
-0
lib/gitlab/ci/status/skipped.rb
lib/gitlab/ci/status/skipped.rb
+4
-0
lib/gitlab/ci/status/success.rb
lib/gitlab/ci/status/success.rb
+4
-0
lib/gitlab/ci/status/waiting_for_resource.rb
lib/gitlab/ci/status/waiting_for_resource.rb
+4
-0
spec/graphql/types/ci/group_type_spec.rb
spec/graphql/types/ci/group_type_spec.rb
+1
-0
spec/graphql/types/ci/job_type_spec.rb
spec/graphql/types/ci/job_type_spec.rb
+1
-0
spec/graphql/types/ci/stage_type_spec.rb
spec/graphql/types/ci/stage_type_spec.rb
+1
-0
spec/lib/gitlab/ci/status/canceled_spec.rb
spec/lib/gitlab/ci/status/canceled_spec.rb
+4
-0
spec/lib/gitlab/ci/status/created_spec.rb
spec/lib/gitlab/ci/status/created_spec.rb
+4
-0
spec/lib/gitlab/ci/status/failed_spec.rb
spec/lib/gitlab/ci/status/failed_spec.rb
+4
-0
spec/lib/gitlab/ci/status/pending_spec.rb
spec/lib/gitlab/ci/status/pending_spec.rb
+4
-0
spec/lib/gitlab/ci/status/preparing_spec.rb
spec/lib/gitlab/ci/status/preparing_spec.rb
+4
-0
spec/lib/gitlab/ci/status/running_spec.rb
spec/lib/gitlab/ci/status/running_spec.rb
+4
-0
spec/lib/gitlab/ci/status/scheduled_spec.rb
spec/lib/gitlab/ci/status/scheduled_spec.rb
+4
-0
spec/lib/gitlab/ci/status/skipped_spec.rb
spec/lib/gitlab/ci/status/skipped_spec.rb
+4
-0
spec/lib/gitlab/ci/status/success_spec.rb
spec/lib/gitlab/ci/status/success_spec.rb
+4
-0
spec/lib/gitlab/ci/status/waiting_for_resource_spec.rb
spec/lib/gitlab/ci/status/waiting_for_resource_spec.rb
+4
-0
No files found.
app/graphql/types/ci/detailed_status_type.rb
View file @
898e67f1
...
...
@@ -7,22 +7,22 @@ module Types
graphql_name
'DetailedStatus'
field
:group
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Group of the
pipeline
status'
description:
'Group of the status'
field
:icon
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Icon of the
pipeline
status'
description:
'Icon of the status'
field
:favicon
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Favicon of the
pipeline
status'
field
:details_path
,
GraphQL
::
STRING_TYPE
,
null:
fals
e
,
description:
'Path of the details for the
pipeline
status'
description:
'Favicon of the status'
field
:details_path
,
GraphQL
::
STRING_TYPE
,
null:
tru
e
,
description:
'Path of the details for the status'
field
:has_details
,
GraphQL
::
BOOLEAN_TYPE
,
null:
false
,
description:
'Indicates if the
pipeline
status has further details'
,
description:
'Indicates if the status has further details'
,
method: :has_details?
field
:label
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Label of the
pipeline
status'
description:
'Label of the status'
field
:text
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Text of the
pipeline
status'
description:
'Text of the status'
field
:tooltip
,
GraphQL
::
STRING_TYPE
,
null:
false
,
description:
'Tooltip associated with the
pipeline
status'
,
description:
'Tooltip associated with the status'
,
method: :status_tooltip
field
:action
,
Types
::
Ci
::
StatusActionType
,
null:
true
,
description:
'Action information for the status. This includes method, button title, icon, path, and title'
,
...
...
app/graphql/types/ci/group_type.rb
View file @
898e67f1
...
...
@@ -12,6 +12,9 @@ module Types
description:
'Size of the group'
field
:jobs
,
Ci
::
JobType
.
connection_type
,
null:
true
,
description:
'Jobs in group'
field
:detailed_status
,
Types
::
Ci
::
DetailedStatusType
,
null:
true
,
description:
'Detailed status of the group'
,
resolve:
->
(
obj
,
_args
,
ctx
)
{
obj
.
detailed_status
(
ctx
[
:current_user
])
}
end
end
end
app/graphql/types/ci/job_type.rb
View file @
898e67f1
...
...
@@ -10,6 +10,9 @@ module Types
description:
'Name of the job'
field
:needs
,
JobType
.
connection_type
,
null:
true
,
description:
'Builds that must complete before the jobs run'
field
:detailed_status
,
Types
::
Ci
::
DetailedStatusType
,
null:
true
,
description:
'Detailed status of the job'
,
resolve:
->
(
obj
,
_args
,
ctx
)
{
obj
.
detailed_status
(
ctx
[
:current_user
])
}
end
end
end
app/graphql/types/ci/stage_type.rb
View file @
898e67f1
...
...
@@ -10,6 +10,9 @@ module Types
description:
'Name of the stage'
field
:groups
,
Ci
::
GroupType
.
connection_type
,
null:
true
,
description:
'Group of jobs for the stage'
field
:detailed_status
,
Types
::
Ci
::
DetailedStatusType
,
null:
true
,
description:
'Detailed status of the stage'
,
resolve:
->
(
obj
,
_args
,
ctx
)
{
obj
.
detailed_status
(
ctx
[
:current_user
])
}
end
end
end
changelogs/unreleased/lm-add-status-graphql.yml
0 → 100644
View file @
898e67f1
---
title
:
'
GrahphQL:
Adds
status
to
jobs,
stages,
and
groups'
merge_request
:
43069
author
:
type
:
added
doc/api/graphql/reference/gitlab_schema.graphql
View file @
898e67f1
...
...
@@ -2000,6 +2000,11 @@ type BurnupChartDailyTotals {
}
type
CiGroup
{
"""
Detailed
status
of
the
group
"""
detailedStatus
:
DetailedStatus
"""
Jobs
in
group
"""
...
...
@@ -2072,6 +2077,11 @@ type CiGroupEdge {
}
type
CiJob
{
"""
Detailed
status
of
the
job
"""
detailedStatus
:
DetailedStatus
"""
Name
of
the
job
"""
...
...
@@ -2144,6 +2154,11 @@ Identifier of Ci::Pipeline
scalar
CiPipelineID
type
CiStage
{
"""
Detailed
status
of
the
stage
"""
detailedStatus
:
DetailedStatus
"""
Group
of
jobs
for
the
stage
"""
...
...
@@ -5215,42 +5230,42 @@ type DetailedStatus {
action
:
StatusAction
"""
Path
of
the
details
for
the
pipeline
status
Path
of
the
details
for
the
status
"""
detailsPath
:
String
!
detailsPath
:
String
"""
Favicon
of
the
pipeline
status
Favicon
of
the
status
"""
favicon
:
String
!
"""
Group
of
the
pipeline
status
Group
of
the
status
"""
group
:
String
!
"""
Indicates
if
the
pipeline
status
has
further
details
Indicates
if
the
status
has
further
details
"""
hasDetails
:
Boolean
!
"""
Icon
of
the
pipeline
status
Icon
of
the
status
"""
icon
:
String
!
"""
Label
of
the
pipeline
status
Label
of
the
status
"""
label
:
String
!
"""
Text
of
the
pipeline
status
Text
of
the
status
"""
text
:
String
!
"""
Tooltip
associated
with
the
pipeline
status
Tooltip
associated
with
the
status
"""
tooltip
:
String
!
}
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
898e67f1
...
...
@@ -5343,6 +5343,20 @@
"name": "CiGroup",
"description": null,
"fields": [
{
"name": "detailedStatus",
"description": "Detailed status of the group",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "DetailedStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "jobs",
"description": "Jobs in group",
...
...
@@ -5549,6 +5563,20 @@
"name": "CiJob",
"description": null,
"fields": [
{
"name": "detailedStatus",
"description": "Detailed status of the job",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "DetailedStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "name",
"description": "Name of the job",
...
...
@@ -5751,6 +5779,20 @@
"name": "CiStage",
"description": null,
"fields": [
{
"name": "detailedStatus",
"description": "Detailed status of the stage",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "DetailedStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "groups",
"description": "Group of jobs for the stage",
...
...
@@ -14279,25 +14321,21 @@
},
{
"name": "detailsPath",
"description": "Path of the details for the
pipeline
status",
"description": "Path of the details for the status",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "favicon",
"description": "Favicon of the
pipeline
status",
"description": "Favicon of the status",
"args": [
],
...
...
@@ -14315,7 +14353,7 @@
},
{
"name": "group",
"description": "Group of the
pipeline
status",
"description": "Group of the status",
"args": [
],
...
...
@@ -14333,7 +14371,7 @@
},
{
"name": "hasDetails",
"description": "Indicates if the
pipeline
status has further details",
"description": "Indicates if the status has further details",
"args": [
],
...
...
@@ -14351,7 +14389,7 @@
},
{
"name": "icon",
"description": "Icon of the
pipeline
status",
"description": "Icon of the status",
"args": [
],
...
...
@@ -14369,7 +14407,7 @@
},
{
"name": "label",
"description": "Label of the
pipeline
status",
"description": "Label of the status",
"args": [
],
...
...
@@ -14387,7 +14425,7 @@
},
{
"name": "text",
"description": "Text of the
pipeline
status",
"description": "Text of the status",
"args": [
],
...
...
@@ -14405,7 +14443,7 @@
},
{
"name": "tooltip",
"description": "Tooltip associated with the
pipeline
status",
"description": "Tooltip associated with the status",
"args": [
],
doc/api/graphql/reference/index.md
View file @
898e67f1
...
...
@@ -323,6 +323,7 @@ Represents the total number of issues and their weights for a particular day.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`detailedStatus`
| DetailedStatus | Detailed status of the group |
|
`name`
| String | Name of the job group |
|
`size`
| Int | Size of the group |
...
...
@@ -330,12 +331,14 @@ Represents the total number of issues and their weights for a particular day.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`detailedStatus`
| DetailedStatus | Detailed status of the job |
|
`name`
| String | Name of the job |
### CiStage
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`detailedStatus`
| DetailedStatus | Detailed status of the stage |
|
`name`
| String | Name of the stage |
### ClusterAgent
...
...
@@ -840,14 +843,14 @@ Autogenerated return type of DestroySnippet.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`action`
| StatusAction | Action information for the status. This includes method, button title, icon, path, and title |
|
`detailsPath`
| String
! | Path of the details for the pipelin
e status |
|
`favicon`
| String! | Favicon of the
pipeline
status |
|
`group`
| String! | Group of the
pipeline
status |
|
`hasDetails`
| Boolean! | Indicates if the
pipeline
status has further details |
|
`icon`
| String! | Icon of the
pipeline
status |
|
`label`
| String! | Label of the
pipeline
status |
|
`text`
| String! | Text of the
pipeline
status |
|
`tooltip`
| String! | Tooltip associated with the
pipeline
status |
|
`detailsPath`
| String
| Path of the details for th
e status |
|
`favicon`
| String! | Favicon of the status |
|
`group`
| String! | Group of the status |
|
`hasDetails`
| Boolean! | Indicates if the status has further details |
|
`icon`
| String! | Icon of the status |
|
`label`
| String! | Label of the status |
|
`text`
| String! | Text of the status |
|
`tooltip`
| String! | Tooltip associated with the status |
### DiffPosition
...
...
lib/gitlab/ci/status/canceled.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_canceled'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/created.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_created'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/failed.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_failed'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/manual.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_manual'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/pending.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_pending'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/preparing.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_preparing'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/running.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_running'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/scheduled.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_scheduled'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/skipped.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_skipped'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/success.rb
View file @
898e67f1
...
...
@@ -19,6 +19,10 @@ module Gitlab
def
favicon
'favicon_status_success'
end
def
details_path
nil
end
end
end
end
...
...
lib/gitlab/ci/status/waiting_for_resource.rb
View file @
898e67f1
...
...
@@ -23,6 +23,10 @@ module Gitlab
def
group
'waiting-for-resource'
end
def
details_path
nil
end
end
end
end
...
...
spec/graphql/types/ci/group_type_spec.rb
View file @
898e67f1
...
...
@@ -10,6 +10,7 @@ RSpec.describe Types::Ci::GroupType do
name
size
jobs
detailedStatus
]
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
...
...
spec/graphql/types/ci/job_type_spec.rb
View file @
898e67f1
...
...
@@ -9,6 +9,7 @@ RSpec.describe Types::Ci::JobType do
expected_fields
=
%i[
name
needs
detailedStatus
]
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
...
...
spec/graphql/types/ci/stage_type_spec.rb
View file @
898e67f1
...
...
@@ -9,6 +9,7 @@ RSpec.describe Types::Ci::StageType do
expected_fields
=
%i[
name
groups
detailedStatus
]
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
...
...
spec/lib/gitlab/ci/status/canceled_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Canceled do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'canceled'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/created_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Created do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'created'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/failed_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Failed do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'failed'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/pending_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Pending do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'pending'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/preparing_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Preparing do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'preparing'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/running_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Running do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'running'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/scheduled_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Scheduled do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'scheduled'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/skipped_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Skipped do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'skipped'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/success_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::Success do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'success'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
spec/lib/gitlab/ci/status/waiting_for_resource_spec.rb
View file @
898e67f1
...
...
@@ -26,4 +26,8 @@ RSpec.describe Gitlab::Ci::Status::WaitingForResource do
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'waiting-for-resource'
}
end
describe
'#details_path'
do
it
{
expect
(
subject
.
details_path
).
to
be_nil
}
end
end
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