Commit 898e67f1 authored by Laura Montemayor's avatar Laura Montemayor Committed by Shinya Maeda

Adds status to jobs, stages, and groups

* Adds the specs
* Adds schema and docs
parent ac0af237
......@@ -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: false,
description: 'Path of the details for the pipeline status'
description: 'Favicon of the status'
field :details_path, GraphQL::STRING_TYPE, null: true,
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',
......
......@@ -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
......@@ -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
......@@ -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
---
title: 'GrahphQL: Adds status to jobs, stages, and groups'
merge_request: 43069
author:
type: added
......@@ -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!
}
......
......@@ -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": [
],
......@@ -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 pipeline 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 the 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
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_canceled'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_created'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_failed'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_manual'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_pending'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_preparing'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_running'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_scheduled'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_skipped'
end
def details_path
nil
end
end
end
end
......
......@@ -19,6 +19,10 @@ module Gitlab
def favicon
'favicon_status_success'
end
def details_path
nil
end
end
end
end
......
......@@ -23,6 +23,10 @@ module Gitlab
def group
'waiting-for-resource'
end
def details_path
nil
end
end
end
end
......
......@@ -10,6 +10,7 @@ RSpec.describe Types::Ci::GroupType do
name
size
jobs
detailedStatus
]
expect(described_class).to have_graphql_fields(*expected_fields)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
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