Skip to content

Auto-generate review summary when submitted

Patrick Bajao requested to merge 415358-auto-generate-review-summary into master

What does this MR do and why?

When a review is submitted, we ask AI provider to generate a summary of the review. We then store it in the DB.

This follows the guidance we have in https://docs.gitlab.com/ee/development/ai_features.html#how-to-implement-a-new-action minus adding the service in Llm::ExecuteMethodService as we don't want this to be exposed via AiAction GraphQL mutation.

This is behind automatically_summarize_mr_review feature flag.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable automatically_summarize_mr_review.
  2. Follow https://docs.gitlab.com/ee/development/ai_features.html#test-ai-features-locally.
  3. Open a MR.
  4. Make some comments that are added to a review then submit review.
  5. Using rails console, confirm that the MergeRequest::ReviewLlmSummary records are created: MergeRequest::ReviewLlmSummary.find_by(review: Review.last)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #415358 (closed)

Edited by Patrick Bajao

Merge request reports