Skip to content

Manage mr-approved label when MR is updated

David Dieulivol requested to merge 1487-remove_mr_approved_label_part_3 into master

Context

Closes #1487 (closed).

Follow-up of !2690 (merged) and !2694 (merged).

What does this MR do and why?

When testing locally (I finally fixed my GDK 🎉), I noticed that when the product resets approvals are reset (e.g. when enabling this project setting), we don't send a merge_request.approval/merge_request.approved webhook event. Instead, we send a merge_request.update.

This MR is here to ensure that we act on those events as well to add/remove the pipeline:mr-approved label.

It's not perfect though, as I also noticed that it will take a few seconds (at least locally), to actually remove the approvals, and the event is fired right away, so triage-ops checks the MR, and the approval is still present.

On another commit or MR update though, the label will eventually be removed, so I think that's a good-enough tradeoff.

Screenshots

Kapture_2024-02-28_at_16.56.07

Action items

Merge request reports