Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ProjectMergeRequestApprovalManager.set_approvers cannot handle too many approval rules #2825

Closed
@liu15

Description

@liu15

Description of the problem, including code/CLI snippet

In v4/objects/merge_request_approvals.py ~ line 121

    # update any existing approval rule matching the name    existing_approval_rules = approval_rules.list()    for ar in existing_approval_rules:        if ar.name == approval_rule_name:            ar.user_ids = data["user_ids"]            ar.approvals_required = data["approvals_required"]            ar.group_ids = data["group_ids"]            ar.save()            return ar    # if there was no rule matching the rule name, create a new one    return approval_rules.create(data=data, **kwargs)

An existing approval rule will not be found if it exceeds the default pagination count for list(). It will instead attempt to create it (which will fail because it already exists)

Expected Behavior

approval rule should be found in the list of existing approval rules and be modified.

Actual Behavior

approval rule is not found and creation of new rule fails.

Specifications

I believe this fix is to change

approval_rules.list()

to

approval_rules.list(all=True)

  • python-gitlab version: 4.4.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp