Skip to content

Display usage quota tab during duo pro trial even group on free plan

Roy Liu requested to merge 461881-display-duo-pro-usage-tab-during-trial into master

What does this MR do and why?

Related to #461881 (closed)

Today, we don't show the Usage Quotas > GitLab Duo Pro page for the free tier. But there can be a case when a free group is on Duo pro trial, we want to allow that group to access that page.

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.

How to set up and validate locally

  1. Setup GDK to simulate SaaS
  2. Create a new free top-level group.
  3. Visit the Usage Quotas > GitLab Duo Pro page from group settings in the sidebar, and verify GitLab Duo Pro tab is not there
  4. Add a duo pro trial to that namespace in the rails console.
n = Namespace.last
add_on = ::GitlabSubscriptions::AddOn.where(name: ::GitlabSubscriptions::AddOn.names[:code_suggestions]).last
::GitlabSubscriptions::AddOnPurchase.create(add_on: add_on, namespace: n, quantity: 1, expires_on: 30.days.from_now, purchase_xid: SecureRandom.hex(16), trial: true, organization_id: 1)
  1. Verify that you can see and access the GitLab Duo Pro tab.
Edited by Roy Liu

Merge request reports