[go: up one dir, main page]

Skip to content

API to verify a given user has right to merge a given mergerequest

Hello

I do not find an API that would allow to verify a given user has the permission to merge. We have a bot that can perform the merge under some conditions, but we need the information "does the requester has the right permission to merge". It is not the "can_be_merge" state of the mergerequest that does not depends on the username.

Impersionation is not possible since it will perform the merge, I just need to retrieve the mergeability status of the MR related to one username.

For the moment I need to:

  • list project members
  • include group members (and parents and so on)
  • look for protected branch access level
  • compare access_level with user

It is quite heavy and I do not have any guarantee this behavior is exactly the same as gitlab (did I miss some criteria?).

I would be quite happy to have an API related to a given mergerequest:

/projects/:id/merge_requests/:merge_request_iid/verify_merge_permission/:user_id

We need the mergerequest to get the target branch and use the branch protection configuration.

Thanks