Displays an error when there is an error when fetching add-on purchase
What does this MR do and why?
Displays an error when there is an error when fetching add-on purchase details.
Also fixes an issue where title and subtitle were showing on SaaS instance.
Related to #436403
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
Scenario | Before | After |
---|---|---|
SaaS - Error | - | |
SM - Error | - | |
SaaS - With Add-on | ||
SaaS - Without Add-on (No changes) | ||
SM - Without Add-on (No changes) | ||
SM - With Add-on (No changes) |
How to set up and validate locally
SaaS
SaaS steps
Application setup
- Customers Dot needs to be setup in order to view the billing page for a group
- Start GDK in SaaS mode
GITLAB_SIMULATE_SAAS=1 gdk start
Group setup
- Create a Group
- Buy a Subscription for your group from
Settings
>Billing
Feature flag
Run the following in your rails console
Feature.enable(:hamilton_seat_management, Namespace.find(your-group-id))
Add-on purchase
Purchase an add-on for the subscription purchased above in Group setup
step by following the instructions here (under Add Code Suggestions Add-On to a subscription
section).
Code Suggestions tab
- Visit
/groups/<your-namespace-name>/-/usage_quotas#code-suggestions-usage-tab
SM
SM steps
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
Edited by Vamsi Vempati