Add Summarize my code review editor action
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:
- Merge request overview page reply editor
- 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
- Enable the feature flags in rails console
Feature.enable(:openai_experimentation) Feature.enable(:ai_experimentation_api) Feature.enable(:summarize_my_code_review)
- 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>")
- Visit any merge request
- Start a review by commenting on some code lines
- Click Finish review button
- Click on the tanuki icon (
) in the editor and select 'Summarize my code review'
- A summary should appear in the editor after some delay
Edited by Stanislav Lashmanov