Skip to content

Getting started

Requirements

  • Drupal 11.4 or later within Drupal 11.x.
  • The PHP Sodium extension.
  • AI 1.4.8 or later within AI 1.x, Key 1.22 or later within Key 1.x, and highlight.php 1.0.4 or later within 1.x.
  • AI Provider OpenAI, configured with its Key, for OpenAI profile registration.
  • AI Code Review Server exposing its authenticated v1 review job API over HTTPS, with asynchronous workers running.
  • A service token authorized to access that server.

Drupal 12 is not supported while the AI, Key, and highlight.php dependencies do not all support it. AI 2.x is not declared compatible with this Function Call integration.

Install the module

The first alpha release is being prepared. After 1.0.0-alpha1 is published, install that version explicitly:

composer require drupal/ai_code_review_ui:1.0.0-alpha1

Until then, the current development package is available:

composer require drupal/ai_code_review_ui:1.x-dev

The development package currently uses Composer source fallback because its metadata provides no distribution archive. See the repository validation guidance for public CI evidence and local testing guidance.

Enable AI Code Review UI and its AI, Key, and highlight.php dependencies on the UI site. No extra integration submodule or Server extension is required there. For general guidance, see Installing Drupal Modules.

This is a new module for clean installations. It does not read or migrate the earlier GPT Code Reviewer module's configuration, entities, or routes. Keep an existing installation and its data intact; any transfer needs a separate reviewed migration plan.

Connect to the review server

  1. Create a Key for the client-to-server service token. Use a file or environment key provider so the secret is not exported with Drupal configuration.
  2. Open /admin/config/services/ai_code_review_ui/settings.
  3. Enter the server's HTTPS base URL and select the service-token Key. The server must expose /api/ai-code-review/v1. A deployment token set in settings.php as ai_code_review_ui.service_token is also supported.
  4. Configure the API timeout and maximum response size as appropriate.

The Server service account needs Access AI Code Review Server API and Manage AI Code Review Provider Profiles. It also needs Submit AI Code Review Policies when reviewers use named policies. If the account cannot submit policy instructions, set the default policy to None and choose None for each review.

The settings page has Settings, Review policies, and Review provider profiles tabs. Continue with provider profiles to register a review model, then submit a review.

Configure report highlighting

At /admin/config/content/highlight-php, select manual language mode and keep the default language-([a-zA-Z1-9]*) expression. This enables explicit PHP, Python, and diff highlighting. Existing site settings are not changed automatically.