Skip to content

Updates graphql linter implementation

Laura Montemayor requested to merge lm-add-new-jobs-fields-graphql into master

What does this MR do?

Example Query
query ($content: String!, $projectPath:ID!) {
  ciConfig(content: $content, projectPath: $projectPath) {
    stages {
      nodes {
        name
        groups {
          nodes {
            size
            name
            jobs {
              nodes {
                name
                allowFailure
                environment
                script
                afterScript
                beforeScript
                tags
                only {
                   refs
                }
                when
                except {
                   refs
                }
                needs {
                  nodes {
                    name
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
Response
{
  "data": {
    "ciConfig": {
      "stages": {
        "nodes": [
          {
            "name": "build",
            "groups": {
              "nodes": [
                {
                  "size": 2,
                  "name": "rspec",
                  "jobs": {
                    "nodes": [
                      {
                        "name": "rspec 0 1",
                        "allowFailure": false,
                        "environment": null,
                        "script": [
                          "rake spec"
                        ],
                        "afterScript": [
                          "echo 'run this after'"
                        ],
                        "beforeScript": [
                          "bundle install",
                          "bundle exec rake db:create"
                        ],
                        "tags": "[\"ruby\", \"postgres\"]",
                        "only": "[\"branches\"]",
                        "when": "on_success",
                        "except": null,
                        "needs": {
                          "nodes": []
                        }
                      },
                      {
                        "name": "rspec 0 2",
                        "allowFailure": true,
                        "environment": null,
                        "script": [
                          "rake spec"
                        ],
                        "afterScript": [
                          "echo 'run this after'"
                        ],
                        "beforeScript": [
                          "bundle install",
                          "bundle exec rake db:create"
                        ],
                        "tags": "[]",
                        "only": "[\"branches\", \"tags\"]",
                        "when": "on_failure",
                        "except": null,
                        "needs": {
                          "nodes": []
                        }
                      }
                    ]
                  }
                },
                {
                  "size": 1,
                  "name": "spinach",
                  "jobs": {
                    "nodes": [
                      {
                        "name": "spinach",
                        "allowFailure": false,
                        "environment": null,
                        "script": [
                          "rake spinach"
                        ],
                        "afterScript": [
                          "echo 'run this after'"
                        ],
                        "beforeScript": [
                          "bundle install",
                          "bundle exec rake db:create"
                        ],
                        "tags": "[]",
                        "only": "[\"branches\", \"tags\"]",
                        "when": "on_success",
                        "except": "[\"tags\"]",
                        "needs": {
                          "nodes": []
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "name": "test",
            "groups": {
              "nodes": [
                {
                  "size": 1,
                  "name": "docker",
                  "jobs": {
                    "nodes": [
                      {
                        "name": "docker",
                        "allowFailure": true,
                        "environment": null,
                        "script": [
                          "curl http://dockerhub/URL"
                        ],
                        "afterScript": [
                          "echo 'run this after'"
                        ],
                        "beforeScript": [
                          "bundle install",
                          "bundle exec rake db:create"
                        ],
                        "tags": "[]",
                        "only": "[\"branches\", \"tags\"]",
                        "when": "manual",
                        "except": "[\"branches\"]",
                        "needs": {
                          "nodes": [
                            {
                              "name": "spinach"
                            },
                            {
                              "name": "rspec 0 1"
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            }
          },
          {
            "name": "deploy",
            "groups": {
              "nodes": [
                {
                  "size": 1,
                  "name": "deploy_job",
                  "jobs": {
                    "nodes": [
                      {
                        "name": "deploy_job",
                        "allowFailure": false,
                        "environment": "production",
                        "script": [
                          "echo 'done'"
                        ],
                        "afterScript": [
                          "echo 'run this after'"
                        ],
                        "beforeScript": [
                          "bundle install",
                          "bundle exec rake db:create"
                        ],
                        "tags": "[]",
                        "only": "[\"branches\", \"tags\"]",
                        "when": "on_success",
                        "except": null,
                        "needs": {
                          "nodes": []
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Does this MR meet the acceptance criteria?

Conformity

#290048 (closed)

Edited by Laura Montemayor

Merge request reports

Loading