[SaaS] Add option to add code suggestions seats in usage quotas page
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 |
---|---|
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)
- Setup and start CustomersDot (ideal - but not necessary).
- if you have CDot running, checkout https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/9089 branch
- Create or locate a group that is not Free.
- Visit
http://localhost:3000/groups/<GROUP_NAME_ABOVE>/-/usage_quotas#code-suggestions-usage-tab
. - You should see the
Duo Pro
tab and "Add seats" button appear. - 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 tohttp://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