Skip to content

Update "Duo Pro" add-on UI references to "GitLab Duo Pro"

What does this MR do and why?

As it was recently decided that Duo Pro should be renamed to GitLab Duo Pro, this MR applies that rename to the user interface.

Resolves https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/8626+.

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

General copy
Page with copy Copy location Offering Screenshot before Screenshot after
Admin Area usage quotas /groups/:group_id/-/usage_quotas#code-suggestions-usage-tab SaaS

Before add-on purchase
usage-quotas-pre saas-usage-quotas-intro
Admin Area usage quotas /groups/:group_id/-/usage_quotas#code-suggestions-usage-tab SaaS

After add-on purchase
usage-quotas-post saas-usage-quotas-ui
Admin Area Duo Pro /admin/code_suggestions SM

Before add-on purchase
sm-gitlab-duo-pro-intro
Admin Area Duo Pro /admin/code_suggestions SM

After add-on purchase
sm-duo-pro-ui sm-gitlab-duo-pro-ui
Error messages copy
Error message Copy location Offering Screenshot before Screenshot after Testing patch
ADD_ON_PURCHASE_FETCH_ERROR /groups/:group_id/-/usage_quotas#code-suggestions-usage-tab SaaS

After add-on purchase
saas-add-on-purchase-fetch-error saas_add_on_purchase_fetch_error.patch
ADD_ON_ELIGIBLE_USERS_FETCH_ERROR /groups/:group_id/-/usage_quotas#code-suggestions-usage-tab SaaS

After add-on purchase
saas-add-on-eligible-users-fetch-error saas_add_on_eligible_users_fetch_error.patch
NO_SEATS_AVAILABLE_ERROR_CODE /admin/code_suggestions SM

After add-on purchase
sm-no-seats-available-error-code no_seats_available_error_code.patch
CANNOT_ASSIGN_ADDON_ERROR_CODE /admin/code_suggestions SM

After add-on purchase
sm-cannot-assign-addon-error-code cannot_assign_addon_error_code.patch
CANNOT_UNASSIGN_ADDON_ERROR_CODE /admin/code_suggestions SM

After add-on purchase
sm-cannot-unassign-addon-error-code cannot_unassign_addon_error_code.patch

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)

Spoof a Self-Managed Duo Pro add-on subscription

  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)

Spoof a SaaS Duo Pro add-on subscription

  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)

Self-Managed testing

  1. Start GDK in Self-Managed mode using GITLAB_SIMULATE_SAAS=0 gdk start (this is the default mode).
  2. Log into GDK using your root user.
  3. Ensure you have a valid paid license (Premium or Ultimate) through Admin Area > Subscriptions.
  4. If validating an error message, apply the patch relevant to the error to validate (see table above).
  5. Navigate to the appropriate page, 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 with a user belonging to the <GROUP_ID> you entered earlier.
  4. Ensure you have a valid paid license (Premium or Ultimate) through Admin Area > Subscriptions.
  5. If validating an error message, apply the patch relevant to the error to validate (see table above).
  6. Navigate to the appropriate page, ensuring the copy matches the "After" screenshots in the visual changes section above.
Edited by Mohamed Moustafa

Merge request reports