Expose shared runner setting
What does this MR do and why?
This MR intends to address this issue: #340094 (closed)
When retrieving a group's details GET /groups/:id
using the Groups API endpoint, we have an attribute for shared_runners_setting
but it is currently not returned in the JSON response when doing a GET request. You can update the value to enabled/disabled using PUT /groups/:id
with the attribute shared_runners_setting
, but you're unable to return the current status.
In this MR, we expose the shared_runners_setting
attribute and add relevant tests to check the value in multiple scenarios.
Changelog: changed MR: !124827 (merged)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
After:
The API response(Example: http://localhost:3000/api/v4/groups/33) includes shared_runners_setting
value:
{"id":33,"web_url":"http://127.0.0.1:3000/groups/flightjs","name":"Flightjs","path":"flightjs","description":"Dolor tenetur nihil ipsum in quia nihil ut.","visibility":"public","share_with_group_lock":false,"require_two_factor_authentication":false,"two_factor_grace_period":48,"project_creation_level":"developer","auto_devops_enabled":null,"subgroup_creation_level":"maintainer","emails_disabled":null,"mentions_disabled":null,"lfs_enabled":true,"default_branch_protection":2,"avatar_url":null,"request_access_enabled":true,"full_name":"Flightjs","full_path":"flightjs","created_at":"2023-0605T12:42:13.678Z","parent_id":null,"shared_runners_setting":"disabled_and_overridable","ldap_cn":null,"ldap_access":null,"marked_for_deletion_on
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Checkout the feature branch and call the groups API endpoint: Example: http://localhost:3000/api/v4/groups/33
- Notice that the response includes
shared_runners_setting
attribute status.
Kindly note that the shared_runners_setting
attribute value changes based on the shared runners settings that are disabled/enabled for a group’s subgroups and projects.
Value | Description |
---|---|
enabled |
Enables shared runners for all projects and subgroups in this group. |
disabled_and_overridable |
Disables shared runners for all projects and subgroups in this group, but allows subgroups to override this setting. |
disabled_and_unoverridable |
Disables shared runners for all projects and subgroups in this group, and prevents subgroups from overriding this setting. |
disabled_with_override |
(Deprecated. Use disabled_and_overridable ) Disables shared runners for all projects and subgroups in this group, but allows subgroups to override this setting. |
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.