Only increase overage if reconciliations is enabled
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
- [Gitlab] Create a group
- [Gitlab] Purchase a subscription for the group (Group -> Settings -> Billing)
- [Gitlab] Preview adding a new user
http://localhost:3000/-/graphql-explorer
.
query {
group(fullPath: "<GROUP_PATH>") {
gitlabSubscriptionsPreviewBillableUserChange(role: OWNER, addUserEmails: ["foo@example.com"]) {
willIncreaseOverage
}
}
}
- Verify
willIncreaseOverage == true
{
"data": {
"group": {
"gitlabSubscriptionsPreviewBillableUserChange": {
"willIncreaseOverage": true
}
}
}
}
- [Zuora] Disable reconciliations for the subscription.
- [Zuora] Find the subscription and in "Additional Information" set "Turn On Seat Reconciliation" to "No"
- [Gitlab] Invalidate cache
Group.find_by_name("<GROUP_NAME>").gitlab_subscription.touch
- [Gitlab] Perform the same preview query
query {
group(fullPath: "<GROUP_PATH>") {
gitlabSubscriptionsPreviewBillableUserChange(role: OWNER, addUserEmails: ["foo@example.com"]) {
willIncreaseOverage
}
}
}
- Verify
willIncreaseOverage
is nowfalse
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Ryan Cobb