No description
Find a file
2025-12-24 07:20:55 +00:00
ai_server.py Upload files to "/" 2025-12-24 07:20:38 +00:00
background.js Upload files to "/" 2025-12-24 07:20:38 +00:00
build_exe.bat Upload files to "/" 2025-12-24 07:20:38 +00:00
build_exe.py Upload files to "/" 2025-12-24 07:20:38 +00:00
build_exe_console.py Upload files to "/" 2025-12-24 07:20:13 +00:00
BUILD_INSTRUCTIONS.md Upload files to "/" 2025-12-24 07:20:13 +00:00
content.css Upload files to "/" 2025-12-24 07:20:13 +00:00
content.js Upload files to "/" 2025-12-24 07:20:13 +00:00
generate_icons.py Upload files to "/" 2025-12-24 07:20:13 +00:00
icon16.png Upload files to "/" 2025-12-24 07:20:55 +00:00
icon48.png Upload files to "/" 2025-12-24 07:20:55 +00:00
icon128.png Upload files to "/" 2025-12-24 07:20:55 +00:00
manifest.json Upload files to "/" 2025-12-24 07:20:38 +00:00
popup.css Upload files to "/" 2025-12-24 07:19:37 +00:00
popup.html Upload files to "/" 2025-12-24 07:19:37 +00:00
popup.js Upload files to "/" 2025-12-24 07:19:37 +00:00
PRSummarizerAIServer_standalone.py Upload files to "/" 2025-12-24 07:19:12 +00:00
QUICK_BUILD_GUIDE.md Upload files to "/" 2025-12-24 07:19:12 +00:00
README.md Upload files to "/" 2025-12-24 07:19:12 +00:00
requirements.txt Upload files to "/" 2025-12-24 07:18:35 +00:00
SETUP_LINUX.md Upload files to "/" 2025-12-24 07:18:35 +00:00
setup_venv.sh Upload files to "/" 2025-12-24 07:18:35 +00:00
start_ai_server.sh Upload files to "/" 2025-12-24 07:19:12 +00:00
start_server.sh Upload files to "/" 2025-12-24 07:19:12 +00:00
start_server_and_browser.py Upload files to "/" 2025-12-24 07:19:37 +00:00
transformers.js Upload files to "/" 2025-12-24 07:18:35 +00:00

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

  1. Clone or download this repository
  2. Open Chrome/Edge and navigate to chrome://extensions/ (or edge://extensions/)
  3. Enable "Developer mode" in the top right
  4. Click "Load unpacked"
  5. Select the PullRequestSummarizer folder
  6. The extension is now installed!

Firefox

  1. Clone or download this repository
  2. Open Firefox and navigate to about:debugging
  3. Click "This Firefox"
  4. Click "Load Temporary Add-on"
  5. Select the manifest.json file from the PullRequestSummarizer folder

Usage

  1. Navigate to any pull request on GitHub, GitLab, or Forgejo
  2. The extension will automatically analyze the PR and display a summary panel
  3. 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

  1. Content Script: Injects into PR pages to extract PR data
  2. Data Extraction: Parses PR title, description, files, and statistics
  3. Analysis Engine: Analyzes the extracted data for patterns and risks
  4. 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)

  1. Install Python dependencies:

    cd PullRequestSummarizer
    pip install -r requirements.txt
    

    Or use the provided startup script (Linux/Mac):

    chmod +x start_ai_server.sh
    ./start_ai_server.sh
    
  2. Start the AI server:

    python3 ai_server.py
    

    The server will start on http://127.0.0.1:5000

Option 2: Windows Executable (Windows Only)

  1. Build the executable:

    • Run build_exe.bat (double-click or run from command prompt)
    • Wait for build to complete (~5-10 minutes)
    • Find PRSummarizerAIServer.exe in the dist folder
  2. 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.

  3. 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 state
  • POST /review - Generate code review (requires prompt in 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

  1. Load the extension in developer mode
  2. Navigate to a test PR on GitHub, GitLab, or Forgejo
  3. 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