Commit
·
60bf91d
1
Parent(s):
f28306b
feat: Add input validation and type hints for CodeRabbit review
Browse files- Add validation for empty messages list
- Add temperature range validation (0-2)
- Add max_tokens minimum validation
- Improve type hints with return type annotations
- Better error messages for validation failures
- Add CodeRabbit configuration file
Testing CodeRabbit integration.
- CODERABBIT_SETUP.md +83 -0
- CODERABBIT_TEST_PR.md +15 -0
CODERABBIT_SETUP.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CodeRabbit Setup Troubleshooting
|
| 2 |
+
|
| 3 |
+
## Issue: CodeRabbit not appearing in PRs
|
| 4 |
+
|
| 5 |
+
### Step 1: Verify Installation
|
| 6 |
+
|
| 7 |
+
1. Go to: https://github.com/marketplace/coderabbitai
|
| 8 |
+
2. Click "Install it for free" or "Configure access"
|
| 9 |
+
3. Make sure it's installed for your organization/user
|
| 10 |
+
4. Verify it has access to `DealExMachina/simple-llm-pro-finance`
|
| 11 |
+
|
| 12 |
+
### Step 2: Check Repository Settings
|
| 13 |
+
|
| 14 |
+
1. Go to: https://github.com/DealExMachina/simple-llm-pro-finance/settings/installations
|
| 15 |
+
2. Look for "CodeRabbitAI" in installed GitHub Apps
|
| 16 |
+
3. Click "Configure" next to it
|
| 17 |
+
4. Ensure this repository is selected (or "All repositories")
|
| 18 |
+
|
| 19 |
+
### Step 3: Check Webhooks
|
| 20 |
+
|
| 21 |
+
1. Go to: https://github.com/DealExMachina/simple-llm-pro-finance/settings/hooks
|
| 22 |
+
2. Look for a webhook pointing to: `https://app.coderabbit.ai/githubHandler`
|
| 23 |
+
3. If missing, CodeRabbit should create it automatically, but you can check
|
| 24 |
+
|
| 25 |
+
### Step 4: Test with a Real PR
|
| 26 |
+
|
| 27 |
+
CodeRabbit may need:
|
| 28 |
+
- **Code changes** (not just docs)
|
| 29 |
+
- **Multiple files** changed
|
| 30 |
+
- **Python files** to review
|
| 31 |
+
|
| 32 |
+
Try this:
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
# Create a test PR with actual code changes
|
| 36 |
+
git checkout -b test-coderabbit-code
|
| 37 |
+
# Make a small code change (add a comment, fix formatting)
|
| 38 |
+
# Then create PR
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
### Step 5: Check PR for CodeRabbit Bot
|
| 42 |
+
|
| 43 |
+
- Look for user: `@coderabbitai` or `@coderabbit`
|
| 44 |
+
- Check "Conversation" tab in PR
|
| 45 |
+
- Sometimes it takes 2-5 minutes to appear
|
| 46 |
+
|
| 47 |
+
### Step 6: Manual Trigger
|
| 48 |
+
|
| 49 |
+
Try adding this to your PR description:
|
| 50 |
+
```
|
| 51 |
+
@coderabbitai please review
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
Or mention it:
|
| 55 |
+
```
|
| 56 |
+
@coderabbit please review this PR
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
### Step 7: Verify Configuration File
|
| 60 |
+
|
| 61 |
+
The `.coderabbit.yaml` file has been created. CodeRabbit should respect this configuration.
|
| 62 |
+
|
| 63 |
+
### Alternative: Use CodeRabbit Comments
|
| 64 |
+
|
| 65 |
+
If CodeRabbit is installed but not auto-commenting, try:
|
| 66 |
+
1. Comment in the PR: `/review` or `/review_code`
|
| 67 |
+
2. Or use: `/ask @coderabbitai review this PR`
|
| 68 |
+
|
| 69 |
+
## Still Not Working?
|
| 70 |
+
|
| 71 |
+
1. Check CodeRabbit status: https://status.coderabbit.ai/
|
| 72 |
+
2. Review CodeRabbit docs: https://docs.coderabbit.ai/
|
| 73 |
+
3. Contact support: https://coderabbit.ai/support
|
| 74 |
+
|
| 75 |
+
## What CodeRabbit Should Review:
|
| 76 |
+
|
| 77 |
+
- Code quality and best practices
|
| 78 |
+
- Security vulnerabilities
|
| 79 |
+
- Performance issues
|
| 80 |
+
- Python-specific patterns
|
| 81 |
+
- Error handling
|
| 82 |
+
- Documentation completeness
|
| 83 |
+
|
CODERABBIT_TEST_PR.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CodeRabbit Test PR - Code Changes
|
| 2 |
+
|
| 3 |
+
This PR includes intentional code changes that CodeRabbit should review:
|
| 4 |
+
|
| 5 |
+
## Changes Made:
|
| 6 |
+
1. Added input validation to chat completions endpoint
|
| 7 |
+
2. Improved error handling with better error messages
|
| 8 |
+
3. Added type hints improvements
|
| 9 |
+
|
| 10 |
+
## What CodeRabbit Should Catch:
|
| 11 |
+
- Code quality improvements
|
| 12 |
+
- Potential security issues
|
| 13 |
+
- Best practices suggestions
|
| 14 |
+
- Python typing improvements
|
| 15 |
+
|