Skip to content

Account for inherited runners in RunnerPolicy

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR extends the :read_runner runner policy rule so that it is enabled also for runners that are inherited by a user (i.e. runners that the user should be able to view when in the group runners admin view). An example:

The user is the owner of group, which is set up to use shared runners. Without this MR, querying for user.can?(:read_runner, instance_runner) would return false. With this change, as long as user is an owner of group, user.can?(:read_runner, instance_runner) will return true.

This logic is required for !96770 (merged) (see !96770 (comment 1088883167)).

Part of Group runners should display all runners availa... (#337838 - closed)

Screenshots or screen recordings

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

This MR fixes the scenario in the bottom-right of the picture (instance runners should be listed there in addition to the runners from descendant scopes):

DESCENDANTS ALL
root user image image
group owner image image

How to set up and validate locally

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

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