https://github.com/fox-techniques/hephai-pr-doctor
https://github.com/fox-techniques/hephai-pr-doctor
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/fox-techniques/hephai-pr-doctor
- Owner: fox-techniques
- License: mit
- Created: 2025-02-04T13:05:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T00:15:22.000Z (over 1 year ago)
- Last Synced: 2026-01-17T06:15:43.873Z (5 months ago)
- Language: Python
- Size: 88.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# HEPHAI-PR-Doctor
**HEPHAI-PR-Doctor** is an AI-powered GitHub Action for **automated PR review, test generation, and code quality analysis**. It leverages **OpenAI models** to evaluate pull requests, suggest improvements, and generate test cases.
## Features
- **Automated PR Analysis** – Assigns a quality score based on file changes, complexity, and AI-inferred file importance.
- **AI-Powered Test Suggestions** – Generates test cases for changed files to improve coverage.
- **Repository Structure Analysis** – Evaluates file types (e.g., security-sensitive, config, tests) to weight their impact.
- **GitHub Actions & Local Testing** – Works as a GitHub Action or can be executed locally for testing.
- **Automated PR Comments** – Posts a structured review summary with test suggestions directly on GitHub PRs.
## Configuration
HEPHAI-PR-doctor requires:
- **`GITHUB_TOKEN`** (Automatically available in GitHub Actions)
- **`OPENAI_API_KEY`** (Set as a repository secret to use OpenAI for PR reviews and test generation)
## How It Works
1. Fetches Repository Structure – Retrieves the list of files in the repo (GitHub API or local scan).
2. Analyzes File Weights with AI – Assigns weights to files based on importance (security, tests, config).
3. Fetches PR Data – Reads PR details, including changed files, additions, deletions, and linting issues.
4. Scores the PR – Calculates a PR quality score (0-100) using file importance, size, and complexity.
5. Generates Test Cases – Uses AI to suggest unit and integration tests for modified files.
6. Saves a Test Report – Outputs a structured JSON report with the analysis results.
7. Posts a PR Comment – (If in GitHub Actions) Posts a review summary with test recommendations.