Skip to content

Only increase overage if reconciliations is enabled

Ryan Cobb requested to merge rc/preview_billable_user_change_modal into master

What does this MR do and why?

Issue: customers-gitlab-com#5741 (closed)

Problem

Seat overages only occur on subscriptions that have reconciliations enabled.

We missed this logic in the original implementation and currently will indicate increased seat overages for subscriptions that have reconciliations disabled. We should not.

This MR

Only indicate increased seat overages for subscriptions that have reconciliations enabled.

How to set up and validate locally

  1. [Gitlab] Create a group
  2. [Gitlab] Purchase a subscription for the group (Group -> Settings -> Billing)
  3. [Gitlab] Preview adding a new user http://localhost:3000/-/graphql-explorer.
query { 
	group(fullPath: "<GROUP_PATH>") {
    gitlabSubscriptionsPreviewBillableUserChange(role: OWNER, addUserEmails: ["foo@example.com"]) {
      willIncreaseOverage
    }
  }
}
  1. Verify willIncreaseOverage == true
{
  "data": {
    "group": {
      "gitlabSubscriptionsPreviewBillableUserChange": {
        "willIncreaseOverage": true
      }
    }
  }
}
  1. [Zuora] Disable reconciliations for the subscription.
    • [Zuora] Find the subscription and in "Additional Information" set "Turn On Seat Reconciliation" to "No"
  2. [Gitlab] Invalidate cache
Group.find_by_name("<GROUP_NAME>").gitlab_subscription.touch
  1. [Gitlab] Perform the same preview query
query { 
	group(fullPath: "<GROUP_PATH>") {
    gitlabSubscriptionsPreviewBillableUserChange(role: OWNER, addUserEmails: ["foo@example.com"]) {
      willIncreaseOverage
    }
  }
}
  1. Verify willIncreaseOverage is now false.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Ryan Cobb

Merge request reports