python-gitlab icon indicating copy to clipboard operation
python-gitlab copied to clipboard

Breakage with Gitlab 16.0 release

Open zampierilucas opened this issue 2 years ago • 3 comments

With the 16.0 release, Gitlab is deprecating the "/approvals" api[1], and I noticed that python-gitlab still uses in:

class ProjectMergeRequestApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
    _path = "/projects/{project_id}/merge_requests/{mr_iid}/approvals"

and

class ProjectApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
    _path = "/projects/{project_id}/approvals"

Is this going to break any functionality of python-gitlab? And should those classes be removed?

  1. https://docs.gitlab.com/ee/update/deprecations?removal_milestone=16.0#changing-merge-request-approvals-with-the-approvals-api-endpoint

zampierilucas avatar May 03 '23 18:05 zampierilucas

Thanks for the issue @zampierilucas! We already have the /approval_rules endpoint so users have had a way to migrate for a while:

https://github.com/python-gitlab/python-gitlab/blob/348f56e8b95c43a7f140f015d303131665b21772/gitlab/v4/objects/merge_request_approvals.py#L161-L162

So the only thing we can maybe do is remove the UpdateMixin from the following line IMO as it'll no longer be supported in 16.0+: https://github.com/python-gitlab/python-gitlab/blob/348f56e8b95c43a7f140f015d303131665b21772/gitlab/v4/objects/merge_request_approvals.py#L74

nejch avatar May 03 '23 19:05 nejch

Thank you for the quick response @nejch, and yes, I think I'm using the approval_rules for of all my approvals nowadays.

Feel free to close this issue

zampierilucas avatar May 04 '23 12:05 zampierilucas

Thanks! Let's keep it open so we can remove the update now rather than later so we don't wonder at some point why we have that :sweat_smile:

nejch avatar May 05 '23 16:05 nejch