CoolFace
Apppublic

Taimoor2500/PR-Whisperer

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
App README

PR Whisperer

PR Whisperer is a bot designed to help pull requests get reviewed and merged faster.

Features

  • PR Metadata Ingestion: Handles data from GitHub/GitLab.
  • Rule-based Signals: Detects large PRs, stuck PRs, and more.
  • Reviewer Suggestions: Recommends reviewers based on PR history.
  • Slack Integration: Sends analysis reports directly to Slack.
  • Pydantic AI Ready: Built on a foundation that easily integrates AI agents.

Tech Stack

  • FastAPI: For the web server and webhook handling.
  • Pydantic AI: For future AI-driven insights.
  • Httpx: For asynchronous HTTP requests.

Setup

  1. 1.Install dependencies:
bash
    pip install -r requirements.txt
  1. 1.Configure environment variables: Create a .env file with:
  2. 2.SLACK_BOT_TOKEN: Your xoxb token from Slack.
  3. 3.SLACK_WEBHOOK_URL: (Optional) Your Slack incoming webhook.
  4. 4.GITHUB_TOKEN: Your GitHub Personal Access Token.
  5. 5.GEMINI_API_KEY: (Optional) For AI summaries.
  6. 6.DATABASE_URL: (Optional) SQLite by default, Postgres for production.
  1. 1.Run the application:
bash
    uvicorn src.app.main:app --reload

Deployment (Hugging Face Spaces + Supabase)

  1. 1.Supabase: Create a free project and get the Connection String (URI).
  2. 2.Hugging Face Spaces:
  3. 3.Create a new Space (huggingface.co/new-space).
  4. 4.SDK: Docker (Blank).
  5. 5.Go to Settings -> Connect to GitHub and link your repo.
  6. 6.Go to Settings -> Variables and secrets and add:
  7. 7.DATABASE_URL: Your Supabase URI.
  8. 8.SLACK_BOT_TOKEN: Your xoxb token.
  9. 9.GITHUB_TOKEN: Your GitHub PAT.
  10. 10.GEMINI_API_KEY: (Optional).
  11. 11.Slack Integration:
  12. 12.Once deployed, your URL will be https://[YOUR-USERNAME]-[SPACE-NAME].hf.space.
  13. 13.Set your Slack Event Subscription Request URL to: https://[YOUR-USERNAME]-[SPACE-NAME].hf.space/slack/events.

API Endpoints

  • POST /analyze: Receives PR metadata and returns an analysis report.