Inspiration

Manual code reviews are often slow, subjective, and create a bottleneck for fast-moving teams.
I wanted to automate the review process, reduce bugs, and empower developers to get instant feedback — powered by state-of-the-art AI.

What it does

mr-ai-reviewer is an AI-powered code review assistant for GitLab Merge Requests.
Every time a developer opens a Merge Request, the bot analyzes the code diff using Google Vertex AI, and posts line-by-line comments and a smart summary — directly in GitLab.

How I built it

  • Integrated GitLab webhooks to trigger the workflow on every new MR.
  • Parsed the code diff and built prompts for Google Vertex AI (Gemini).
  • Used Vertex AI to analyze code quality, security, and best practices.
  • Posted AI-generated feedback and summaries via GitLab API.
  • Deployed the solution on Google Cloud Run for scalability and reliability.
  • Created demo and documentation for easy testing.

Challenges I ran into

  • Mapping AI feedback to the correct lines/files in multi-language diffs..
  • Making the bot non-intrusive (no spam, only actionable feedback).

Accomplishments that I'm proud of

  • Fully automated, end-to-end AI code review for any GitLab project.
  • Seamless inline comments and summary — even for large diffs and multiple languages.
  • Production-ready Docker images (ARM64/AMD64) and public Cloud Run demo.
  • Friendly README and public demo repo for anyone to try.

What's next

  • Per-user and per-team analytics dashboards.
  • Enhanced customization for team/company code style and review policies.
  • Vector database and memory integration:
    Store and track previously reviewed Merge Requests, so the AI can reference past feedback, identify recurring issues, and provide more context-aware, personalized reviews.

Built With

  • docker
  • fastapi
  • gitlab-api
  • google-cloud-run
  • google-vertex-ai-(gemini)
  • pytest
  • python
Share this project:

Updates