Skip to main content
Version: 1.9.0

AI Code Review

Use the SDLC-Ainergy integration to perform initial code review with AI in the connected Git repositories.

For the integration to work, both SDLC and Ainergy applications need to be installed on your instance, and the Git integration needs to be active. There also needs to be an active profile settings record with the completed Connect field.

caution

The prompt used by the integration is in Russian, and if you want the Ainergy to add comments in English, you need to edit the prompt in all instances of the Developer Panel widget. To do so, complete the following steps:

  1. Navigate to Portal Structure → Widget Instances.
  2. Use search to find the Developer Panel widget instances. Open one of them. You can view the table on the form of which this widget instance is located in the UI Form Elements related list.
  3. Edit the value of the Schema option values field: find the Все комментарии — на русском; text and replace it with Все комментарии — на английском;.
  4. Do not change any other parts of the prompt: this could cause errors. Save the record.
  5. Repeat steps 2-4 for all instances of the Developer Panel widget to ensure the comments are added in English to tasks of all types.

Use the integration


tip

You can perfom the AI code review of the tasks that you are allowed to edit.

To review the code with AI, complete the following steps:

  1. Open the form of the task whose merge request needs to be reviewed. Note that you can only review Open merge requests.
  2. Switch to the Developer Panel tab and there select Merge requests.
  3. Move the pointer over an Open merge request and click the icon that appears:

Developer panel - AI code review

  1. Wait for the AI to process the request and perform the code review. Do not close the page. The AI code review action will remain unavailable until the process is completed. You will see a toast message when the review is done.

    • If code defects were found during the review, comments marked with AI Assistant will be added to the merge request in GitLab.
    • If no code defects were found during the review, you will see a corresponding toast message.
    • If errors occur, use the table below to find the solution.
    note

    Due to the difficulties in calculating the position of the comments, some of them might be located one or two lines higher or lower than the code they refer to.

Possible errors


If errors occur when you work with the integration, use the table below to find the solution.

Error textDescription

Error when reviewing the code in the !{number} merge request.

View AI message
An error occurred in the work of the AI. Open the AI message via the link from the toast message for more details.
Failed to connect to the AI model from the configurationCheck the value of the sdlc.ai_chat.nexus system property: it might be incorrect or contain a nexus that is not of the Chat type.
Comment publication error in the !{number} merge request. Contact administrator.The review has been completed successfully, but an error occurred during the publication of the comments. View the error message in the Main Log for more details.
Incorrect prompt. Configure the Developer Panel widget instance.Check the Schema option values field value of the Developer Panel widget instance. There are two methods to do that. First method:
  1. Navigate to Portal Structure → Widget Instances.
  2. Use search to find the Developer Panel widget instance located on the form of the required task type. You can view the table on the form of which this widget instance is located in the UI Form Elements related list.
  3. Check the Schema option values configuration.
Second method:
  1. On the task form where the error occurred, in the burger menu select Configure → Form → Layout.
  2. In the Section part, select Developer Panel.
  3. In the Selected part, click the icon next to the Developer Panel widget.
  4. In the Configure the value of the widget options modal window that opens, check the schema option value configuration. Note that in this modal window, the prompt is in Unicode.
To avoid this error, we recommend not changing the prompt more than what is described in the caution at the beginning of this article. If you have changed the prompt and want to return a previous value, use the VCS Records related list on the widget instance form.
No changes to be reviewed in the !{number} merge requestThe merge request that you wanted to review is empty. Before initiating the review, ensure that the changes have been committed to the correct branch in GitLab.
Failed to fetch the data from Gitlab. Contact administrator.An error occurred in GitLab. View the error message in the Main Log for more details.

Incorrect or no positioning parameters for comments.

View AI message
The AI response is incorrect. Try again.