api: Expose merge request reviewers
What does this MR do and why?
This exposes the current merge request reviewers (i.e. the MergeRequestReviewer
records), so that it's possible to know what's the state of a reviewer's review at any time (unreviewed / reviewed), through a new
GET /projects/:id/merge_requests/:merge_request_iid/reviewers
endpoint. The implementation is very similar to the GET /projects/:id/merge_requests/:merge_request_iid/participants
endpoint.
Open questions are:
- Does the endpoint name makes sense / is acceptable?
- Do the response payload makes sense?
I couldn't find an issue for this new endpoint, but Contributor Success has a need for it to automate the state management of Community contribution MRs (see discussion at gitlab-com/www-gitlab-com#13718 (comment 1040568752)).
Screenshots or screen recordings
How to set up and validate locally
- Create a merge request
- Visit the
GET /projects/:id/merge_requests/:merge_request_iid/reviewers
endpoint =>[]
should be returned - Add the current user as reviewer to the merge request
- Visit the
GET /projects/:id/merge_requests/:merge_request_iid/reviewers
endpoint => a response similar to the above screenshot should be returned - Start and submit a review with the current user
- Visit the
GET /projects/:id/merge_requests/:merge_request_iid/reviewers
endpoint => the response should be the same except thatstate
should now be equal toreviewed
- Remove the reviewer from the merge request
- Visit the
GET /projects/:id/merge_requests/:merge_request_iid/reviewers
endpoint =>[]
should be returned
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.