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

fix: removeproject.approvals.set_approvals() method#2333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 2 commits intomainfromjlvillal/remove_approvers_endpoint
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletionsdocs/gl_objects/merge_request_approvals.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,11 +63,6 @@ Change project-level or MR-level MR approvals settings::
mr_mras.approvals_required = 1
mr_mras.save()

Change project-level MR allowed approvers::

project.approvals.set_approvers(approver_ids=[105],
approver_group_ids=[653, 654])

Create a new MR-level approval rule or change an existing MR-level approval rule::

mr.approvals.set_approvers(approvals_required = 1, approver_ids=[105],
Expand Down
32 changes: 0 additions & 32 deletionsgitlab/v4/objects/merge_request_approvals.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,38 +50,6 @@ class ProjectApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
def get(self, **kwargs: Any) -> ProjectApproval:
return cast(ProjectApproval, super().get(**kwargs))

@exc.on_http_error(exc.GitlabUpdateError)
def set_approvers(
self,
approver_ids: Optional[List[int]] = None,
approver_group_ids: Optional[List[int]] = None,
**kwargs: Any,
) -> Dict[str, Any]:
"""Change project-level allowed approvers and approver groups.

Args:
approver_ids: User IDs that can approve MRs
approver_group_ids: Group IDs whose members can approve MRs

Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabUpdateError: If the server failed to perform the request

Returns:
A dict value of the result
"""
approver_ids = approver_ids or []
approver_group_ids = approver_group_ids or []

if TYPE_CHECKING:
assert self._parent is not None
path = f"/projects/{self._parent.encoded_id}/approvers"
data = {"approver_ids": approver_ids, "approver_group_ids": approver_group_ids}
result = self.gitlab.http_put(path, post_data=data, **kwargs)
if TYPE_CHECKING:
assert isinstance(result, dict)
return result


class ProjectApprovalRule(SaveMixin, ObjectDeleteMixin, RESTObject):
_id_attr = "id"
Expand Down
1 change: 1 addition & 0 deletionspyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,6 +58,7 @@ disable = [
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"not-callable",
"protected-access",
"redefined-builtin",
"signature-differs",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp