Skip to content

Add eligibility check to overage alert

Diana Zubova requested to merge dz/353457-add-eligibility-check-to-overage into master

What does this MR do and why?

Only show the overage alert to groups enrolled in quarterly reconciliation.

Currently we show overage modal on user/group invite to any group with paid SaaS subscription. But as overage is only happening for subscriptions enrolled into reconciliation, we want to only show it to the users of these groups. CustomersDot provides an endpoint where we could consume this information from.

Related to #353457 (closed)

Screenshots or screen recordings

Members Groups
Screenshot_2022-05-16_at_20.09.19 Screenshot_2022-05-16_at_20.30.23
Screenshot_2022-05-16_at_20.30.05 Screenshot_2022-05-16_at_20.30.31

Example subscription

Screen_Recording_2022-05-24_at_16.32.192

How to set up and validate locally

This MR affect two flow: adding a user to a group and adding a group to a group. The initial setup is same for both flows.

Enable the invite modal

Feature.enable(:overage_members_modal)

Make sure that you are running GitLab as SaaS and have check_namespace_plan setting enabled

::Gitlab::CurrentSettings.update(check_namespace_plan: true)

For a Add user to a group case

  1. Create a group, add a premium subscription for one seat
  2. Visit this group page, then Group Information -> Members http://localhost:3000/groups/<your-group>/-/group_members.
  3. Click the Invite member button.
  4. Add one more user in the dropdown and click Invite.
  5. Check the modal.

For a Add group to a group case

  1. Create a group, add a premium subscription for one seat
  2. Visit this group page, then Group Information -> Members http://localhost:3000/groups/<your-group>/-/group_members.
  3. Click the Invite group button.
  4. Add a group in the dropdown and click Invite.
  5. Check the modal.

Now we need to check that for subscriptions not eligible for reconciliation the overage window won't show up

The simplest way to do it is to manipulate the output of CustomersDot Subscription.rb and return false on perform_reconciliations?

Repeat both cases, the overage modal should not appear.

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 Diana Zubova

Merge request reports