Skip to content

Change type of CiJob.needs [RUN AS-IF-FOSS]

Alex Kalderimis requested to merge ajk-ci-job-needs-type into master

What does this MR do?

This fixes a ~bug in our GraphQL schema where CiJob.needs has the incorrect type JobType.connection_type.

The return value of Build#needs is not a relation of builds, but a relation of Ci::BuildNeed, which shares the attribute name, but no other valid values.

Fixes: #294058 (closed) Addresses: https://gitlab.com/gitlab-org/gitlab/-/issues/294217

Note that this is not a breaking change because the following query will continue to work:

query {
  project(fullPath: "gitlab-org/gitlab") {
    mergeRequest(iid: "123") {
      headPipeline {
        jobs {
          nodes {
            needs {
              nodes {
                name
              }
            }
          }
        }
      }
    }
  }
}

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Alex Kalderimis

Merge request reports

Loading