Group Push Rules API
Problem to solve
Currently, there is an API for project level push rules. Groups have no such equivalent. The feature for push rules for groups in the UI is fairly new (issue: #34370 (closed)) but didn't appear to include the development of an API.
Here's the documentation of the push rules API for projects: https://docs.gitlab.com/ee/api/projects.html#push-rules-starter
Intended users
Anybody in a group managed account that wants to script the management (create/edit/delete) of push rules for groups in the GitLab API.
Proposal
Add API functionality, and matching documentation, for creating/editing/destroying (sub)group level push rules.
-
Drop feature flag for Group Push Rule - Verification complete on staging -
Retrieve group push rules GET /groups/:id/push_rule
- Verification complete -
Add group push rules POST /groups/:id/push_rule
- Verification complete -
Edit group push rules PUT /groups/:id/push_rule
- Verification complete -
Delete group push rules DELETE /groups/:id/push_rule
- Verification complete
Further details
We have a need for push rules to be set across our namespace, however, for a temporary period of time we would like certain subgroups to be opted out of these push rules while code from a deprecating SCM is being mirrored over into GitLab. Our namespace contains several thousand projects, so doing this manually in the UI would be a poor experience.