Skip to content

Provision DuoPro via add_on_products key in License#restrictions

What does this MR do and why?

Part of https://gitlab.com/gitlab-org/gitlab/-/issues/477978+

Prior to this change, Duo Pro was provisioned via License#code_suggestions_seat_count. With a recent update, new licenses are generated with a new structure to contain info about all included add-ons within the add_on_products in License#restriction. This way more info about an add-on can be included (e.g. start date, trial, etc.).

This change starts using the new structure to provision Duo Pro instead of the dedicated seat count attribute. In a future iteration, more info from the new structure will be used to handle cases like future dated add-ons (also see this issue).

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. Zuora: Create a new SM Premium/Ultimate subscription with a couple of Duo Pro seats in Zuora.
  2. ZSim: Process the callout.
  3. GitLab: Use the subscription's activation code to activate your SM instance.
  4. Verify that Duo Pro was successfully provisioned by checking for the expected quantity in the related add-on purchase record:
    add_on_id = GitlabSubscriptions::AddOn.where(name: 'code_suggestions').first.id
    GitlabSubscriptions::AddOnPurchase.where(namespace_id: nil, subscription_add_on_id: add_on_id)
Edited by Corinna Gogolok

Merge request reports

Loading