Skip to content

API to retrieve group push rules

Aishwarya Subramanian requested to merge list-group-push-rules into master

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

Availability and Testing

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
Edited by Aishwarya Subramanian

Merge request reports