Skip to content

Return token and ID information from /runners/verify REST endpoint

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR changes the return type of the POST /runners/verify endpoint so that the response body includes some information required to fill the appropriate entry in the GitLab Runner's config.toml configuration file. The supporting runner-side MR is gitlab-runner!3923 (merged).

Closes #391383 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. In the GDK console, create a runner:

    Ci::Runners::CreateRunnerService.new(user: User.find(1), type: nil, params: {}).execute.payload[:runner].token
  2. With the returned runner token, execute the following REST request:

    curl -v -X POST http://gdk.test:3000/api/v4/runners/verify -H 'content-type: application/json' -H 'accept: application/json, */*;q=0.5' -d '{"token":"glrt-aALfzrMFk8J7GdYAyt9K"}'

You should get A JSON object back that includes the new runner's ID.

MR acceptance checklist

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

Edited by Pedro Pombeiro

Merge request reports

Loading