Skip to content

Return 404 on DELETE /runners/managers

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR builds on the recently merged !118212 (merged) to make the internal endpoint return HTTP 404 if the runner machine does not exist. Previously it was returning HTTP 204. This will improve the error reporting by gitlab-runner unregister if the runner machine no longer exists.

Closes #408206 (closed)

NOTE: There is no changelog trailer because this is an internal runner endpoint.

Screenshots or screen recordings

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

How to set up and validate locally

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

  1. In the Rails console, create an instance runner to retrieve it's authentication token:

    Ci::Runners::CreateRunnerService.new(user: User.find(1), params: {runner_type: 'instance_type'}).execute.payload[:runner].token
  2. Hit the endpoint with the runner authentication token from the previous step:

    curl -X DELETE http://gdk.test:3000/api/v4/runners/managers -H 'content-type: application/json' -d '{"token":"glrt-KvdduMw11fQdFXN-Qump","system_id":"unknown_system_id"}'

You should see a 404 status code being returned, compared to a 204 success code from the master branch.

MR acceptance checklist

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

Merge request reports