List all owned runners via :admin_runners permission
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Why are we doing this work
When a user is granted a role that has the admin_members permission enabled they should be considered owners for any Ci::Runner that belongs to the group/project that their membership entitles them to.
Today, users are able to list runners if one of the following conditions is satisfied:
- They are a project maintainer. (Provides access to project runners)
- They are a group maintainer. (Provides access to all project runners in the group)
- They are a group owner. (Provides access to all group and project runners in the group hierarchy)
The addition of the following conditions should also provide access:
- They have the
:admin_runnerspermission on a project. (Provides access to project runners) - They have the
:admin_runnerspermission on a group. (Provides access the group and project runners in the group hierarchy)
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: owned_runners_via_admin_runners -
Performance: This is a performance sensitive code path that is called frequently to view the build logs. -
Testing:
Implementation plan
-
Add a GIN index to member_roles.permissionsAdd GIN index to member_roles.permissions (!161934 - merged) • mo khan • 17.3 -
Update GET /runnersto return group runners List owned runners via :admin_runners permission (!161385 - merged) • mo khan • 17.3 -
Update GET /runnersto return project runners
Verification steps
- Enable the feature flag. E.g.
Feature.enable(:custom_ability_admin_runners) - Visit any root group
- Create group runners at different levels of the group hierarchy.
- Create project runners for different projects in and outside of the chosen group hierarchy.
- Create a new role role with the base role of
Guestand the:admin_runnerspermission. - Assign the role to a new user.
- Generate a PAT for the new user.
- Make a curl request to runners API
$ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/runners" - Verify that all the expected runners are returned in the JSON response.
Edited by 🤖 GitLab Bot 🤖