Commit 90558f87 authored by lauraMon's avatar lauraMon

Updates existing specs

* Updates schema and docs
* Adds a changelog
parent 2fcf71d0
---
title: Update ci config type for GraphQL to use connection_type
merge_request: 50160
author:
type: changed
...@@ -2291,7 +2291,27 @@ type CiConfig { ...@@ -2291,7 +2291,27 @@ type CiConfig {
""" """
Stages of the pipeline Stages of the pipeline
""" """
stages: [CiConfigStage!] stages(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String
"""
Returns the elements in the list that come before the specified cursor.
"""
before: String
"""
Returns the first _n_ elements from the list.
"""
first: Int
"""
Returns the last _n_ elements from the list.
"""
last: Int
): CiConfigStageConnection
""" """
Status of linting, can be either valid or invalid Status of linting, can be either valid or invalid
...@@ -2303,7 +2323,27 @@ type CiConfigGroup { ...@@ -2303,7 +2323,27 @@ type CiConfigGroup {
""" """
Jobs in group Jobs in group
""" """
jobs: [CiConfigJob!] jobs(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String
"""
Returns the elements in the list that come before the specified cursor.
"""
before: String
"""
Returns the first _n_ elements from the list.
"""
first: Int
"""
Returns the last _n_ elements from the list.
"""
last: Int
): CiConfigJobConnection
""" """
Name of the job group Name of the job group
...@@ -2316,6 +2356,41 @@ type CiConfigGroup { ...@@ -2316,6 +2356,41 @@ type CiConfigGroup {
size: Int size: Int
} }
"""
The connection type for CiConfigGroup.
"""
type CiConfigGroupConnection {
"""
A list of edges.
"""
edges: [CiConfigGroupEdge]
"""
A list of nodes.
"""
nodes: [CiConfigGroup]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type CiConfigGroupEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: CiConfigGroup
}
type CiConfigJob { type CiConfigJob {
""" """
Name of the job group Name of the job group
...@@ -2330,7 +2405,27 @@ type CiConfigJob { ...@@ -2330,7 +2405,27 @@ type CiConfigJob {
""" """
Builds that must complete before the jobs run Builds that must complete before the jobs run
""" """
needs: [CiConfigNeed!] needs(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String
"""
Returns the elements in the list that come before the specified cursor.
"""
before: String
"""
Returns the first _n_ elements from the list.
"""
first: Int
"""
Returns the last _n_ elements from the list.
"""
last: Int
): CiConfigNeedConnection
""" """
Name of the job stage Name of the job stage
...@@ -2338,6 +2433,41 @@ type CiConfigJob { ...@@ -2338,6 +2433,41 @@ type CiConfigJob {
stage: String stage: String
} }
"""
The connection type for CiConfigJob.
"""
type CiConfigJobConnection {
"""
A list of edges.
"""
edges: [CiConfigJobEdge]
"""
A list of nodes.
"""
nodes: [CiConfigJob]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type CiConfigJobEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: CiConfigJob
}
type CiConfigNeed { type CiConfigNeed {
""" """
Name of the need Name of the need
...@@ -2345,11 +2475,66 @@ type CiConfigNeed { ...@@ -2345,11 +2475,66 @@ type CiConfigNeed {
name: String name: String
} }
"""
The connection type for CiConfigNeed.
"""
type CiConfigNeedConnection {
"""
A list of edges.
"""
edges: [CiConfigNeedEdge]
"""
A list of nodes.
"""
nodes: [CiConfigNeed]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type CiConfigNeedEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: CiConfigNeed
}
type CiConfigStage { type CiConfigStage {
""" """
Groups of jobs for the stage Groups of jobs for the stage
""" """
groups: [CiConfigGroup!] groups(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String
"""
Returns the elements in the list that come before the specified cursor.
"""
before: String
"""
Returns the first _n_ elements from the list.
"""
first: Int
"""
Returns the last _n_ elements from the list.
"""
last: Int
): CiConfigGroupConnection
""" """
Name of the stage Name of the stage
...@@ -2357,6 +2542,41 @@ type CiConfigStage { ...@@ -2357,6 +2542,41 @@ type CiConfigStage {
name: String name: String
} }
"""
The connection type for CiConfigStage.
"""
type CiConfigStageConnection {
"""
A list of edges.
"""
edges: [CiConfigStageEdge]
"""
A list of nodes.
"""
nodes: [CiConfigStage]
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
}
"""
An edge in a connection.
"""
type CiConfigStageEdge {
"""
A cursor for use in pagination.
"""
cursor: String!
"""
The item at the end of the edge.
"""
node: CiConfigStage
}
""" """
Values for YAML processor result Values for YAML processor result
""" """
......
...@@ -381,14 +381,14 @@ Represents the total number of issues and their weights for a particular day. ...@@ -381,14 +381,14 @@ Represents the total number of issues and their weights for a particular day.
| ----- | ---- | ----------- | | ----- | ---- | ----------- |
| `errors` | String! => Array | Linting errors | | `errors` | String! => Array | Linting errors |
| `mergedYaml` | String | Merged CI config YAML | | `mergedYaml` | String | Merged CI config YAML |
| `stages` | CiConfigStage! => Array | Stages of the pipeline | | `stages` | CiConfigStageConnection | Stages of the pipeline |
| `status` | CiConfigStatus | Status of linting, can be either valid or invalid | | `status` | CiConfigStatus | Status of linting, can be either valid or invalid |
### CiConfigGroup ### CiConfigGroup
| Field | Type | Description | | Field | Type | Description |
| ----- | ---- | ----------- | | ----- | ---- | ----------- |
| `jobs` | CiConfigJob! => Array | Jobs in group | | `jobs` | CiConfigJobConnection | Jobs in group |
| `name` | String | Name of the job group | | `name` | String | Name of the job group |
| `size` | Int | Size of the job group | | `size` | Int | Size of the job group |
...@@ -398,7 +398,7 @@ Represents the total number of issues and their weights for a particular day. ...@@ -398,7 +398,7 @@ Represents the total number of issues and their weights for a particular day.
| ----- | ---- | ----------- | | ----- | ---- | ----------- |
| `groupName` | String | Name of the job group | | `groupName` | String | Name of the job group |
| `name` | String | Name of the job | | `name` | String | Name of the job |
| `needs` | CiConfigNeed! => Array | Builds that must complete before the jobs run | | `needs` | CiConfigNeedConnection | Builds that must complete before the jobs run |
| `stage` | String | Name of the job stage | | `stage` | String | Name of the job stage |
### CiConfigNeed ### CiConfigNeed
...@@ -411,7 +411,7 @@ Represents the total number of issues and their weights for a particular day. ...@@ -411,7 +411,7 @@ Represents the total number of issues and their weights for a particular day.
| Field | Type | Description | | Field | Type | Description |
| ----- | ---- | ----------- | | ----- | ---- | ----------- |
| `groups` | CiConfigGroup! => Array | Groups of jobs for the stage | | `groups` | CiConfigGroupConnection | Groups of jobs for the stage |
| `name` | String | Name of the stage | | `name` | String | Name of the stage |
### CiGroup ### CiGroup
......
...@@ -20,15 +20,19 @@ RSpec.describe 'Query.ciConfig' do ...@@ -20,15 +20,19 @@ RSpec.describe 'Query.ciConfig' do
status status
errors errors
stages { stages {
nodes {
name name
groups { groups {
nodes {
name name
size size
jobs { jobs {
nodes {
name name
groupName groupName
stage stage
needs { needs {
nodes {
name name
} }
} }
...@@ -36,6 +40,10 @@ RSpec.describe 'Query.ciConfig' do ...@@ -36,6 +40,10 @@ RSpec.describe 'Query.ciConfig' do
} }
} }
} }
}
}
}
}
) )
end end
...@@ -50,42 +58,60 @@ RSpec.describe 'Query.ciConfig' do ...@@ -50,42 +58,60 @@ RSpec.describe 'Query.ciConfig' do
"status" => "VALID", "status" => "VALID",
"errors" => [], "errors" => [],
"stages" => "stages" =>
{
"nodes" =>
[ [
{ {
"name" => "build", "name" => "build",
"groups" => "groups" =>
{
"nodes" =>
[ [
{ {
"name" => "rspec", "name" => "rspec",
"size" => 2, "size" => 2,
"jobs" => "jobs" =>
{
"nodes" =>
[ [
{ "name" => "rspec 0 1", "groupName" => "rspec", "stage" => "build", "needs" => [] }, { "name" => "rspec 0 1", "groupName" => "rspec", "stage" => "build", "needs" => { "nodes" => [] } },
{ "name" => "rspec 0 2", "groupName" => "rspec", "stage" => "build", "needs" => [] } { "name" => "rspec 0 2", "groupName" => "rspec", "stage" => "build", "needs" => { "nodes" => [] } }
] ]
}
}, },
{ {
"name" => "spinach", "size" => 1, "jobs" => "name" => "spinach", "size" => 1, "jobs" =>
{
"nodes" =>
[ [
{ "name" => "spinach", "groupName" => "spinach", "stage" => "build", "needs" => [] } { "name" => "spinach", "groupName" => "spinach", "stage" => "build", "needs" => { "nodes" => [] } }
] ]
} }
}
] ]
}
}, },
{ {
"name" => "test", "name" => "test",
"groups" => "groups" =>
{
"nodes" =>
[ [
{ {
"name" => "docker", "name" => "docker",
"size" => 1, "size" => 1,
"jobs" => [ "jobs" =>
{ "name" => "docker", "groupName" => "docker", "stage" => "test", "needs" => [{ "name" => "spinach" }, { "name" => "rspec 0 1" }] } {
"nodes" => [
{ "name" => "docker", "groupName" => "docker", "stage" => "test", "needs" => { "nodes" => [{ "name" => "spinach" }, { "name" => "rspec 0 1" }] } }
] ]
} }
}
] ]
} }
}
] ]
}
) )
end end
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