Add licence check for Ci AI assistant
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
-
Enable the feature flag for this feature
ai_ci_config_generator
Feature.enable(:ai_ci_config_generator)
-
Enable the
:openai_experimentation
feature flag that thellm_client
is behindFeature.enable(:openai_experimentation)
-
Run
rails c
then setup the api key locally. You have to request one: https://gitlab.slack.com/archives/C0517A9PZ8S/p1681445186381439Gitlab::CurrentSettings.update(openai_api_key: "<your-key>")
-
Then navigate to your gitlab-ci editor page, for example https://gdk.test:3443/flightjs/Flight/-/ci/editor?branch_name=master
-
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.
-
I have evaluated the MR acceptance checklist for this MR.