Skip to content

Rename Code Suggestions to Duo Pro in the UI

What does this MR do and why?

Partly resolves https://gitlab.com/gitlab-org/fulfillment/meta/-/issues/1604+.

As part of bundling Code Suggestions under the Duo Pro add-on, this MR renames all references to a Code Suggestions add-on (not the feature!) to Duo Pro.

The areas renamed are listed in the Screenshots section below.

Error messages referencing the Code Suggestions add-on are renamed in !141381 (merged).

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 Instance With Duo Pro seats Before After
Admin Area Duo Pro page (/admin/code_suggestions) Self-Managed No sm_admin_area_without_access_before sm_admin_area_without_access_after
Admin Area Duo Pro page (/admin/code_suggestions) Self-Managed Yes sm_admin_area_with_access_before sm_admin_area_with_access_after
Group Usage Quotas page (/groups/:group_id/-/usage_quotas#code-suggestions-usage-tab) SaaS No saas_usage_quotas_without_access_before saas_usage_quotas_without_access_after
Group Usage Quotas page (/groups/:group_id/-/usage_quotas#code-suggestions-usage-tab) SaaS Yes saas_usage_quotas_with_access_before saas_usage_quotas_with_access_after
Group Billing page CTA (/groups/:group_id/-/billings) SaaS No saas_billing_cta_before saas_billing_cta_after

How to set up and validate locally

It's recommended to test according to the following order, for a simpler setup:

  1. Self-Managed instance with no Duo Pro seats.
  2. SaaS instance with no Duo Pro seats.
  3. Self-Managed instance with Duo Pro seats.
  4. SaaS instance with Duo Pro seats.

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)

Self-Managed testing

  1. Start GDK in Self-Managed mode using GITLAB_SIMULATE_SAAS=0 gdk start (this is the default mode).
  2. Setup and start CustomersDot (optional).
  3. Log into GDK using your root user.
  4. Ensure you have a valid paid license (Premium or Ultimate) through Admin Area > Subscriptions. If not, "purchase" one through CustomersDot.
  5. Navigate to the appropriate pages, ensuring the copy matches the "After" screenshots in the visual changes section above.

Testing with Duo Pro seats

  1. Purchase a "Self-Managed - Duo Pro" add-on from the Zuora API Sandbox for your account, or spoof one using the following commands in the Rails console:
# Feel free to delete these objects after testing
add_on_sm = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test SM"}
add_on_purchase_sm = GitlabSubscriptions::AddOnPurchase.create!(
  add_on: add_on_sm, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0001'
)
add_on_purchase_sm.update(expires_on: 1.month.from_now)
  1. Navigate to the appropriate pages, ensuring the copy matches the "After" screenshots in the visual changes section above.

SaaS setup

  1. Start GDK in SaaS mode by following this guide.
  2. Setup and start CustomersDot (optional).
  3. Log into GDK using your root user.
  4. Ensure you have a valid paid license (Premium or Ultimate) through Admin Area > Subscriptions. If not, "purchase" one through CustomersDot.
  5. Navigate to the appropriate pages, ensuring the copy matches the "After" screenshots in the visual changes section above.

Testing with Duo Pro seats

  1. Purchase a "SaaS - Duo Pro" add-on from the Zuora API Sandbox for your account, or spoof one using the following commands in the Rails console:
# Feel free to delete these objects after testing
add_on_saas = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test SaaS"}
add_on_purchase_saas = GitlabSubscriptions::AddOnPurchase.create!(
  namespace: Namespace.find(<GROUP_ID>), add_on: add_on_saas, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0002'
)
add_on_purchase_saas.update(expires_on: 1.month.from_now)
  1. Navigate to the appropriate pages, ensuring the copy matches the "After" screenshots in the visual changes section above.
Edited by Mohamed Moustafa

Merge request reports