Skip to content

Allow Duo add-on upgrade and downgrade for self-managed

What does this MR do and why?

This merge request updates the code for a service that provisions add-on purchases for self-managed GitLab instances. It introduces a new duo class for provision services, refactors the existing code, and adds support for upgrading and downgrading between the Duo add-ons. The changes ensure that add-on purchases are correctly created, updated, or expired based on the license restrictions and existing add-on purchases.

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

The following video shows that only one Duo add-on purchase exists at a time. We simulate an upgrade and a downgrade by adding a license having a higher or lower tier Duo add-on active.

Duo_add-on_upgrade_and_downgrade.mp4

How to set up and validate locally

Requirements

  • Experience with GitLab self-managed subscriptions
  • Experience with purchasing subscriptions at CDot
  • Experience with Zuora, especially adding Duo Enterprise to subscriptions
  • Experience with ZSim for synchronizing CDot and Zuora

Process

To verify the code changes, follow the above video and activate different licenses. This is verification enough.

If you would like to do more testing, then another possible approach would be to use only one license and add or remove add-ons:

  1. Purchase an Ultimate license for self-managed at CDot
  2. Add the license to your local self-managed GitLab instance under http://localhost:3000/admin/subscription
  3. Verify that no add-on purchase exists
  4. Purchase a Duo Pro subscription at CDot for the current license
  5. Synchronize the subscription with the button next to Last sync under http://localhost:3000/admin/subscription
  6. Check that there is a new add-on purchase for Duo Pro
  7. Upgrade
    1. Add a Duo Enterprise subscription at Zuora for the current license
    2. Synchronize CDot with ZSim for the just-created order
    3. Synchronize the subscription with the button next to Last sync under http://localhost:3000/admin/subscription
    4. Check that the existing add-on purchase is updated from Duo Pro to Duo Enterprise
  8. Downgrade (️ only possible for Zuora admins)
    1. Remove the Duo Enterprise at Zuora for the current license
      1. Click on the Duo Enterprise order in Zuora
      2. Click on "Creating a return order"
      3. Click on "Add return order line item" under "Return order line items (0)"
      4. Search for the order of the Duo Enterprise add-on and add it
    2. Synchronize CDot with ZSim for the just-created return
    3. Synchronize the subscription with the button next to Last sync under http://localhost:3000/admin/subscription
    4. Check that the existing add-on purchase is downgraded from Duo Enterprise to Duo Pro

Resolves https://gitlab.com/gitlab-org/gitlab/-/issues/474237+

Edited by Lukas Wanko

Merge request reports

Loading