Skip to content

Add licence check for Ci AI assistant

Andrei Zubov requested to merge azubov-ci-chat-frontend-license-check into master

What does this MR do and why?

This MR adds a license check to AI Assistant button, so that the button is only shown when the related feature toggle is on AND when the user has an Ultimate subscription tier.

It is related to https://gitlab.com/gitlab-org/gitlab/-/issues/407739+

Screenshots or screen recordings

https://www.loom.com/share/0a2736061a04465cad137d37adae109b

How to set up and validate locally

Make sure you have Ultimate subscription activated locally

  1. Enable the feature flag for this feature ai_ci_config_generator

    Feature.enable(:ai_ci_config_generator)
  2. Enable the :openai_experimentation feature flag that the llm_client is behind

    Feature.enable(:openai_experimentation)
  3. Run rails c then setup the api key locally. You have to request one: https://gitlab.slack.com/archives/C0517A9PZ8S/p1681445186381439

    Gitlab::CurrentSettings.update(openai_api_key: "<your-key>")
  4. Then navigate to your gitlab-ci editor page, for example https://gdk.test:3443/flightjs/Flight/-/ci/editor?branch_name=master

  5. Check that AI Assistant button is visible (the button should not be visible if the feature toggle is off). Click the button to show Ai Assistant drawer. If you don't have Ultimate subscription, the button should not be shown

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 Andrei Zubov

Merge request reports

Loading