Add internal event for Duo Code Review approvals
What does this MR do and why?
When Duo Code Review decisions are enabled, Duo approves a merge request if it finds no issues. We do not track these approvals, so AI usage analytics cannot show how often Duo approves merge requests.
This adds the approve_merge_request_duo_code_review internal event. CreateCommentsService tracks the event only when the approval succeeds. The event uses the user who started the review, not the Duo bot, and sends the merge request id as property. The event is also registered as an AiUsageEvent event in the code_review feature, with the merge request id as an extra.
We do not track the "requested changes" decision. Duo requests changes exactly when it posts comments, and post_comment_duo_code_review_on_diff already tracks that.
References
Screenshots or screen recordings
| Before | After |
|---|---|
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.