Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Code Review Agent

This is a FastAPI backend that automatically reviews GitHub pull requests using AI. It processes code asynchronously with Celery and stores results in Redis. The goal is to provide developers structured feedback on style, bugs, performance, and best practices.

Features:

  • Analyze GitHub PRs for code issues
  • Asynchronous processing with Celery
  • AI agent (stub included; can be replaced with OpenAI, LangChain, or Ollama)
  • API Endpoints: POST /analyze-pr, GET /status/{task_id}, GET /results/{task_id}
  • Dockerized (FastAPI, Celery, Redis)

Tech Stack: Python 3.8+, FastAPI, Celery, Redis, Docker & Docker Compose, optional AI agent

Setup Instructions:

  1. Clone the repo: git clone <repo_url> && cd <project_folder>
  2. Create a virtual environment: python -m venv venv
    Activate it: Windows: venv\Scripts\activate | Linux/Mac: source venv/bin/activate
  3. Install dependencies: pip install -r requirements.txt
  4. Copy .env.example to .env and add your GitHub token GITHUB_TOKEN=your_token_here
    • Token is required for private repos and to avoid API rate limits
    • To create a token: GitHub → Settings → Developer Settings → Personal Access Tokens → Generate new token with repo or public_repo scope ## Demo for GetToken on github
  5. Run the project with Docker Compose: docker compose up --build
    • FastAPI runs on http://localhost:8000
    • Celery worker processes tasks
    • Redis acts as broker and result store
  6. Test the API at http://localhost:8000/docs (Swagger UI)

Example Request:

POST /analyze-pr
{
  "repo_url": "https://github.com/octocat/Hello-World",
  "pr_number": 1,
  "github_token": "your_token_here"
}

About

FastAPI and Celery prototype for asynchronous GitHub pull-request analysis with a replaceable AI review stub.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages