binhmuc/autobot-review
AI-powered GitLab code review bot using Azure OpenAI Haiku 4.5. Automated security checks, performance analysis, and inline comments on merge requests with smart batching and false positive filtering.
npx skills add binhmuc/autobot-reviewREADME
ReviewBot - AI-Powered GitLab Code Review System
Automated code review bot for GitLab using Azure OpenAI Haiku 4.5. Provides intelligent code analysis, security checks, performance suggestions, and inline comments directly on merge requests.
šø Screenshots
Dashboard
Real-time metrics showing code quality scores, issue breakdown, and review history
GitLab Integration
AI-powered inline comments directly on merge request code changes
Comprehensive merge request summary with quality score and categorized issues
Developer Analytics
Track individual developer performance and improvement trends over time
Note: Add your screenshots to the
/imagesfolder to display them here.
š Features
Code Review Intelligence
- AI-Powered Analysis: Utilizes Azure OpenAI Haiku 4.5 for fast, accurate code reviews
- Multi-Language Support: Analyzes TypeScript, JavaScript, Python, Java, Go, Rust, PHP, and more
- Smart Batching: Combines multiple file changes into single LLM call for efficiency (ā¤500 lines)
- False Positive Filtering: Verifies LLM findings against actual file content to reduce noise
Review Capabilities
- Inline Comments: Posts comments directly on specific code lines for critical/high/medium issues
- Comprehensive Summary: Detailed MR-level summary with quality scores and issue breakdown
- Issue Categorization:
- Severity: Critical, High, Medium, Low
- Type: Security, Performance, Logic, Style
- Context-Aware: Includes ±10 lines of context and imports for accurate analysis
Developer Metrics
- Quality Scoring: 0-100 score based on issue severity
- Historical Tracking: Review history and trends per developer
- Project Analytics: Aggregate metrics across projects
Integration
- GitLab Webhooks: Automatic review on MR open/update
- Queue Processing: Async job processing with Bull + Redis
- API Access: RESTful API for frontend consumption
šļø Architecture
reviewbot/
āāā reviewbot-backend/ # NestJS API + Queue Processor
ā āāā src/
ā ā āāā webhook/ # GitLab webhook receiver
ā ā āāā llm/ # Azure OpenAI integration
ā ā āāā queue/ # Bull queue processing
ā ā āāā gitlab/ # GitLab API client
ā ā āāā prisma/ # Database models
ā āāā prisma/ # Database schema
ā āāā docker-compose.yml # Infrastructure stack
ā
āāā reviewbot-frontend/ # React + Vite Dashboard
āāā src/
āāā pages/ # Dashboard, Projects, Developers, Reviews
āāā components/ # Reusable UI components
āāā api/ # API client
Tech Stack
Backend:
- NestJS (Node.js framework)
- Prisma ORM
- PostgreSQL (database)
- Redis + Bull (queue processing)
- Azure OpenAI API (Haiku 4.5)
- GitLab REST API (@gitbeaker/rest)
Frontend:
- React 19
- Vite (build tool)
- TanStack Query (data fetching)
- Tailwind CSS + shadcn/ui
- Recharts (visualization)
š Prerequisites
- Node.js: v18+ (backend and frontend)
- Docker & Docker Compose: For PostgreSQL and Redis
- Azure OpenAI: API key and Haiku 4.5 deployment
- GitLab: Personal access token with API scope
- Git: For version control
š Quick Start
1. Clone Repository
git clone <your-repo-url>
cd reviewbot
2. Backend Setup
cd reviewbot-backend
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
# Edit .env with your credentials
nano .env
Required Environment Variables:
# Database
DATABASE_URL=postgresql://reviewbot:your_password@localhost:5432/reviewbot
DB_PASSWORD=your_password
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
# Azure OpenAI
AZURE_OPENAI_KEY=your_api_key
AZURE_OPENAI_ENDPOINT=https://your-resource.cognitiveservices.azure.com/
AZURE_OPENAI_DEPLOYMENT=haiku-4-5
AZURE_OPENAI_MODEL_NAME=haiku-4-5
# GitLab
GITLAB_HOST=https://gitlab.com
GITLAB_WEBHOOK_SECRET=your_webhook_secret
GITLAB_ACCESS_TOKEN=your_gitlab_token
# Auth
JWT_SECRET=your_jwt_secret
ADMIN_USERNAME=admin
ADMIN_PASSWORD=change_me
3. Start Infrastructure
...