codry

module
v0.0.0-...-5d910d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2025 License: Apache-2.0

README ΒΆ

πŸ€– Codry - AI-Powered Code Review Service

Go Report Card

An intelligent code review service that leverages multiple AI providers to automatically review pull requests and merge requests across different VCS platforms.

🌟 Features

Multi-Platform Support
  • βœ… GitLab - Complete integration with GitLab CE/EE
  • βœ… GitHub - Full GitHub.com and GitHub Enterprise support
  • βœ… Bitbucket - Complete Bitbucket Cloud and Server support
Multiple AI Models
  • βœ… Google Gemini - Gemini 2.5 Flash/Pro, cost-effective and fast
  • βœ… OpenAI ChatGPT - GPT-4o, GPT-4o-mini, GPT-3.5-turbo
  • βœ… Claude/Anthropic - Claude 3.5 Sonnet/Haiku, excellent reasoning
  • βœ… Azure OpenAI - Enterprise-grade OpenAI integration
  • βœ… Local Models - Ollama, LocalAI (OpenAI-compatible APIs)
  • πŸ”„ More coming - Claude, Cohere, and other providers
Smart Features
  • πŸ€– Automatic Reviews - AI-powered code analysis and suggestions
  • πŸ“ MR/PR Descriptions - Auto-generate comprehensive descriptions
  • 🎯 Reviewer-based Triggers - Start reviews when bot is added as reviewer
  • πŸ” File Filtering - Smart filtering by extension, size, and paths
  • πŸ›‘οΈ Security-First - Webhook validation and secure token handling
  • πŸ“Š Enterprise Ready - Rate limiting, monitoring, and compliance features

πŸš€ Quick Start

1. Download & Configure
# Download the latest release
wget https://github.com/maxbolgarin/codry/releases/latest/download/codry

# Make it executable
chmod +x codry

# Copy example configuration
cp config.example.yaml config.yaml

# Edit configuration
nano config.yaml
2. Choose Your AI Provider
agent:
  type: "claude"
  api_key: "${CLAUDE_API_KEY}"
  model: "claude-3-5-haiku-20241022"  # Cost-effective
  # model: "claude-3-5-sonnet-20241022"  # Best quality
Option B: OpenAI ChatGPT
agent:
  type: "openai"
  api_key: "${OPENAI_API_KEY}"
  model: "gpt-4o-mini"  # Fast and affordable
  # model: "gpt-4o"  # Best quality
Option C: Google Gemini
agent:
  type: "gemini"
  api_key: "${GEMINI_API_KEY}"
  model: "gemini-2.5-flash-preview-05-20"  # Fast and free tier
3. Set Environment Variables
# For Claude
export CLAUDE_API_KEY="sk-ant-your-claude-api-key"

# For OpenAI
export OPENAI_API_KEY="sk-your-openai-api-key"

# For Gemini
export GEMINI_API_KEY="your-gemini-api-key"

# For your VCS platform
export GITLAB_TOKEN="glpat-your-gitlab-token"
export GITHUB_TOKEN="ghp_your-github-token"

# Webhook secrets
export GITLAB_WEBHOOK_SECRET="your-webhook-secret"
export GITHUB_WEBHOOK_SECRET="your-webhook-secret"
4. Start the Service
./codry --config config.yaml

πŸ”§ Platform Setup Guides

GitLab Setup

Basic GitLab configuration is included in the main config. For advanced features, see the documentation.

GitHub Setup

For detailed GitHub integration including webhook setup and reviewer triggers: πŸ“– GitHub Setup Guide

Bitbucket Setup

For complete Bitbucket Cloud and Server integration with webhook configuration: πŸ“– Bitbucket Setup Guide

πŸ€– AI Provider Guides

Claude/Anthropic Setup

For Claude 3.5 models with superior reasoning capabilities: πŸ“– Claude Setup Guide

OpenAI ChatGPT Setup

For GPT-4o and other OpenAI models including Azure OpenAI: πŸ“– OpenAI Setup Guide

Google Gemini Setup

Gemini configuration is straightforward - just get an API key from Google AI Studio and configure as shown above.

πŸ“‹ Configuration Options

Minimal Configuration
server:
  address: ":8080"

provider:
  type: "github"  # or "gitlab", "bitbucket"
  token: "${GITHUB_TOKEN}"
  webhook_secret: "${GITHUB_WEBHOOK_SECRET}"
  bot_username: "codry-bot"

