Skip to content

Commit ef8f0e1

Browse files
JohnVillalovosnejch
authored andcommitted
fix: handle large number of approval rules
Use `iterator=True` when going through the list of current approval rules. This allows it to handle more than the default of 20 approval rules. Closes: #2825
1 parent 33fbc14 commit ef8f0e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitlab/v4/objects/merge_request_approvals.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def set_approvers(
122122
self._parent.approval_rules
123123
)
124124
# update any existing approval rule matching the name
125-
existing_approval_rules = approval_rules.list()
125+
existing_approval_rules = approval_rules.list(iterator=True)
126126
for ar in existing_approval_rules:
127127
if ar.name == approval_rule_name:
128128
ar.user_ids = data["user_ids"]

0 commit comments

Comments
 (0)