Skip to content

Simplify Explain Code feature checks on the frontend

Jacques Erasmus requested to merge je-simplify-ai-feature-checks-fe into master

What does this MR do and why?

Simplifies the ai feature checks for explain code on the frontend by using a single flag from the backend.

Screenshots or screen recordings

Screen_Recording_2023-04-14_at_13.04.20.2023-04-14_13_05_44

Signed in Signed out
Screenshot_2023-04-14_at_13.06.06 Screenshot_2023-04-14_at_13.05.01

How to set up and validate locally

  1. Enable the following feature flags:
    • explain_code
    • explain_code_snippet
    • openai_experimentation
    • ai_experimentation_api
  2. Add an OpenAI API key by following the steps in !116364 (merged)
  3. Run the following command in the root of your project:
    • curl https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117636.diff | git apply
    • This will apply changes from !117636 (merged) on which this MR relies.
  4. Open a file containing Source Code (Note, this file should not be from the GitLab codebase).
  5. Highlight some of the Source Code.
  6. Click on the (?) button in the gutter to the left of the source code.
  7. A popup should appear and the response should load once we receive a notification from the backend.
  8. The feature should not be available if any of the feature flags are disabled or if the user is signed out.

MR acceptance checklist

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

Edited by Jacques Erasmus

Merge request reports

Loading