GitLab Duo in merge requests

Tier: Ultimate Offering: GitLab.com Status: Experiment

AI-assisted features in merge requests are designed to provide contextually relevant information during the lifecycle of a merge request.

Additional information on enabling these features and maturity can be found in our GitLab Duo overview.

Summarize merge request changes

History

This feature is in Beta on GitLab.com.

GitLab Duo Merge request summaries can be added to your merge request description when creating or editing a merge request. To add a summary, select Summarize code changes. The generated summary is added to the merge request description where your cursor is.

merge_request_ai_summary_v16_11

Provide feedback on this feature in issue 443236.

Data usage: The diff of changes between the source branch’s head and the target branch is sent to the large language model.

Summarize my merge request review

History

This feature is an Experiment on GitLab.com.

When you’ve completed your review of a merge request and are ready to submit your review, generate a GitLab Duo Code review summary:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Merge requests and find the merge request you want to review.
  3. When you are ready to submit your review, select Finish review.
  4. Select Summarize my pending comments.

The summary is displayed in the comment box. You can edit and refine the summary prior to submitting your review.

Provide feedback on this experimental feature in issue 408991.

Data usage: When you use this feature, the following data is sent to the large language model referenced above:

  • Draft comment’s text

Fill in merge request templates

History

This feature is in Beta on GitLab.com.

Merge requests in projects often have templates defined that need to be filled out. This helps reviewers and other users understand the purpose and changes a merge request might propose.

When creating a merge request, GitLab Duo can generate a description for the merge request based on the contents of the template. This fills in the template and replaces the current contents of the description.

To generate the description:

  1. Create a new merge request, and go to the Description field.
  2. Select AI Actions ().
  3. Select Fill in merge request template.

The updated description is applied to the box. You can edit or revise this description before you finish creating your merge request.

Provide feedback on this experimental feature in issue 416537.

Data usage: When you use this feature, the following data is sent to the large language model referenced above:

  • Title of the merge request
  • Contents of the description
  • Diff of changes between the source branch’s head and the target branch

Generate messages for merge or squash commits

History

This feature is an Experiment on GitLab.com.

When preparing to merge your merge request you might wish to edit the proposed squash or merge commit message.

To generate a commit message with GitLab Duo:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Merge requests and find your merge request.
  3. Select the Edit commit message checkbox on the merge widget.
  4. Select Create AI-generated commit message.
  5. Review the commit message provide and choose Insert to add it to the commit.

Provide feedback on this experimental feature in issue 408994.

Data usage: When you use this feature, the following data is sent to the large language model referenced above:

  • Contents of the file
  • The filename

Generate suggested tests in merge requests

History

This feature was moved into GitLab Duo Chat in GitLab 16.8. Find more information in Write tests in the IDE.