Skip to content

[SaaS] Add option to add code suggestions seats in usage quotas page

Minahil Nichols requested to merge cdot-7677-edit-code-suggestions-redirect into master

What does this MR do and why?

Solves https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/7677

Add a button for users to buy code suggestions seats from the usage quotas page in Gitlab.

The redirect portion of this MR relies on https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/9089.

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

Before After
image image

How to set up and validate locally

General setup

Enable the following feature flags in the Rails console (bundle exec rails c):

Feature.enable(:code_suggestions)
Feature.enable(:code_suggestions_tokens_api)
Feature.enable(:purchase_code_suggestions)
Feature.enable(:self_managed_code_suggestions)
Feature.enable(:hamilton_seat_management)
  1. Setup and start CustomersDot (ideal - but not necessary).
  2. Create or locate a group that is not Free.
  3. Visit http://localhost:3000/groups/<GROUP_NAME_ABOVE>/-/usage_quotas#code-suggestions-usage-tab.
  4. You should see the Duo Pro tab and "Add seats" button appear.
  5. Click "Add seats" button, it should take you to Customers to complete the purchase. Note: if you do not have customers set up, you should see the URL as http://localhost:5000/gitlab/namespaces/<GROUP_ID>/duo_pro_seats which should redirect to http://localhost:5000/subscriptions/<SUBSCRIPTION_NAME>/edit?transaction=duo_pro_seats.
  • if you do not have CDot the redirect will not work, however you should still see the URL as http://localhost:5000/gitlab/namespaces/<GROUP_ID>/duo_pro_seats
Edited by Minahil Nichols

Merge request reports