| ai_server.py | ||
| background.js | ||
| build_exe.bat | ||
| build_exe.py | ||
| build_exe_console.py | ||
| BUILD_INSTRUCTIONS.md | ||
| content.css | ||
| content.js | ||
| generate_icons.py | ||
| icon16.png | ||
| icon48.png | ||
| icon128.png | ||
| manifest.json | ||
| popup.css | ||
| popup.html | ||
| popup.js | ||
| PRSummarizerAIServer_standalone.py | ||
| QUICK_BUILD_GUIDE.md | ||
| README.md | ||
| requirements.txt | ||
| SETUP_LINUX.md | ||
| setup_venv.sh | ||
| start_ai_server.sh | ||
| start_server.sh | ||
| start_server_and_browser.py | ||
| transformers.js | ||
PR Summarizer & Reviewer
A browser extension that automatically analyzes, summarizes, and reviews pull requests on GitHub, GitLab, and Forgejo.
Features
- 🔍 Automatic PR Analysis: Automatically detects and analyzes PRs when you visit them
- 📊 Comprehensive Summaries: Get quick overviews of PR changes, file counts, and statistics
- ⚠️ Risk Assessment: Identifies potential risks and issues in PRs
- 💡 Smart Suggestions: Provides actionable suggestions for improvement
- 📝 File-level Analysis: Shows detailed breakdown of changed files
- 🎨 Beautiful UI: Clean, modern interface that integrates seamlessly with GitHub, GitLab, and Forgejo
- 🌓 Dark Mode Support: Automatically adapts to your system theme
Installation
Chrome/Edge
- Clone or download this repository
- Open Chrome/Edge and navigate to
chrome://extensions/(oredge://extensions/) - Enable "Developer mode" in the top right
- Click "Load unpacked"
- Select the
PullRequestSummarizerfolder - The extension is now installed!
Firefox
- Clone or download this repository
- Open Firefox and navigate to
about:debugging - Click "This Firefox"
- Click "Load Temporary Add-on"
- Select the
manifest.jsonfile from thePullRequestSummarizerfolder
Usage
- Navigate to any pull request on GitHub, GitLab, or Forgejo
- The extension will automatically analyze the PR and display a summary panel
- Click the extension icon in your browser toolbar to:
- Manually trigger analysis
- View settings
- See last analysis results
Features Breakdown
PR Summary Panel
The summary panel appears on PR pages and includes:
- Overview Stats: Files changed, additions, deletions, commits
- Summary: High-level description of the PR
- Risk Level: Low, Medium, or High risk assessment
- Review Points: Important things to check during review
- Suggestions: Recommendations for improvement
- File List: Detailed breakdown of changed files (for PRs with ≤20 files)
Analysis Features
The extension analyzes:
- PR size and complexity
- File change patterns
- Test coverage
- Documentation updates
- Configuration changes
- Security-related files
- Code addition vs deletion patterns
Settings
Configure the extension behavior:
- Auto-analyze on page load: Automatically analyze PRs when you visit them
- Show file list: Display detailed file changes in summary
- Show suggestions: Include improvement suggestions in analysis
Supported Platforms
- ✅ GitHub (github.com)
- ✅ GitHub Enterprise (custom domains)
- ✅ GitLab (gitlab.com)
- ✅ GitLab Self-hosted (custom domains)
- ✅ Forgejo (self-hosted instances)
- ✅ Gitea (self-hosted instances - compatible with Forgejo)
How It Works
- Content Script: Injects into PR pages to extract PR data
- Data Extraction: Parses PR title, description, files, and statistics
- Analysis Engine: Analyzes the extracted data for patterns and risks
- UI Rendering: Displays results in a floating panel on the page
AI Code Review Setup
The extension uses a Python server to run the Qwen2.5-Coder-0.5B-Instruct model for AI-powered code reviews (fast, lightweight).
Prerequisites
- Python 3.8 or higher
- pip (Python package manager)
Setup Steps
Option 1: Python Script (Linux/Mac/Windows)
-
Install Python dependencies:
cd PullRequestSummarizer pip install -r requirements.txtOr use the provided startup script (Linux/Mac):
chmod +x start_ai_server.sh ./start_ai_server.sh -
Start the AI server:
python3 ai_server.pyThe server will start on
http://127.0.0.1:5000
Option 2: Windows Executable (Windows Only)
-
Build the executable:
- Run
build_exe.bat(double-click or run from command prompt) - Wait for build to complete (~5-10 minutes)
- Find
PRSummarizerAIServer.exein thedistfolder
- Run
-
Run the executable:
- Double-click
PRSummarizerAIServer.exe - Server starts automatically
- Browser opens to https://code.vilor.com/ automatically
See BUILD_INSTRUCTIONS.md for detailed instructions.
- Double-click
-
Enable AI Review in Extension:
- Click the extension icon
- Toggle "AI Code Review" to enabled
- The extension will automatically connect to the Python server
Server Endpoints
GET /health- Check server status and model loading statePOST /review- Generate code review (requirespromptin JSON body)POST /load- Manually trigger model loading
Model Information
- Model: Qwen/Qwen2.5-Coder-0.5B-Instruct
- Size: ~0.5GB (downloaded automatically on first use)
- Speed: Fast, near-instant responses
- Device: Automatically uses GPU if available, falls back to CPU
Troubleshooting AI Server
Server not connecting:
- Make sure the Python server is running (
python3 ai_server.py) - Check that port 5000 is not in use by another application
- Verify the server URL in the extension matches
http://127.0.0.1:5000
Model loading issues:
- First-time model download may take several minutes
- Ensure you have sufficient disk space (~2GB for model files)
- Check your internet connection for model download
Performance:
- GPU acceleration is recommended for faster inference
- CPU-only mode works but may be slower for large PRs
Privacy
- All analysis happens locally in your browser
- AI model runs on your local Python server (no external API calls)
- PR data is only sent to your local server
- PR data is stored locally in browser storage
- No tracking or analytics
Development
Project Structure
PullRequestSummarizer/
├── manifest.json # Extension manifest
├── content.js # Content script for PR analysis
├── content.css # Styles for summary panel
├── popup.html # Extension popup UI
├── popup.js # Popup logic
├── popup.css # Popup styles
├── background.js # Service worker
├── ai_server.py # Python AI server
├── requirements.txt # Python dependencies
├── start_ai_server.sh # Server startup script
├── icons/ # Extension icons
│ ├── icon16.png
│ ├── icon48.png
│ └── icon128.png
└── README.md # This file
Building
No build process required! The extension works directly from source.
Testing
- Load the extension in developer mode
- Navigate to a test PR on GitHub, GitLab, or Forgejo
- Verify the summary panel appears and displays correct information
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT License - feel free to use this extension for personal or commercial projects.
Future Enhancements
Potential features for future versions:
- Integration with AI models for more sophisticated analysis
- Custom review templates
- Export summaries to markdown/PDF
- Integration with project management tools
- Support for Bitbucket and other Git platforms
- Code quality metrics
- Dependency change analysis
- Breaking change detection
Troubleshooting
Summary panel doesn't appear
- Make sure you're on a valid PR page (URL contains
/pull/or/merge_requests/) - Check browser console for errors
- Try refreshing the page
- Click the extension icon and manually trigger analysis
Analysis seems incorrect
- The extension extracts data from the page DOM
- Some PR pages may have different structures
- Try refreshing the page to ensure all content is loaded
Extension not working
- Check that the extension is enabled in browser settings
- Verify you're on a supported platform (GitHub/GitLab)
- Check browser console for error messages
Support
For issues, questions, or suggestions, please open an issue on the repository.
Made with ❤️ for developers who review pull requests