Skip to content

Add Summarize my code review editor action

Stanislav Lashmanov requested to merge slashmanov/ai-my-code-review-summary into master

What does this MR do and why?

Implements Summarize my merge request review (&10347).

Resolves Engineering: Summarize my merge request review (#407364 - closed).

This MR adds Summarize my code review editor action under a summarize_my_code_review feature flag scoped to user. This is added for:

  1. Merge request overview page reply editor
  2. Merge request changes page finish review editor

It also moves AI editor actions and dropdown to the /ai folder.

Screenshots or screen recordings

Screen_Recording_2023-04-26_at_20.20.21

How to set up and validate locally

  1. Enable the feature flags in rails console
    Feature.enable(:openai_experimentation)
    Feature.enable(:ai_experimentation_api)
    Feature.enable(:summarize_my_code_review)
  2. In rails console add your OpenAI token (free plan might not work, request a key from GitLab)
    Gitlab::CurrentSettings.update(openai_api_key: "<openai-api-token>")
  3. Visit any merge request
  4. Start a review by commenting on some code lines
  5. Click Finish review button
  6. Click on the tanuki icon (image) in the editor and select 'Summarize my code review'
  7. A summary should appear in the editor after some delay
Edited by Stanislav Lashmanov

Merge request reports