Add `merged_at` to merge request webhook payload

What does this MR do and why?

Adds merged_at to the merge request webhook object_attributes payload. The field is sourced from MergeRequest::Metrics#merged_at and is null for non-merged MRs.

Problem

The MR webhook payload includes state: "merged" but not when the merge happened. Webhook consumers that need merged_at have to make a separate GET /projects/:id/merge_requests/:iid API call to retrieve it.

How to set up and validate locally

  1. Create a project with a webhook configured for merge request events
  2. Open and merge an MR
  3. Check the webhook payload in Settings → Webhooks → Edit → Recent events
  4. Verify object_attributes.merged_at is present with the merge timestamp
  5. Add a label to the merged MR — verify merged_at is still present in the new webhook payload
  • Closes #599719
  • Similar pattern: !227441 (added diff_stats to MR webhook payload)"

Merge request reports

Loading