Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

AI Review Assistant can be integrated with any AI Provider offering a

  • JSON REST based API

  • A chat (message based) completion features.

Examples of such providers are ChatGPT, Azure OpenAI, Google AI Gemini, Claude.ai or Ollama.

Step 2: Configure the AI Provider at the repository level

Follow the guide corresponding to your AI provider

Step 3 (Optional): Configure Custom Prompts

Custom prompts give you more flexibility to tailor AI Review Assistant to the needs of your repository. See the dedicated page to Custom Prompts configuration.

...

Usage - Suggest pull request title and description

On the create pull request page, you can use the AI Review Assistant to suggest a title and description

...

A spinner will show while waiting for the AI response. Once the suggestion is ready, text fields will appear for you to inspect and apply the suggestion.

...

Usage - Chat with AI Review Assistant through comments

You can interact with the AI Review Assistant directly in your pull request. To do so, write a comment in the view of your pull request starting by /aira (short for AI Review Assistant) followed by your question for the AI. The AI service will receive the information related to your pull request (current title, description, commit titles, the diff and comments of the existing thread), followed by your question.

Once ChatGPT the AI provider has answered, AI Review Assistant will post a reply to your comment.

...

It is possible to have the AI Review Assistant perform reviews of your pull requests automatically. To achieve that, you need to configure your pull request to create an automatic comment. This comment should begin with the standard /aira prefix, followed by a question requesting a review. You can accomplish this in two ways: by utilizing Default tasks from Bitbucket, or using the Checklist Buddy plugin for Bitbucket.

Additionally, if you configure custom prompt templates (see examples), you can build a suite of finely-tuned automations.

Using Default tasks

  1. In your repository settings, go to Default tasks

  2. Click on Add a default task.

  3. Fill in the Default task description with a prompt starting by /aira (and optionally the slug of a preconfigured custom prompt template).

See figure below for an example.

...

The AI Review Assistant will address all tasks and comments that begin with /aira (and optionally the slug of a preconfigured custom prompt template). Below is an example of a PRCHECKLIST file:

...

Upon creation of a pull request to the main branch, these comments will be created, and AI Review Assistant will respond like in the image below.

...

Example prompts

As any tool based on ChatGPT (or similar technologies), you can ask about anything and it will respond. However, it takes a bit of practice to know how to ask questions the right way. These questions are called prompts in the context of AI. Let’s walk through examples that have brought success in our usage.

1. Ask about facts

AI Review Assistant will be good at scanning your pull requests for particular facts that a human can easily double-check. The following questions can be applied automatically to any pull request.

  1. /aira Make a list of all files and line numbers where there is a password in plain-text in this Pull Request

  2. /aira Make a list of all files and line numbers where PII information might leak from the code in this Pull Request

  3. /aira Make a list of any inconsistencies between inline comments in the code, and the implementation, or the description of this Pull Request?

2. Ask about help understanding the pull request

AI Review Assistant can also help the reviewers to understand a particular piece of code that was changed. The following questions can be applied by a human directly on the source code file

  1. /aira Please write the steps of the algorithm implementing this function <name of the function>

  2. /aira Please list the places where this new class <name of the class> is used in this pull request

3. Ask about generating new content

AI Review Assistant can also generate code related to the pull request, which can then be added to it.

...

/aira Please write another test case that is relevant to the implementation of this function <name of the function>

...

Read more in our guide Example Prompts by Use Case which talks through how to create specialist prompts for the AI Review Assistant that help with common pull request review tasks.

...

FAQ

How can I disable AI Review Assistant for my Bitbucket Instance?

...

How can I disable AI Review Assistant for a repository?

There is no toggle to disable AI Review Assistant Disable AIRA for a repository. However, if you do not configure the assistant (by not filling the token information), then it will be effectively disabled, and no data will be shared to the AI API.If you previously configured AI Review Assistant, you can remove the token by saving the configuration with an empty tokenspecific repository by going to the Code Review Assistant settings page in your repository, and set the Enable Assistant toggle to disabled.

You can’t enable AIRA for a repository if it is disabled globally.

Who can use AI Review Assistant on a pull request?

...

First, try to refresh the page. AI Review Assistant responds to Pull Request comments, and those are not refreshed automatically. If the response is still not there, please check the following things.

Verify that AIRA reacted to your comment with a 👀 emoji. If the emoji is not there, then something is wrong and you should contact an Administrator.

Sometimes the AI Review Assistant can take a bit of time to answer (up to 2 minutes). Past that time, you should see a message saying that it took too much time.

...