Implement trigger: MR Created / Opened (merge_request_create)

Summary

3.5M MR creation events occurred in Q1 with zero automatic baseline review. This trigger fires when a merge request is created, enabling automated first-pass reviews and context enrichment at the Create stage.

Audit Event Name: merge_request_create


Agent Examples

Agent 1 — Baseline MR Review Agent

Pulls all diffs from the newly created MR, runs a first-pass Duo Code Review with inline comments, and applies labels based on changed files.

Tools:

  • Build Review Merge Request Context
  • List Merge Request Diffs
  • Post Duo Code Review
  • Create Merge Request Note
  • Update Merge Request

Agent 2 — MR Context Enrichment Agent

Reads the MR details, searches for related issues, and posts a comment summarising related work, potential conflicts, and a checklist of linked acceptance criteria.

Tools:

  • Get Merge Request
  • Gitlab Issue Search
  • Gitlab Merge Request Search
  • Create Merge Request Note
Edited by 🤖 GitLab Bot 🤖