Built for GitLab Duo / Hackathon Prototype
A lightweight FastAPI service that analyzes GitLab Merge Requests, assigns a simple risk score based on file changes, and posts a single summary comment back to the MR.
- Detects high-risk changes (e.g. CI configs, migrations)
- Computes a cumulative risk score
- Posts/updates a single MR comment
- Debug endpoint for local testing (
/debug/analyze)
- Create a GitLab Personal Access Token with
apiscope - Copy
.env.example→.envand fill in values
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt
python server.py
POST to: http://127.0.0.1:8000/debug/analyze