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
How to set up and validate locally
- Have runners registered to a group (https://docs.gitlab.com/runner/register/)
- Send a GraphQL request (easy from the GraphQL Explorer UI http://gdk.test:3000/-/graphql-explorer)
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #333800 (closed)
Edited by Miguel Rincon