Skip to content

Draft: [CI] Adds CiJob.trace field

Alex Kalderimis requested to merge ajk-graphql-ci-trace into master

What does this MR do?

This MR adds a new field to the CiJob GraphQL type: CiJob.trace, which provides access to build traces.

This feature is available via the REST API, and this featureaddition brings the GraphQL API up to parity, and more, since this type is capable of accessing the pre-parsed build-sections, which is a much more powerful API.

Considering the cost of accessing build traces, this field is given a high complexity.

Example Query

query($path: ID!, $name: String) {
  project(fullPath: $path) {
    pipelines(first: 1) {
      nodes {
        jobs {
          nodes {
            name
            duration
            trace { raw(tail: 25) }
          }
        }
      }
    }
  }
}

Ideally we don't want to encourage fetching lots of traces at a time like this. For that reason, the complexity is high, and we set the tail argument to a conservative value by default.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

This MR exposes build traces, which may contain potentially sensitive information. This feature is guarded by the appropriate ability check of read_build_report_results

  • 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