ReviewAI Gerrit Plugin
Note
TL;DR - ReviewAI is a Gerrit plugin by Amarula Solutions that brings AI-powered code review to the Gerrit change page through a sidebar chat interface, supporting automatic Patch Set reviews, follow-up conversations, and multiple AI provider backends. - Licensed under Apache 2.0, supporting OpenAI, DeepSeek, Gemini, Ollama, and MoonShot via LangChain, with specialized review agents for correctness, testability, code quality, documentation, and security.
What is ReviewAI?
ReviewAI is an Apache 2.0-licensed Gerrit plugin that integrates an AI-powered code review assistant directly into the Gerrit UI. It provides a sidebar chat interface on the change page where developers can ask questions about Patch Sets, trigger automatic reviews, and maintain per-review conversation history.
Originally forked from xielong/chatgpt-code-review-gerrit-plugin, Amarula Solutions has evolved it into a multi-provider, multi-agent review platform with 587+ commits of development.
Multi-Provider Backend
ReviewAI supports multiple AI providers through LangChain: OpenAI, DeepSeek, Google Gemini, MoonShot, and Ollama (local, self-hosted). Users select provider and model combinations from a sidebar dropdown. Tokens are configured per-provider and can be stored in Gerrit’s
secure.config.
Specialized Review Agents
Three agent modes provide increasing sophistication:
Single Agent — one AI reviewer evaluates the entire Patch Set
Scoped Agents — separate agents for code changes and commit messages
Specialized Agents — dedicated agents for correctness, testability, code quality, documentation, and security (from the Sashiko project)
On-Demand Code Context
When configured, the AI can request repository context via tool calls: file listing, reference search, and file reading — providing deeper understanding beyond just the patch diff.
How It Works
A Patch Set is submitted to Gerrit.
ReviewAI formats the changed code with configurable context lines and sends it to the selected AI provider.
The AI returns a structured JSON response parsed into Gerrit comments (patch-set-level and inline).
A
Code-Reviewvote is optionally cast.Developers can continue the conversation via Gerrit comments by mentioning the AI user (
@{gerritUserName}) or through the sidebar chat.
ReviewAI also supports topic-aware review — grouping related Patch Sets by topic for a unified AI review across a series.
Features at a Glance
Sidebar Chat |
Full conversation interface embedded in the Gerrit change page |
Automatic Review |
AI reviews every Patch Set on submission, posting comments and optionally casting votes |
Slash Commands |
|
Multi-Provider |
OpenAI, DeepSeek, Gemini, MoonShot, Ollama via LangChain |
Model Selection |
Select provider/model from the sidebar dropdown |
Specialized Agents |
Correctness, testability, code quality, documentation, security agents from the Sashiko project |
Directives System |
Mandatory plain-English review instructions, configurable globally, per-project, or dynamically |
Comment Filtering |
Relevance-based filtering of AI comments with configurable threshold (default 0.6) |
Code Context |
|
ZDR Mode |
Zero Data Retention for OpenAI — uses local plugin memory instead of server-side conversation storage |
Secure Config |
API tokens stored in |
ReviewAI sidebar chat interface embedded in the Gerrit change page
AI-generated Patch Set review results with inline comments
Provider and model selection from the sidebar dropdown
Follow-up conversation through the ReviewAI sidebar
AI comments and Code-Review vote visible in the Gerrit change log
Getting Started
Requirements
JDK 21 and Bazel (Bazelisk recommended)
Gerrit compatible with the plugin’s Bazel external deps
API tokens for at least one AI provider
Build from Source
git clone https://github.com/amarula/reviewai-gerrit-plugin.git
cd reviewai-gerrit-plugin
# Link into a Gerrit checkout
cd gerrit/plugins
ln -s /path/to/reviewai-gerrit-plugin .
# Build
cd ../..
bazelisk build plugins/reviewai-gerrit-plugin:reviewai-gerrit-plugin
# Development build (includes admin/debug features)
bazelisk build plugins/reviewai-gerrit-plugin:reviewai-gerrit-plugin-dev
Installation
Upload the built JAR to $gerrit_site/plugins/ and restart Gerrit.
Configuration
Set up in $gerrit_site/etc/gerrit.config under
[plugin "reviewai-gerrit-plugin"]:
Parameter |
Description |
|---|---|
|
Gerrit username of the AI bot user (required) |
|
Provider tokens, e.g. |
|
Provider routes to expose (default: |
|
Specific model routes by provider |
|
Enable automatic review (default: |
|
Allow AI to cast Code-Review votes (default: |
|
|
|
Max lines included in review (default: |
|
|
|
File types to include in reviews |
|
Mandatory review instructions (repeatable) |
For the complete configuration reference, see the README.
Key Configuration Parameters
Setting |
Purpose |
|---|---|
|
Custom API endpoint (overrides provider defaults) |
|
Temperature for Patch Set reviews (default: 0.2) |
|
Also review commit messages (default: true) |
|
Context lines around changes (default: 3) |
|
Max tokens in conversation memory (default: 16K) |
|
Ollama server endpoint (default: |
|
Minimum relevance score for AI comments (default: 0.6) |
Testing
bazelisk test plugins/reviewai-gerrit-plugin:reviewai_tests
bazelisk test plugins/reviewai-gerrit-plugin:reviewai_tests \
plugins/reviewai-gerrit-plugin:reviewai_dev_tests
Why Amarula Maintains This
Amarula Solutions runs Gerrit-based code review across all development workflows — from embedded Linux BSPs and kernel drivers to Jenkins pipelines and Flutter applications. ReviewAI reduces review latency, catches issues early, and provides a consistent first-pass analysis before human reviewers engage.
The plugin has been extensively tested in production environments and evolved through real-world feedback into a mature, multi-provider AI review platform.
License and Attribution
License: Apache License, Version 2.0
Repository: amarula/reviewai-gerrit-plugin
Upstream: Forked from xielong/chatgpt-code-review-gerrit-plugin
Tip
Want AI-powered code review in your Gerrit workflow? Amarula Solutions provides ReviewAI deployment, custom directive configuration, and multi-provider AI integration for on-premise Gerrit instances. Contact us