CodeRabbit Reference
CodeRabbit Reference
AI Code Review Pull RequestsOverview
CodeRabbit เป็น AI code review bot ที่ review pull requests โดยอัตโนมัติ — มันวิเคราะห์ diff, ให้ inline comments, ตรวจหา bug/security issues, และสรุปการเปลี่ยนแปลง เพื่อประหยัดเวลา review ของมนุษย์
PR opened → CodeRabbit analyzes diff → inline comments + summaryWhen to Use
- ต้องการ automated review ก่อน merge ทุก PR
- ต้องการจับ bug, security issues, และ best-practice violations
- ต้องการขอ feedback เกี่ยวกับ code ที่คุณยังไม่แน่ใจ
- reviews หลายๆ PR ที่เล็กและซ้ำกัน
When NOT to Use:
- review ที่ต้องใช้ความเข้าใจ business context ระดับลึกด้วยตัวเอง
- ขั้นตอนที่ต้อง decision ทางสถาปัตยกรรมใหญ่ (เอาไว้ให้มนุษย์ตัดสิน)
Key Features
| Feature | Description |
|---|---|
| Inline comments | comment ตรงบรรทัดที่เจอปัญหาใน PR |
| Security analysis | ตรวจจับ vulnerabilities / hardcoded secrets |
| PR summary | สรุปการเปลี่ยนแปลง, impact, และ test suggestions |
| Auto-generated walkthrough | อธิบาย diff เป็นภาษาเข้าใจง่าย |
| CI/CD integration | ทำงานใน GitHub Actions / GitLab CI |
| Customizable | ตั้ง rules / config ตามโปรเจกต์ |
Basic Usage
CodeRabbit มักถูกว่าเป็น GitHub App — เปิดไว้ใน repository แล้วมันจะ review PR ที่เปิด:
# .coderabbit.yaml (example config)language: "en"early_access: falsereviews: profile: "best" request_changes_workflow: falseภายใน PR:
@coderabbitai review # ขอ full review@coderabbitai summary # สรุป PR@coderabbitai full_review # review แบบลึกCommon Workflows
1. Automated Review on Every PR
on: [pull_request]jobs: review: runs-on: ubuntu-latest steps: - uses: coderabbitai/ai-review@main2. Ask a Targeted Question
@coderabbitai "Is this SQL safely parameterized?"3. Get a Security Pass
@coderabbitai securityTips
- Treat bot reviews as a first pass, not the final word — human reviews still own architecture decisions.
- Fix the class, not the instance — if the bot flags a pattern, fix it everywhere, not just one spot.
- Configure severity — tune what triggers “request changes” vs. a comment.
- Verify security claims — the bot is a triage aid; confirm before shipping.