Show alert to explain where code suggestions moved
What does this MR do and why?
For https://gitlab.com/gitlab-org/gitlab/-/issues/439304
As of February 15, 2024 code suggestions is available only if purchased. This MR adds an alert where the code suggestions settings used to be enabled to let folks know why the settings have moved.
- SaaS > Group settings
- Self Managed > Admin top level settings
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Note: All "After" cases are for after the cut-off date has passed (February 15, 2023).
Case | Before | After: User HAS purchased | After: User HAS NOT purchased |
---|---|---|---|
SaaS | |||
Self Managed |
How to set up and validate locally
- Set
GITLAB_SIMULATE_SAAS
variable accordingly for each case (ex. runexport GITLAB_SIMULATE_SAAS=1
in terminal) - Restart gdk server
- Follow the instructions in the relevant quadrant for each case:
Case | Before | After: User HAS purchased | After: User HAS NOT purchased |
---|---|---|---|
SaaS | Navigate to Groups > Group > Settings > General > expand Permissions and group features | Find group that has the add on: 1) Open gdk rails c , 2) Run GitlabSubscriptions::AddOnPurchase.for_code_suggestions and note the namespace_id for one of the objects, 3) Find the group Group.find_by(id: namespace_id).name , 4) In your gdk server search for the group name and verify the settings alert |
Find group that doesn't have the add on and verify the settings alert |
Self Managed | 1) Comment out line 1 of _ai_powered.html.haml, 2) navigate to Admin > Settings > General > expand AI-powered features | 1) Follow the steps to get an activation code with the code suggestions add on, 2) Add it to your gdk, 3) Follow the steps in the "Before" section to verify the settings alert | 1) Go to http://127.0.0.1:3000/admin/subscription and remove any license, 2) Follow the steps in the "Before" section to verify the settings alert |
admin_code_suggestions_path
works properly
If you want to verify in the SM Has Purchased scenario that the link to - Apply this patch: diff.patch
- Then visit
http://127.0.0.1:3000/admin/code_suggestions
Related to #439304
Edited by Missy Davies