Skip to content

coderabbitai/gerrit-ui-plugin

Repository files navigation

gerrit-ui-plugin

License

Gerrit UI Plugin for CodeRabbit

Features

  • Comment preview replacement — Replaces cryptic auto-generated bot comment previews with human-readable labels (e.g., "Code Review", "Summary by CodeRabbit") in the collapsed view
  • Gerrit Checks API integration — Surfaces CodeRabbit review results in Gerrit's Checks tab with status tracking (running, completed, skipped)
  • Severity classification — Categorizes inline comments as critical, major, or minor with color-coded tags
  • Review summary — Displays an at-a-glance summary with comment counts by severity
  • Copy AI prompts — One-click copy of AI agent prompts from CodeRabbit comments to clipboard
  • Deep links to findings — Each inline comment links directly to the relevant file and line in the diff view
  • Unresolved comment tracking — Shows unresolved bot comments from older patchsets alongside current ones
  • Auto-refresh — Automatically detects new comments and refreshes the Checks tab via MutationObserver
  • Configurable polling — Adjustable polling interval for Checks API updates

Screenshots

Review in progress

Review in progress

Completed review

Completed review

Checks UI

Checks UI

Checks UI with expanded issue

Checks UI with expanded issue

Installation

Prerequisites

  • SSH access to the Gerrit server on the admin port (default: 29418)
  • Membership in the Gerrit Administrators group
  • plugins.allowRemoteAdmin must be enabled in gerrit.config

Install from a GitHub release

Download the plugin directly from a release and install it:

ssh -p 29418 <gerrit-host> gerrit plugin install -n coderabbit-gerrit-plugin.js https://github.com/coderabbitai/gerrit-ui-plugin/releases/download/<tag>/coderabbit-gerrit-plugin.js

Install via SSH

From a local file path:

ssh -p 29418 <gerrit-host> gerrit plugin install -n coderabbit-gerrit-plugin.js $(pwd)/coderabbit-gerrit-plugin.js

From piped input:

ssh -p 29418 <gerrit-host> gerrit plugin install -n coderabbit-gerrit-plugin.js - < coderabbit-gerrit-plugin.js

Install manually

Copy the plugin file directly into the Gerrit site's plugins directory:

cp coderabbit-gerrit-plugin.js /path/to/gerrit/site/plugins/

Then restart Gerrit or reload plugins:

ssh -p 29418 <gerrit-host> gerrit plugin reload coderabbit-gerrit-plugin

Verify installation

ssh -p 29418 <gerrit-host> gerrit plugin ls

You should see coderabbit-gerrit-plugin in the list of loaded plugins.

Configuration

The plugin is configured via the CONFIG object at the top of coderabbit-gerrit-plugin.js. Edit these values before deploying.

Option Type Default Description
debug boolean false Enable debug logging to the browser console
enablePreviewReplacement boolean true Replace collapsed comment preview text with human-readable labels
enableChecksApi boolean true Register a Gerrit Checks API provider to surface review results in the Checks tab
enableCopyPrompts boolean true Add "Copy Prompt" actions to check results that contain AI agent prompts
checksPollingIntervalSeconds number 60 How often (in seconds) the Checks API polls for updated review results
botAccountName string "CodeRabbitAI Bot" Display name of the bot account used for Checks API comment filtering
targetUsers array See below List of bot users whose comment previews should be replaced

targetUsers entry

Each entry in targetUsers has:

Field Type Description
name string Display name to match against comment authors (case-insensitive, partial match)
phraseReplacements array List of { phrase, replacementText } pairs. When phrase is found in the comment body, the collapsed preview is replaced with replacementText
defaultReplacementText string (Optional) Fallback text when no phrase matches

Default phrase replacements

Phrase Replacement
This is an auto-generated comment: review in progress by coderabbit.ai Processing new changes in this PR
This is an auto-generated comment: release notes by coderabbit.ai Summary by CodeRabbit
walkthrough_start Code Review
This is an auto-generated comment by CodeRabbit for review status Actionable comments
This is an auto-generated comment: skip review by coderabbit.ai Review Skipped
This is an auto-generated reply by CodeRabbit Reply by CodeRabbit

License

Licensed under the Apache License 2.0.

About

Gerrit UI Plugin for CodeRabbit

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors