Skip to content

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:

  1. Check Docker and Docker Compose versions

    docker --version
    docker compose version
    
    Ensure Docker 20.10+ and Docker Compose v2 are installed.

  2. View container logs

    docker compose logs backend
    docker compose logs frontend
    

  3. Check port occupancy

    # Check if ports are occupied
    lsof -i :3000  # Frontend port
    lsof -i :8000  # Backend port
    lsof -i :6379  # Redis port
    

  4. 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:

  1. Copy the example file:

    cp .env.example .env
    

  2. Edit the .env file and configure necessary variables:

  3. VITE_API_BASE_URL: Frontend API base URL
  4. VITE_DEV_PROXY_TARGET: Development environment proxy target
  5. Other necessary configuration items

  6. Restart services to apply configuration:

    docker compose restart
    

πŸ”§ Configuration

Q3: How to configure GitLab Webhook?

Configuration Steps

Configuration steps:

  1. Get Webhook URL
  2. Format: http://your-domain.com/api/webhook/gitlab/
  3. Note: URL must end with /api/webhook/gitlab/

  4. Configure Webhook in GitLab project

  5. Go to Project Settings β†’ Webhooks
  6. Fill in Webhook URL
  7. Select trigger events: Merge Request events, Push events, etc.
  8. Save configuration

  9. Enable project review in the system

  10. Log in to the system management interface
  11. Go to project list
  12. 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:

  1. Check if project review is enabled
  2. Confirm that review_enabled status in project list is enabled
  3. Confirm that auto_review_on_mr option is enabled

  4. Check Webhook configuration

  5. Confirm GitLab Webhook URL is configured correctly
  6. Confirm Webhook events are selected correctly
  7. Check Webhook logs to confirm if requests are received

  8. Check Webhook event rules

  9. Confirm the project has enabled corresponding Webhook event rules
  10. Check Webhook Logs to confirm if events are correctly identified

  11. View system logs

    docker compose logs -f backend
    

Q5: Code review results are not sending notifications?

Troubleshooting Steps

Troubleshooting steps:

  1. Check notification channel configuration
  2. Confirm notification channel is created and status is active
  3. Confirm project is associated with notification channel
  4. Check if notification channel configuration information is correct

  5. Check review status

  6. View review records, confirm review status is completed
  7. Check notification_sent field status
  8. View error information in notification_result field

  9. Test notification channel

  10. Manually test notification channel in management backend
  11. Check network connection and API key validity

Q6: How to view code review history?

Viewing Methods

There are multiple ways to view:

  1. Through frontend interface
  2. Log in to system frontend interface
  3. Go to "Review Records" page
  4. Can filter by project, time range, etc.

  5. Through management backend

  6. Access http://localhost:8000/admin/
  7. Go to Merge Request Reviews menu
  8. View all review records

  9. View detailed logs

  10. Go to "Logs" page to view detailed processing logs
  11. 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:

  1. Check Webhook Secret Token
  2. If Secret Token is configured, ensure the system side also has the same Token configured

  3. Check GitLab Token permissions

  4. Confirm GitLab Token has sufficient permissions to access the project
  5. Confirm Token is not expired

  6. Check firewall and network

  7. Confirm server can access GitLab
  8. Confirm GitLab can access Webhook URL

  9. View request logs

  10. View detailed request headers and error information in Webhook Logs

Q8: System runs slowly or times out?

Optimization Suggestions

Optimization suggestions:

  1. Check resource usage

    docker stats
    

  2. Optimize LLM calls

  3. Use faster models
  4. Reduce number of files to review
  5. Configure reasonable timeout

  6. Database optimization

  7. Regularly clean up old log records
  8. Add indexes to frequently queried fields

  9. Increase resources

  10. Increase container memory limits
  11. Use more powerful servers

πŸ“š Other Questions

Q9: How to upgrade to a new version?

Upgrade Steps

Upgrade steps:

  1. Backup current data

    # Backup database and configuration
    cp backend/db.sqlite3 backend/db.sqlite3.backup
    cp .env .env.backup
    

  2. Pull latest code

    git pull origin main
    

  3. Update dependencies

    docker compose down
    docker compose build --no-cache
    docker compose up -d
    

  4. 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:

  1. Report issues
  2. Submit issues in GitHub Issues
  3. Provide detailed error information and reproduction steps

  4. Submit code

  5. Fork the project
  6. Create a feature branch
  7. Submit Pull Request

  8. Contact maintainers

  9. Email: mixuxin@163.com
  10. WeChat: isxuxin

πŸ’‘ Tips

If none of the above questions solve your problem, please:

  1. Check project GitHub Issues
  2. View detailed system logs
  3. Contact project maintainers for help

Enjoy using! πŸŽ‰