API to retrieve group push rules
What does this MR do?
Adds api to retrieve group's push rules, similar to the one for projects.
The api is available for group owners and admins in GitLab starter/bronze and higher tiers.
The other CRUD apis will be added in subsequent MRs.
Request api: https://<gitlab-url>/api/v4/groups/<group-id>/push_rule
Sample response:
{
"id": 2,
"created_at": "2020-08-17T19:09:19.580Z",
"commit_message_regex": "[a-zA-Z]",
"commit_message_negative_regex": "[x+]",
"branch_name_regex": "[a-z]",
"deny_delete_tag": true,
"member_check": true,
"prevent_secrets": true,
"author_email_regex": "^[A-Za-z0-9.]+@gitlab.com$",
"file_name_regex": "(exe)$",
"max_file_size": 100
}
Note: The issue also includes changes to remove the existing FF for the Group Push rules feature: group_push_rules
. This MR (and the other CRUD apis) therefore only check for license availability. The FF removal will be implemented in a separate MR.
Mentions #224129 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team