This project provides automated code review for GitLab merge requests using AI to analyze code quality.
The automated code review analyzes each changed file in merge requests for:
Bugs and Logical Errors
Security Vulnerabilities
Performance Issues
Configure GitLab CI/CD variables:
GITLAB_TOKEN: Your GitLab API tokenOPENAI_API_KEY: Your OpenAI API keyOPENAI_MODEL: The OpenAI model to use (defaults to gpt-4)OPENAI_BASE_URL: (Optional) URL for Ollama API endpoint, e.g., http://localhost:11434/v1PROXY: (Optional) HTTP/HTTPS proxy URL for connecting to OpenAI or Ollama, e.g., http://proxy.example.com:8080Add the .gitlab-ci.yml to your repository
Create a merge request to see the automated review in action
This project supports using Ollama as an alternative to OpenAI's API:
OPENAI_BASE_URL environment variable to point to your Ollama instance (e.g., http://localhost:11434/v1)If you need to connect to OpenAI API or Ollama through a proxy:
PROXY environment variable to your proxy URL (e.g., http://proxy.example.com:8080 or http://username:[email protected]:8080)The code review runs automatically on all merge requests. It will:
# Install dependencies
npm install
# Run code review locally
npm run code-review
npm run code-review: Run the code quality reviewnpm run analyze: Analyze merge request changesnpm run validate: Validate merge request sizenpm run debug: Debug GitLab configurationContent type
Image
Digest
sha256:510588eaa…
Size
85.3 MB
Last updated
over 1 year ago
docker pull coderz/ai-code-review