Inspiration

Managing dozens of open merge requests is one of the biggest pain points in software development. PRs pile up, reviews get delayed, and stale drafts clog the pipeline. We wanted to build an agent that doesn't just flag issues — it actually acts on them.

What it does

MR Triage Agent automatically analyzes every open merge request in a GitLab project using Gemini AI. For each MR it decides whether to approve, close, comment, or skip — then executes the action directly via the GitLab API. Results are displayed in an interactive dashboard with Plotly charts showing action breakdown, priority distribution, top authors, project activity, and an MR timeline.

How I built it

Gemini 2.5 Flash — batch-analyzes all MRs in a single prompt to stay within rate limits GitLab REST API — fetches MRs, posts comments, approves, and closes via the partner integration Dash + Dash Bootstrap Components — interactive Python dashboard with Plotly visualizations Google Cloud Run — containerized deployment via Docker and gcloud CLI

Challenges I ran into

The global /merge_requests GitLab endpoint frequently timed out when querying across all projects. We solved this by switching to project-scoped queries and batching all MR analysis into a single Gemini call instead of one per MR — dramatically reducing latency and API rate limit issues.

Accomplishments that I am proud of

The agent genuinely takes action, not just recommendations — it posts comments and closes stale drafts on real GitLab repositories Batch Gemini analysis means the whole triage completes in one round-trip regardless of MR count Clean dashboard that makes the agent's reasoning transparent and filterable

What we learned

Building agents that take real actions requires much more careful error handling than chatbots. Rate limits, timeouts, and API quirks all become critical. We also learned that batching AI calls is both faster and more cost-effective than per-item calls.

Built With

Share this project:

Updates