No reviewer 'changes' information from merge request webhook data
Problem
While writing a bot to notify people when they become reviewer of a merge request, I can't get the reviewer information in the webhook context nor any changes on reviewers of the notified merge request.
How to reproduce
- you have a webhook configured & installed for merge request on the group/project
- pick a merge request, add a reviewer
- the webhook endpoint receives content about the merge request
"changes": {},
"event_type": "merge_request",
...
"object_attributes": {
"action": "update",
...
- however, the
changessection do not contain information about reviewer(s) changes.
Workaround / user impact
As the webhook do not provide reviewers information on the merge request, nor the "changes" information, this webhook current implementation implies the following workaround:
- for each received webhook on, we need to fetch the gitlab API to get more information on the merge request,
- maintain an external cache of "reviewers" for each merge request's update, to compensate the lack of
changes. We then compare current list of reviewers to the one stored in the external cache to infer any reviewer change.
Discussion / proposal
I think it very impacting that reviewer info is not distributed into every merge request webhooks. This is one very important information for any workflow built around gitlab !
One shall do the following evolution :
- for each received webhook on, a 'reviewer_ids' could be provided, such as the 'assignee_ids' field
- when a reviewer is added/removed, provide the changes into the
changes:previous/currentsection
Triage
For me, this is another point in &2318 (closed) I find it very impacting writing this ticket & deploying a redis instance to workaround this makes things more complex than expected.