Skip to content

Skip seat usage cache for preview billable user change service

Ryan Cobb requested to merge rc/seat_usage_dont_cache_nil into master

What does this MR do and why?

Fixes: customers-gitlab-com#7399 (closed)

GitlabSubscriptions::Reconciliations::CheckSeatUsageAlertsEligibilityService is called immediately after purchasing a subscription, before the subscription has time to fully propagate to Cdot. This results in us caching a nil value when we should not. This results in us not showing the user overage modal when adding members to a group.

This MR makes it so we skip the cache for this check so we correctly show the user overage modal.

How to set up and validate locally

Enable :overage_members_modal FF

Before

  1. [Gitlab] Create a group
  2. [Gitlab] Purchase a subscription (Group > Settings > Billing)
  3. [Gitlab] In a console, notice the following returns false when it should not.
GitlabSubscriptions::Reconciliations::CheckSeatUsageAlertsEligibilityService.new(namespace: namespace).execute
  1. [Gitlab] OR, add members to the group (Group > Manage > Members > Invite Members). Notice no modal appears warning of overages.

After

  1. Follow steps 1 and 2 above.
  2. [Gitlab] In a console, notice the following returns true
GitlabSubscriptions::Reconciliations::CheckSeatUsageAlertsEligibilityService.new(namespace: namespace, skip_cached: true).execute
  1. Notice adding members now results in an overage modal.

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