Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hubble-works/callisto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Assisted Code Review Bot

A GitHub bot that performs AI-assisted code reviews by analyzing diffs and providing intelligent comments.

Features

  • Receives GitHub webhook events for pull requests
  • Analyzes code diffs using AI
  • Posts review comments back to GitHub
  • Built with FastAPI for high performance
  • Async/await support for efficient processing

Setup

Prerequisites

Installation

  1. Install dependencies:
poetry install
  1. Configure your settings:
cp .env.example .env
# Edit .env with your GitHub token and AI API keys

Running the Bot

Start the development server:

poetry run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Or use the Poetry script:

poetry run start

Running Tests

poetry run pytest

Code Quality

Format code:

poetry run black app/ tests/

Lint code:

poetry run flake8 app/ tests/
poetry run mypy app/

Configuration

Set these environment variables in your .env file:

  • GITHUB_TOKEN: Your GitHub personal access token
  • GITHUB_WEBHOOK_SECRET: Secret for validating GitHub webhooks
  • AI_API_KEY: API key for your AI service (e.g., OpenAI)
  • AI_MODEL: AI model to use (e.g., gpt-4)
  • AI_BASE_URL: (Optional) Custom base URL for OpenAI-compatible APIs (e.g., Azure OpenAI, LocalAI, Ollama)
    • If not set, defaults to OpenAI's official API endpoint
    • Example for Azure: https://YOUR-RESOURCE.openai.azure.com/v1
    • Example for LocalAI: http://localhost:8080/v1

Architecture

  • app/main.py: FastAPI application entry point
  • app/api/: API endpoints
  • app/services/: Business logic (GitHub integration, AI analysis)
  • app/config.py: Configuration management
  • tests/: Test suite

GitHub Webhook Setup

  1. Go to your repository settings → Webhooks
  2. Add webhook with URL: https://your-domain.com/webhooks/github
  3. Select events: Pull requests
  4. Set the webhook secret matching your GITHUB_WEBHOOK_SECRET

License

MIT

About

AI code-review for GitHub (and later GitLab)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published