Frequently Asked Questions (FAQ)
This document collects common questions and solutions for the Code Review GPT Gitlab project.
π¦ Installation & Deployment
Q1: What should I do if Docker containers fail to start?
Solution
Please follow these steps to troubleshoot:
-
Check Docker and Docker Compose versions
Ensure Docker 20.10+ and Docker Compose v2 are installed.docker --version docker compose version -
View container logs
docker compose logs backend docker compose logs frontend -
Check port occupancy
# Check if ports are occupied lsof -i :3000 # Frontend port lsof -i :8000 # Backend port lsof -i :6379 # Redis port -
Rebuild and start
docker compose down docker compose up -d --build
Q2: How to configure environment variables?
Configuration Steps
The project uses .env file to manage environment variables:
-
Copy the example file:
cp .env.example .env -
Edit the
.envfile and configure necessary variables: VITE_API_BASE_URL: Frontend API base URLVITE_DEV_PROXY_TARGET: Development environment proxy target-
Other necessary configuration items
-
Restart services to apply configuration:
docker compose restart
π§ Configuration
Q3: How to configure GitLab Webhook?
Configuration Steps
Configuration steps:
- Get Webhook URL
- Format:
http://your-domain.com/api/webhook/gitlab/ -
Note: URL must end with
/api/webhook/gitlab/ -
Configure Webhook in GitLab project
- Go to Project Settings β Webhooks
- Fill in Webhook URL
- Select trigger events:
Merge Request events,Push events, etc. -
Save configuration
-
Enable project review in the system
- Log in to the system management interface
- Go to project list
- Find the corresponding project and enable code review functionality
π Usage
Q4: What should I do if code review doesn't trigger automatically?
Troubleshooting Steps
Please check the following:
- Check if project review is enabled
- Confirm that
review_enabledstatus in project list is enabled -
Confirm that
auto_review_on_mroption is enabled -
Check Webhook configuration
- Confirm GitLab Webhook URL is configured correctly
- Confirm Webhook events are selected correctly
-
Check Webhook logs to confirm if requests are received
-
Check Webhook event rules
- Confirm the project has enabled corresponding Webhook event rules
-
Check
Webhook Logsto confirm if events are correctly identified -
View system logs
docker compose logs -f backend
Q5: Code review results are not sending notifications?
Troubleshooting Steps
Troubleshooting steps:
- Check notification channel configuration
- Confirm notification channel is created and status is active
- Confirm project is associated with notification channel
-
Check if notification channel configuration information is correct
-
Check review status
- View review records, confirm review status is
completed - Check
notification_sentfield status -
View error information in
notification_resultfield -
Test notification channel
- Manually test notification channel in management backend
- Check network connection and API key validity
Q6: How to view code review history?
Viewing Methods
There are multiple ways to view:
- Through frontend interface
- Log in to system frontend interface
- Go to "Review Records" page
-
Can filter by project, time range, etc.
-
Through management backend
- Access
http://localhost:8000/admin/ - Go to
Merge Request Reviewsmenu -
View all review records
-
View detailed logs
- Go to "Logs" page to view detailed processing logs
- Can view logs of each step: Webhook reception, LLM calls, notification sending, etc.
π Troubleshooting
Q7: Webhook requests are rejected or return 403/401?
Possible Causes
Possible causes:
- Check Webhook Secret Token
-
If Secret Token is configured, ensure the system side also has the same Token configured
-
Check GitLab Token permissions
- Confirm GitLab Token has sufficient permissions to access the project
-
Confirm Token is not expired
-
Check firewall and network
- Confirm server can access GitLab
-
Confirm GitLab can access Webhook URL
-
View request logs
- View detailed request headers and error information in Webhook Logs
Q8: System runs slowly or times out?
Optimization Suggestions
Optimization suggestions:
-
Check resource usage
docker stats -
Optimize LLM calls
- Use faster models
- Reduce number of files to review
-
Configure reasonable timeout
-
Database optimization
- Regularly clean up old log records
-
Add indexes to frequently queried fields
-
Increase resources
- Increase container memory limits
- Use more powerful servers
π Other Questions
Q9: How to upgrade to a new version?
Upgrade Steps
Upgrade steps:
-
Backup current data
# Backup database and configuration cp backend/db.sqlite3 backend/db.sqlite3.backup cp .env .env.backup -
Pull latest code
git pull origin main -
Update dependencies
docker compose down docker compose build --no-cache docker compose up -d -
Execute database migration
docker compose exec backend python manage.py migrate
Q10: Which programming languages are supported?
Language Support
Theoretically supports all programming languages because:
- The system uses LLM for code review, and LLM itself supports multiple programming languages
- Does not depend on specific syntax analyzers
- Review quality depends on LLM model capabilities
Recommendations
Recommendations: - Mainstream languages (Python, JavaScript, Java, Go, etc.) have better review results - For special languages, customizing Prompt may be needed for better results
Q11: How to contribute code or report issues?
Welcome Contributions
Welcome contributions:
- Report issues
- Submit issues in GitHub Issues
-
Provide detailed error information and reproduction steps
-
Submit code
- Fork the project
- Create a feature branch
-
Submit Pull Request
-
Contact maintainers
- Email: mixuxin@163.com
- WeChat: isxuxin
π‘ Tips
If none of the above questions solve your problem, please:
- Check project GitHub Issues
- View detailed system logs
- Contact project maintainers for help
Enjoy using! π