Add ability to manage Code Suggestions seats on SM instance
What does this MR do and why?
Add ability to manage Code Suggestions seats on SM instance
- Reuses existing components to implement SM version
- Comes with pagination, search, loading state and error handling
- Also displays an introductory text with Contact Sales CTA when no add-on purchase exists
No changelog required, all changes behind feature flag.
Related to #432434
Screenshots or screen recordings
Code Suggestions add-on purchase exists for a paid plan
Scenario | Screenshot |
---|---|
SM Code Suggestions Seat Management
|
Screen recording |
No search results | |
Min character count requirement for search | |
Loading state | |
Error assigning seat | |
Error un-assigning seat |
No Code Suggestions add-on purchase exists for a paid plan
Scenario | Screenshot |
---|---|
Introductory text with CTA to contact sales |
Screen recording |
SaaS - no change
Scenario | Screenshot |
---|---|
Displays add-on list for SaaS as before |
How to set up and validate locally
Application setup
- Customers Dot needs to be setup
- Start GDK in SM mode
GITLAB_SIMULATE_SAAS=0 gdk start
Feature flag
Run the following in your rails console using GITLAB_SIMULATE_SAAS=0 rails c
Feature.enable(:self_managed_code_suggestions)
Subscription setup
- Buy
Self-Managed Ultimate 1 Year
subscription on Zuora Sandbox - Copy the license key from the subscription details page on local Customers Dot instance
- Paste the license key on your SM instance at
Admin Area > Settings > General > Add license
- Refresh the page to see the
Code Suggestions
Menu item appear underAdmin Area
Add-on purchase
Purchase add-on seats by running the following on rails console GITLAB_SIMULATE_SAAS=0 rails c
# create an add_on record if not already created
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
# create add_on_purchase record without the namespace, mimicking SM instance
add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!(add_on: add_on, expires_on: 1.year.from_now, quantity: 10, purchase_xid: 'A-12345')
Code Suggestions menu item
- Log in to the SM instance as an admin, eg.
root
- Visit Code Suggestions Seat management page by clicking on
Code Suggestions
menu item underAdmin Area
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.
Edited by Vamsi Vempati