Access reviewer/approval state information of a merge request
I would like to use gitlab-triage
to determine which merge request hasn't been reviewed yet by the reviewers.
I started using a policy similar to the one in triage-ops
: https://gitlab.com/gitlab-org/quality/triage-ops/-/blob/master/policies/community/hygiene/ping-inactive-reviewers.yml?ref_type=heads
An example policy:
resource_rules:
merge_requests:
rules:
- name: Ping assigned reviewers in MRs that are waiting for a review
conditions:
date:
attribute: updated_at
condition: older_than
interval_type: days
interval: 7
reviewer_id: any
actions:
comment: |
#{ reviewers = resource["reviewers"].map { |reviewer| "@#{reviewer['username']}" }; nil }
#{ reviewers.join(', ') }, this contribution was recently assigned to you for review.
- Do you still have capacity to review this? We are mindful of your time, so if you are not
able to take this on, please re-assign to one or more other reviewers.
However, this would still add the comment to merge requests that were already approved (but not merged) or ping a reviewer that already approved it (if others haven't yet).
Is there a way to access the approval state of a merge request?