Table of Contents

Quick Start Guide - PR Review Utility Phase 1

🚀 Get Started in 5 Minutes

Step 1: Configure BitBucket Access

  1. Go to BitBucket: Personal Settings → App Passwords
  2. Create new app password with permissions:
    • ✅ Pull requests: Read
    • ✅ Repositories: Read
  3. Copy the generated password

Step 2: Update Configuration

Edit appsettings.json:

{
  "BitBucket": {
    "BaseUrl": "https://api.bitbucket.org/2.0",
    "Workspace": "my-company",           // ← Your workspace name
    "Username": "john.doe",              // ← Your BitBucket username
    "AppPassword": "ATBBxxx..."          // ← Paste your app password
  }
}

Step 3: Run the Application

cd PRReviewUtility
dotnet restore
dotnet run

Step 4: Test It Out

  1. Open browser: http://localhost:5000
  2. Enter a repository name (e.g., my-backend-api)
  3. Enter a PR ID (e.g., 42)
  4. Click Fetch Diff
  5. Review the changes!

📋 What You Can Do (Phase 1)

View PR Details

  • Title, author, branches
  • Creation date, status
  • Files changed count

Browse Changed Files

  • See all modified, added, deleted files
  • View additions/deletions per file
  • Expand individual file diffs

View Raw Diff

  • Unified diff format
  • Copy to clipboard
  • Ready for AI tools

Export for AI Review

  • Download as .txt file
  • Includes PR metadata
  • Full diff in unified format
  • Paste directly into ChatGPT/Claude

🔧 Finding Your Repository Slug

The repository slug is the last part of your BitBucket URL:

https://bitbucket.org/workspace-name/my-repo-slug
                                      ^^^^^^^^^^^^
                                      Use this!

📝 Example Workflow

  1. Developer creates PR #123 in repository backend-api
  2. Reviewer opens PR Review Utility
  3. Enter:
    • Repository: backend-api
    • PR ID: 123
  4. Review the diff in the web interface
  5. Export diff as .txt file
  6. Paste into AI tool (ChatGPT, Claude, etc.) with prompt:
    Please review this pull request diff and identify:
    - Potential bugs
    - Security issues
    - Code quality concerns
    - Performance improvements
    

🎯 Coming in Phase 2

  • 📋 Custom review rules per repository
  • 🚫 Auto-ignore files (generated code, dependencies)
  • ✅ Review checklists
  • 📝 JSON-based configuration

🎯 Coming in Phase 3

  • 🤖 Direct AI integration
  • 💡 Automated review suggestions
  • 📊 Smart token management
  • 🔄 Batch processing

❓ Common Issues

401 Unauthorized → Check your username and app password in appsettings.json

404 Not Found → Verify repository slug and PR ID are correct

No diff displayed → Check browser console (F12) for JavaScript errors

📚 API Usage

For automated scripts:

# Get PR details
curl http://localhost:5000/api/pr/my-repo/42

# Get diff
curl http://localhost:5000/api/pr/my-repo/42/diff

# Download diff file
curl -o pr-diff.txt http://localhost:5000/api/pr/my-repo/42/export

💡 Tips

  • Bookmark frequently reviewed repos in your browser
  • Export diffs for offline AI review
  • Use raw diff for manual analysis tools
  • Check file list first before viewing full diff

Ready for Phase 2? We'll add rule-based filtering next! 🎉