Runner Controller scoping - External REST API
Overview
Implement the external REST API endpoints for managing Runner Controller scopings.
Context
Runner Controllers function like a "service":
- Can have any and multiple types of scope (cell, group, project, runner)
- Created without scope has no effect
- Has an
enabledstate - Scopes always apply "downward"
- Scopes on a "disabled" controller do not have effect
This issue covers the API to manage those scopings after the database schema is in place.
We should implement a Service to add the scopings. This service should also make sure that the invariants are correct, for example, a runner controller can only have a single instance scoping while having no other scopings. Trying to set up a conflicting scoping fails when creating it
Scope
In Scope ✅
- REST API endpoints for instance scoping CRUD
- REST API endpoints for runner scoping CRUD
- Proper authorization/permissions
- API documentation
API Endpoints
GET /api/v4/runner_controllers/:id/scopes
POST /api/v4/runner_controllers/:id/scopes/instance
DELETE /api/v4/runner_controllers/:id/scopes/instance/:scoping_id
POST /api/v4/runner_controllers/:id/scopes/runners
DELETE /api/v4/runner_controllers/:id/scopes/runners/:scoping_id
# Alternatively also: (which would take the type as a parameter when creating one.
GET /api/v4/runner_controllers/:id/scopes
POST /api/v4/runner_controllers/:id/scopes
DELETE /api/v4/runner_controllers/:id/scopes/:scoping_id
Acceptance Criteria
- Instance scoping endpoints implemented
- Runner scoping endpoints implemented
- Authorization checks in place
- API documentation updated
Edited by Timo Furrer