agent:
  type: "claude"  # or "openai", "gemini"
  api_key: "${CLAUDE_API_KEY}"
  model: "claude-3-5-haiku-20241022"
Advanced Configuration
server:
  address: ":8080"
  endpoint: "/webhook"
  timeout: 30s

provider:
  type: "github"
  base_url: "https://github.com"  # or your GitHub Enterprise URL
  token: "${GITHUB_TOKEN}"
  webhook_secret: "${GITHUB_WEBHOOK_SECRET}"
  bot_username: "codry-bot"
  rate_limit_wait: 1m

agent:
  type: "claude"
  api_key: "${CLAUDE_API_KEY}"
  model: "claude-3-5-sonnet-20241022"
  max_retries: 3
  retry_delay: 10s
  temperature: 0.05
  max_tokens: 6000

review:
  file_filter:
    max_file_size: 10000
    allowed_extensions: [".go", ".js", ".ts", ".py", ".java"]
    excluded_paths: ["vendor/", "node_modules/", "*.min.js"]
  max_files_per_mr: 50
  enable_description_generation: true
  enable_code_review: true
  min_files_for_description: 3
  processing_delay: 5s

πŸ› οΈ Development

Building from Source
# Clone repository
git clone https://github.com/maxbolgarin/codry.git
cd codry

# Build
make build

# Run tests
make test

# Run with development config
make dev
Project Structure
codry/
β”œβ”€β”€ cmd/main/           # Application entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ agents/         # AI provider implementations
β”‚   β”‚   β”œβ”€β”€ claude/     # Claude/Anthropic integration
β”‚   β”‚   β”œβ”€β”€ openai/     # OpenAI ChatGPT integration
β”‚   β”‚   └── gemini/     # Google Gemini integration
β”‚   β”œβ”€β”€ providers/      # VCS platform implementations
β”‚   β”‚   β”œβ”€β”€ github/     # GitHub integration
β”‚   β”‚   └── gitlab/     # GitLab integration
β”‚   β”œβ”€β”€ config/         # Configuration management
β”‚   β”œβ”€β”€ webhook/        # Webhook handling
β”‚   β”œβ”€β”€ review/         # Review orchestration
β”‚   └── service/        # Core business logic
β”œβ”€β”€ config.example.yaml # Example configuration
└── docs/              # Setup guides and documentation

🌟 Why Multiple AI Providers?

Different AI models excel at different tasks:

Model Best For Speed Cost Code Quality
Claude 3.5 Haiku Daily reviews, reasoning ⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐
Claude 3.5 Sonnet Complex analysis ⭐⭐ ⭐⭐ ⭐⭐⭐⭐⭐
GPT-4o-mini Fast reviews ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐
GPT-4o Comprehensive reviews ⭐⭐⭐ ⭐⭐ ⭐⭐⭐⭐
Gemini 2.5 Flash Budget-conscious ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐ ⭐⭐⭐⭐

πŸ”’ Security Features

  • Webhook Signature Validation - Cryptographic verification of incoming webhooks
  • Rate Limiting - Built-in protection against abuse
  • Token Security - Secure handling of API keys and access tokens
  • Enterprise Support - GitHub Enterprise, GitLab Enterprise compatibility
  • Local Model Support - Complete privacy with self-hosted models

πŸ“Š Enterprise Features

  • Multi-tenant Support - Handle multiple organizations
  • Audit Logging - Comprehensive activity tracking
  • Cost Monitoring - Track AI API usage and costs
  • Custom Filtering - Advanced file and change filtering
  • Compliance Ready - SOC2, GDPR-compatible deployment options

🎯 Use Cases

Startup Teams
  • Cost-effective daily code reviews
  • Automated PR descriptions
  • Consistent code quality enforcement
Enterprise Organizations
  • Scalable code review automation
  • Multi-platform repository support
  • Compliance and security focused reviews
Open Source Projects
  • Community contribution reviews
  • Automated feedback for contributors
  • Consistent review standards

🀝 Contributing

We welcome contributions! Please see our contributing guidelines for details.

Current Priorities
  • Bitbucket provider implementation
  • Additional AI providers (Cohere, Mistral)
  • Advanced filtering and routing
  • Performance optimizations
  • Enhanced enterprise features

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

⭐ Star History

If you find this project useful, please consider giving it a star! ⭐


Built with ❀️ for developers who want intelligent, automated code reviews across any platform with any AI model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL