Add connection_type to stages and jobs in ci_config_lint
What does this MR do?
This is an issue for the backend for: !49983 (merged)
We need to change the response structure for Ci::ConfigResolver
, so it can include nodes
via connection_type
. This change is needed to clean up some technical debt in how the frontend consumes data, as we currently have two different approaches for dealing the same data.
Current State:
Example query
query ($content: String!) {
ciConfig(content: $content) {
stages {
name
groups {
size
name
jobs {
name
needs {
name
}
}
}
}
}
}
{ "content": "rspec 0 1:\n stage: build\n script: \"rake spec\"\n needs: []\n\nrspec 0 2:\n stage: build\n script: \"rake spec\"\n needs: []\n\nspinach:\n stage: build\n script: \"rake spinach\"\n needs: []\n\ndocker:\n stage: test\n script: \"curl http://dockerhub/URL\"\n needs: [spinach, rspec 0 1]\n" }
Response:
{
"data": {
"ciConfig": {
"stages": [
{
"name": "build",
"groups": [
{
"size": 2,
"name": "rspec",
"jobs": [
{
"name": "rspec 0 1",
"needs": []
},
{
"name": "rspec 0 2",
"needs": []
}
]
},
{
"size": 1,
"name": "spinach",
"jobs": [
{
"name": "spinach",
"needs": []
}
]
}
]
},
{
"name": "test",
"groups": [
{
"size": 1,
"name": "docker",
"jobs": [
{
"name": "docker",
"needs": [
{
"name": "spinach"
},
{
"name": "rspec 0 1"
}
]
}
]
}
]
}
]
}
}
}
What is needed:
Example query
query ($content: String!) {
ciConfig(content: $content) {
stages {
nodes {
name
groups {
nodes {
size
name
jobs {
nodes {
name
needs {
nodes {
name
}
}
}
}
}
}
}
}
}
}
{ "content": "rspec 0 1:\n stage: build\n script: \"rake spec\"\n needs: []\n\nrspec 0 2:\n stage: build\n script: \"rake spec\"\n needs: []\n\nspinach:\n stage: build\n script: \"rake spinach\"\n needs: []\n\ndocker:\n stage: test\n script: \"curl http://dockerhub/URL\"\n needs: [spinach, rspec 0 1]\n" }
This should be the response:
{
"data": {
"ciConfig": {
"stages": {
"nodes": [
{
"name": "build",
"groups": {
"nodes": [
{
"size": 2,
"name": "rspec",
"jobs": {
"nodes": [
{
"name": "rspec 0 1",
"needs": {
"nodes": []
}
},
{
"name": "rspec 0 2",
"needs": {
"nodes": []
}
}
]
}
},
{
"size": 1,
"name": "spinach",
"jobs": {
"nodes": [
{
"name": "spinach",
"needs": {
"nodes": []
}
}
]
}
}
]
}
},
{
"name": "test",
"groups": {
"nodes": [
{
"size": 1,
"name": "docker",
"jobs": {
"nodes": [
{
"name": "docker",
"needs": {
"nodes": [
{
"name": "spinach"
},
{
"name": "rspec 0 1"
}
]
}
}
]
}
}
]
}
}
]
}
}
}
}
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.