|
| 1 | +--- |
| 2 | +title: "PR Review Agent" |
| 3 | +sidebarTitle: "PR Review" |
| 4 | +icon: "eye" |
| 5 | +--- |
| 6 | + |
| 7 | +Codegen agents automatically review your pull requests, providing intelligent feedback, suggestions, and code analysis to improve code quality and catch issues before they reach production. |
| 8 | + |
| 9 | +This intelligent system analyzes code changes, identifies potential problems, and provides actionable feedback to help maintain high code quality standards. |
| 10 | + |
| 11 | +<Card |
| 12 | + title="Configure PR Reviews" |
| 13 | + icon="eye" |
| 14 | + href="https://codegen.com/settings/review" |
| 15 | +> |
| 16 | + Configure PR review settings at the organization level or customize per |
| 17 | + repository. Set review criteria, feedback preferences, and integration |
| 18 | + options. |
| 19 | +</Card> |
| 20 | + |
| 21 | +<Tip> |
| 22 | + The PR Review Agent provides comprehensive code analysis including security |
| 23 | + vulnerabilities, performance issues, code style violations, and logical |
| 24 | + errors. |
| 25 | +</Tip> |
| 26 | + |
| 27 | +## How PR Review Works |
| 28 | + |
| 29 | +Codegen automatically reviews your pull requests with intelligent analysis: |
| 30 | + |
| 31 | +- **Automatic Triggering:** Monitors new pull requests and code changes in real-time |
| 32 | +- **Comprehensive Analysis:** Reviews code for bugs, security issues, performance problems, and style violations |
| 33 | +- **Contextual Feedback:** Provides specific, actionable suggestions with line-by-line comments |
| 34 | +- **Integration Aware:** Understands your codebase patterns, dependencies, and architectural decisions |
| 35 | + |
| 36 | +## What Triggers PR Review |
| 37 | + |
| 38 | +PR review activates when: |
| 39 | + |
| 40 | +- **New Pull Requests:** Any new PR opened in monitored repositories |
| 41 | +- **Code Updates:** New commits pushed to existing pull request branches |
| 42 | +- **Review Requests:** Manual review requests through GitHub or other integrations |
| 43 | +- **Scheduled Reviews:** Periodic reviews of long-running or draft pull requests |
| 44 | + |
| 45 | +## The Review Process |
| 46 | + |
| 47 | +When Codegen reviews a pull request, it follows this comprehensive process: |
| 48 | + |
| 49 | +1. **Code Analysis:** Deep analysis of all changed files and their context |
| 50 | +2. **Pattern Recognition:** Identifies common issues, anti-patterns, and potential bugs |
| 51 | +3. **Security Scanning:** Checks for security vulnerabilities and sensitive data exposure |
| 52 | +4. **Performance Review:** Analyzes code for performance bottlenecks and optimization opportunities |
| 53 | +5. **Style Compliance:** Ensures code follows established style guides and best practices |
| 54 | +6. **Contextual Feedback:** Generates specific, actionable comments and suggestions |
| 55 | + |
| 56 | +## Review Categories |
| 57 | + |
| 58 | +The PR Review Agent analyzes multiple aspects of your code: |
| 59 | + |
| 60 | +### Code Quality |
| 61 | + |
| 62 | +- **Logic Errors:** Identifies potential bugs and logical inconsistencies |
| 63 | +- **Code Complexity:** Highlights overly complex functions that need refactoring |
| 64 | +- **Maintainability:** Suggests improvements for code readability and maintainability |
| 65 | +- **Best Practices:** Ensures adherence to language and framework best practices |
| 66 | + |
| 67 | +### Security Analysis |
| 68 | + |
| 69 | +- **Vulnerability Detection:** Scans for common security vulnerabilities (SQL injection, XSS, etc.) |
| 70 | +- **Sensitive Data:** Identifies potential exposure of secrets, API keys, or personal data |
| 71 | +- **Access Control:** Reviews authentication and authorization implementations |
| 72 | +- **Dependency Security:** Checks for known vulnerabilities in dependencies |
| 73 | + |
| 74 | +### Performance Optimization |
| 75 | + |
| 76 | +- **Algorithmic Efficiency:** Identifies inefficient algorithms and data structures |
| 77 | +- **Resource Usage:** Reviews memory usage, database queries, and API calls |
| 78 | +- **Caching Opportunities:** Suggests areas where caching could improve performance |
| 79 | +- **Scalability Concerns:** Highlights potential bottlenecks for high-traffic scenarios |
| 80 | + |
| 81 | +## Configuration Options |
| 82 | + |
| 83 | +The PR Review Agent can be configured at multiple levels: |
| 84 | + |
| 85 | +### Organization Level |
| 86 | + |
| 87 | +- **Global settings** - Configure default review behavior for all repositories |
| 88 | +- **Review criteria** - Set standards for code quality, security, and performance |
| 89 | +- **Access via** - Organization Settings → PR Review |
| 90 | + |
| 91 | +### Repository Level |
| 92 | + |
| 93 | +- **Per-repo customization** - Tailor review settings for specific repositories |
| 94 | +- **Language-specific rules** - Configure rules based on programming languages used |
| 95 | +- **Integration preferences** - Choose how and where review feedback is delivered |
| 96 | +- **Access via** - Repository Settings → PR Review |
| 97 | + |
| 98 | +### Team Preferences |
| 99 | + |
| 100 | +- **Review thoroughness** - Adjust detail level from basic to comprehensive |
| 101 | +- **Feedback style** - Choose between concise suggestions or detailed explanations |
| 102 | +- **Priority focus** - Emphasize security, performance, or code quality based on team needs |
| 103 | + |
| 104 | +## GitHub Integration |
| 105 | + |
| 106 | +The PR review system integrates seamlessly with GitHub: |
| 107 | + |
| 108 | +- **Inline Comments:** Provides specific feedback on individual lines of code |
| 109 | +- **Review Summaries:** Creates comprehensive review summaries with overall assessment |
| 110 | +- **Status Checks:** Integrates with GitHub's review system and status checks |
| 111 | +- **Approval Workflow:** Can be configured to require addressing feedback before merging |
| 112 | + |
| 113 | +## Benefits |
| 114 | + |
| 115 | +- **Improved Code Quality:** Consistent, thorough reviews catch issues early in the development process |
| 116 | +- **Knowledge Sharing:** Reviews help team members learn best practices and coding standards |
| 117 | +- **Security Enhancement:** Automated security scanning reduces vulnerability risks |
| 118 | +- **Faster Reviews:** Reduces time spent on manual code reviews while maintaining quality |
| 119 | +- **Continuous Learning:** The system learns from your codebase and improves over time |
| 120 | + |
| 121 | +<Note> |
| 122 | + PR Review Agent only activates for repositories where Codegen has read access |
| 123 | + and the feature is enabled. It respects your repository permissions and review |
| 124 | + workflows. |
| 125 | +</Note> |
0 commit comments