You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Merge request approval setting is not working #2071
@idwagner I think you're right, some time ago one of the methods was updated to match the v4 API (#1005) but not for this one. It seems like this endpoint has been long gone in GitLab's API so we should remove it or change it.
I verified that this should be approvalrules and not approval_rules. According to the documentation if you try this it will fail because its hitting ProjectApprovalManager.set_approvers:
How do you do this if your trying to write something that only modifies a project level merge request approver rule. We have rules for merging to master and I need to update them across hundreds of projects. Is it not possible? I don't see an example in the docs for project user id changes.
How do you do this if your trying to write something that only modifies a project level merge request approver rule. We have rules for merging to master and I need to update them across hundreds of projects. Is it not possible? I don't see an example in the docs for project user id changes.
You can't see because there isn't. I don't know why they have implemented this and stay in Epic for years. So you MUST apply for each project individually.
Message from Gitlab support Team "This feature is actually being tracked in a larger epic that can be found here: https://gitlab.com/groups/gitlab-org/-/epics/4367. It expresses much of the same frustration and difficulty associated with managing this setting on a project by project basis. I know this may not be the most ideal solution since it would/will requires waiting for the feature to be implemented. Alternatively you could utilize the Merge request approvals API to programmatically create these project-level rules as available in the API documentation: https://docs.gitlab.com/ee/api/merge_request_approvals.html#create-project-level-rule."
I verified that this should be approvalrules and not approval_rules. According to the documentation if you try this it will fail because its hitting ProjectApprovalManager.set_approvers:
This issue was marked stale because it has been open 60 days with
no activity. Please remove the stale label or comment on this
issue. Otherwise, it will be closed in 15 days.
As an open-source project, we rely on community contributions to
address many of the reported issues. Without a proposed fix or
active work towards a solution it is our policy to close inactive
issues. This is documented in CONTRIBUTING.rst
How to keep this issue open:
If you are still experiencing this issue and are willing to
investigate a fix, please comment and let us know.
If you (or someone else) can propose a pull request with a
solution, that would be fantastic.
Any significant update or active discussion indicating progress
will also prevent closure.
We value your input. If you can help provide a fix, we'd be happy
to keep this issue open and support your efforts.
This issue was closed because it has been marked stale for 15 days
with no activity.
This open-source project relies on community contributions, and
while we value all feedback, we have a limited capacity to address
every issue without a clear path forward.
Currently, this issue hasn't received a proposed fix, and there
hasn't been recent active discussion indicating someone is planning
to work on it. To maintain a manageable backlog and focus our
efforts, we will be closing this issue for now.
This doesn't mean the issue isn't valid or important. If you or
anyone else in the community is willing to investigate and propose
a solution (e.g., by submitting a pull request), please do.
We believe that those who feel a bug is important enough to fix
should ideally be part of the solution. Your contributions are
highly welcome.
Thank you for your understanding and potential future
contributions.
Activity
idwagner commentedon Aug 30, 2022
@naragani I think what you are looking for is project.approvalrules for approval rules.
I think ProjectApprovalManager.set_approvers may be a bug, as I can't find any reference to the api path
/projects/:id/approversin the Gitlab docs.nejch commentedon Aug 30, 2022
@idwagner I think you're right, some time ago one of the methods was updated to match the v4 API (#1005) but not for this one. It seems like this endpoint has been long gone in GitLab's API so we should remove it or change it.
nightHawk13998 commentedon Oct 24, 2022
I verified that this should be approvalrules and not approval_rules. According to the documentation if you try this it will fail because its hitting ProjectApprovalManager.set_approvers:
But this works correctly and will create the MR approval rule:
crizzs commentedon Feb 15, 2023
i am also having issues with setting merge approvals.
nejch commentedon Feb 15, 2023
@crizzs if you read through this thread you'll see you can use
mr.approvalrules.create()instead. We should update our docs a bit probably.jurschel commentedon Mar 13, 2023
How do you do this if your trying to write something that only modifies a project level merge request approver rule. We have rules for merging to master and I need to update them across hundreds of projects. Is it not possible? I don't see an example in the docs for project user id changes.
aamarques commentedon Nov 14, 2023
You can't see because there isn't. I don't know why they have implemented this and stay in Epic for years. So you MUST apply for each project individually.
Message from Gitlab support Team
"This feature is actually being tracked in a larger epic that can be found here: https://gitlab.com/groups/gitlab-org/-/epics/4367. It expresses much of the same frustration and difficulty associated with managing this setting on a project by project basis. I know this may not be the most ideal solution since it would/will requires waiting for the feature to be implemented. Alternatively you could utilize the Merge request approvals API to programmatically create these project-level rules as available in the API documentation: https://docs.gitlab.com/ee/api/merge_request_approvals.html#create-project-level-rule."
aamarques commentedon Nov 14, 2023
Ok, but how to do it only for project-level rule ?
I tried without success. :(
kalavt commentedon Apr 17, 2025
any update on this?
I can see there's only ProjectMergeRequestApprovalManager.set_approvers method
but no ProjectApprovalManager.set_approvers
hence there's no way to update project level merge request approval rules.
kalavt commentedon Apr 17, 2025
Oh, sorry, there do have a workaround, call the gitlab API directly
github-actions commentedon Jul 9, 2025
This issue was marked stale because it has been open 60 days with
no activity. Please remove the stale label or comment on this
issue. Otherwise, it will be closed in 15 days.
As an open-source project, we rely on community contributions to
address many of the reported issues. Without a proposed fix or
active work towards a solution it is our policy to close inactive
issues. This is documented in CONTRIBUTING.rst
How to keep this issue open:
investigate a fix, please comment and let us know.
solution, that would be fantastic.
will also prevent closure.
We value your input. If you can help provide a fix, we'd be happy
to keep this issue open and support your efforts.
This is documented in CONTRIBUTING.rst
https://github.com/python-gitlab/python-gitlab/blob/main/CONTRIBUTING.rst
github-actions commentedon Jul 24, 2025
This issue was closed because it has been marked stale for 15 days
with no activity.
This open-source project relies on community contributions, and
while we value all feedback, we have a limited capacity to address
every issue without a clear path forward.
Currently, this issue hasn't received a proposed fix, and there
hasn't been recent active discussion indicating someone is planning
to work on it. To maintain a manageable backlog and focus our
efforts, we will be closing this issue for now.
This doesn't mean the issue isn't valid or important. If you or
anyone else in the community is willing to investigate and propose
a solution (e.g., by submitting a pull request), please do.
We believe that those who feel a bug is important enough to fix
should ideally be part of the solution. Your contributions are
highly welcome.
Thank you for your understanding and potential future
contributions.
This is documented in CONTRIBUTING.rst
https://github.com/python-gitlab/python-gitlab/blob/main/CONTRIBUTING.rst