Skip to content

feat(projects): add optional parameter to set approval rule on all pr…#3374

Merged
nejch merged 1 commit intopython-gitlab:mainfrom
shehzadqureshi:feat/approval-default-protect
Mar 23, 2026
Merged

feat(projects): add optional parameter to set approval rule on all pr…#3374
nejch merged 1 commit intopython-gitlab:mainfrom
shehzadqureshi:feat/approval-default-protect

Conversation

@shehzadqureshi
Copy link
Contributor

@shehzadqureshi shehzadqureshi commented Mar 19, 2026

Changes

Adds a parameter applies_to_all_protected_branches to project approval rule, that allows us to apply approval rules to all protected branches rather than enumerating the branches.

This is a documented feature in the API: https://docs.gitlab.com/api/merge_request_approvals/#create-an-approval-rule-for-a-project

Documentation and testing

I tested this by building a local docker container and executing it against my Gitlab Premium/Ultimate self-hosted service. tox tests also pass locally.

Fixes #3372

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @shehzadqureshi, looks good!

@nejch nejch enabled auto-merge (rebase) March 23, 2026 10:39
@nejch nejch force-pushed the feat/approval-default-protect branch from a1609fb to 100df00 Compare March 23, 2026 10:39
@nejch nejch merged commit 8d76028 into python-gitlab:main Mar 23, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for project approval rules applying to all default branches

2 participants