AI-Driven CI/CD Failure Analyzer - Reduce CI pain, shorten MTTR
CI Insight is a production-quality web application that ingests CI/CD pipeline failures from GitHub Actions and Jenkins, automatically classifies them, detects flaky tests, and provides intelligent fix suggestions.
- Automated Failure Analysis: Rule-based classification with optional AI-powered insights
- Flaky Test Detection: Identifies intermittent test failures with scoring and explanations
- Fix Suggestions: Rule-based suggestions always available, AI-enhanced when configured
- Recurrence Tracking: Spot patterns, track top failures, and identify new issues
- Multiple CI Platforms: GitHub Actions and Jenkins support out of the box
- Privacy-First: Log redaction, optional raw log storage, offline AI mode available
- Production-Ready: Docker Compose deployment, comprehensive tests, structured logging
docker compose up --buildThat's it! The application will be available at:
- Frontend: http://localhost
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
# Start the application
docker compose up --build -d
# Import sample data
docker exec ci-insight-backend python /app/../scripts/import-demo-data.py
# Or send sample webhooks
./scripts/send-sample-webhook.shVisit http://localhost to see the dashboard populated with demo failures.
- Docker and Docker Compose
- (Optional) OpenAI API key for AI-powered suggestions
That's all! No other dependencies required.
The application works out of the box with sensible defaults. Configure via environment variables:
# AI Provider (none, openai, local)
AI_PROVIDER=local # Default: local (TF-IDF based, offline)
# OpenAI Configuration (optional)
OPENAI_API_KEY=sk-... # Only needed if AI_PROVIDER=openai
OPENAI_MODEL=gpt-3.5-turbo # Default model
# Privacy Settings
ENABLE_LOG_REDACTION=true # Redact secrets from logs (recommended)
STORE_RAW_LOGS=false # Store unredacted logs (privacy risk)
# Security
ENABLE_WEBHOOK_VALIDATION=false # Dev mode: accept unsigned webhooks
GITHUB_WEBHOOK_SECRET=... # For production webhook validation
JENKINS_WEBHOOK_SECRET=... # For production webhook validation
# Database
DATABASE_URL=sqlite:////data/ci_insight.db # Default: SQLite
# For Postgres: postgresql://user:pass@db:5432/ci_insightCreate a .env file in the project root:
AI_PROVIDER=openai
OPENAI_API_KEY=sk-your-key-hereThen restart:
docker compose down
docker compose up --buildThe app gracefully degrades to rule-based suggestions if OpenAI is unavailable.
- Go to your repository Settings → Webhooks → Add webhook
- Payload URL:
http://your-server/api/ingest/github/webhook - Content type:
application/json - Events: Select "Workflow runs"
- Secret (optional): Set in
GITHUB_WEBHOOK_SECRETenv var - Click "Add webhook"
- Install the "Notification Plugin" in Jenkins
- In your job, Configure → Post-build Actions → Notification Endpoint
- URL:
http://your-server/api/ingest/jenkins/webhook - Format: JSON
- Event: Job Finalized
- Token (optional): Set in
JENKINS_WEBHOOK_SECRETenv var
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ GitHub │──────▶│ CI Insight │◀──────│ Jenkins │
│ Actions │webhook│ │webhook│ │
└─────────────┘ └──────────────┘ └─────────────┘
│
├─ Ingestion Layer
│ ├─ GitHub Service
│ ├─ Jenkins Service
│ └─ Log Parser
│
├─ Analysis Layer
│ ├─ Classifier (rule-based)
│ ├─ Flaky Detector
│ ├─ Log Redactor
│ └─ Similarity Analyzer
│
├─ AI Layer (optional)
│ ├─ OpenAI Provider
│ └─ Local Provider (TF-IDF)
│
├─ Storage
│ └─ SQLite / PostgreSQL
│
└─ Frontend
└─ React Dashboard
See architecture.md for detailed design documentation.
POST /api/ingest/github/webhook- GitHub webhook receiverPOST /api/ingest/jenkins/webhook- Jenkins webhook receiver
GET /api/repos- List repositoriesGET /api/runs?repo_id=&status=&branch=- List CI runs with filtersGET /api/runs/{run_id}- Get run detailsGET /api/failures?category=&q=- List failures with filtersGET /api/failures/{failure_id}- Get failure detailsPOST /api/failures/{failure_id}/reanalyze- Re-run analysis
GET /api/analytics/overview- Dashboard metricsGET /api/analytics/flaky- Flaky test analysis
Full API documentation: http://localhost:8000/docs
Backend:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reloadFrontend:
cd frontend
npm install
npm run dev# Backend tests
cd backend
pytest
# With coverage
pytest --cov=app --cov-report=html
# Frontend tests
cd frontend
npm test# Backend
make lint
make format
# Or manually
cd backend
black app
flake8 appCI-Insight/
├── backend/
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── core/ # Config, database, logging
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ ├── services/ # Business logic
│ │ │ ├── analysis/ # Classifiers, detectors
│ │ │ ├── ai/ # AI providers
│ │ │ └── ingestion/ # GitHub, Jenkins
│ │ └── tests/ # Unit & integration tests
│ ├── alembic/ # Database migrations
│ ├── Dockerfile
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API client
│ │ └── types/ # TypeScript types
│ ├── Dockerfile
│ └── package.json
├── sample-data/ # Demo webhooks & seed data
├── scripts/ # Utility scripts
├── docker-compose.yml
└── README.md
# Check logs
docker compose logs
# Rebuild from scratch
docker compose down -v
docker compose up --build# Reset database
docker compose down -v
docker volume rm ci-insight_backend-data
docker compose up --buildCheck CORS settings in backend/app/core/config.py. Default allows localhost.
- Check webhook validation is disabled for dev:
ENABLE_WEBHOOK_VALIDATION=false - Check backend logs:
docker compose logs backend - Test manually:
./scripts/test-ingestion.sh
- Check
AI_PROVIDERsetting - If using OpenAI, verify
OPENAI_API_KEYis set - Check backend logs for API errors
- App will gracefully fall back to rule-based suggestions
See security.md for:
- Threat model
- Log redaction details
- Webhook signature verification
- Production deployment recommendations
This is a demonstration project. For production use:
- Enable webhook signature validation
- Use PostgreSQL instead of SQLite
- Set up proper CORS origins
- Review and enhance log redaction patterns
- Implement authentication if exposing publicly
MIT License - See LICENSE file for details
For issues and questions:
- GitHub Issues: https://github.com/your-org/ci-insight/issues
- Documentation: See
docs/folder - API Docs: http://localhost:8000/docs
Built with ❤️ to reduce CI pain and shorten MTTR