Skip to content

Return runner webUrl via GraphQL API (via edge)

What does this MR do and why?

This change adds the web URLs of a runner to the GraphQL API. The URL will vary according to the usage of the API in a Group or Project.

Note: This is the first time one of the edges in the GrahQL API is used for domain data, see !70700 (merged) for how the client can consume this.

Screenshots or screen recordings

Screen_Shot_2021-09-20_at_3.55.13_PM

How to set up and validate locally

  1. Have runners registered to a group (https://docs.gitlab.com/runner/register/)
  2. Send a GraphQL request (easy from the GraphQL Explorer UI http://gdk.test:3000/-/graphql-explorer)
  3. Use one of the queries above
Expanded query
fragment RunnerNode on CiRunner {
  id
  description
  runnerType
  shortSha
  version
  revision
  ipAddress
  active
  locked
  tagList
  contactedAt
  jobCount
  projectCount
}

fragment PageInfo on PageInfo {
  hasNextPage
  hasPreviousPage
  startCursor
  endCursor
}

query getGroupRunners(
  $groupFullPath: ID!
  $before: String
  $after: String
  $first: Int
  $last: Int
  $status: CiRunnerStatus
  $type: CiRunnerType
  $search: String
  $sort: CiRunnerSort
) {
  group(fullPath: $groupFullPath) {
    runners(
      membership: DESCENDANTS
      before: $before
      after: $after
      first: $first
      last: $last
      status: $status
      type: $type
      search: $search
      sort: $sort
    ) {
      edges {
        webUrl
        node {
          ...RunnerNode
          adminUrl
        }
      }
      pageInfo {
        ...PageInfo
      }
    }
  }
}
{
  "first": 20,
  "groupFullPath": "h5bp"
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #333800 (closed)

Edited by Miguel Rincon

Merge request reports