Plug in all logic to display Seat Count Alert
What does this MR do and why?
Finishes the implementation of #348481 (closed)
Adds a hook to several of the common group controllers to show the seat count alert to group owners when they are approaching their purchased seat count.
What triggers the alert?
When a user is added that increases the number of Max seats used
:
- If
Max seats used
<Seats in subscription
, trigger the alert based on the percentage ofSeats currently in use
/Seats in subscription
per the table below - If
Max seats used
>=Seats in subscription
, the alert should not be triggered.
Seats in subscription | Notified at |
---|---|
0-15 | No percentage, notify at 1 seat left |
16-25 | No percentage, notify at 2 seats left |
26-99 | 10 % |
100-999 | 8% |
1000+ | 5% |
How to set up and validate locally
Have both Gitlab and the CustomersDot instance running. The GDK should be running with GITLAB_SIMULATE_SAAS=1
- Purchase a subscription for a group with three seats
- Enable the feature flag for the group
Feature.enable(:seat_count_alerts, group)
- Update the namespace statistics
UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker.new.perform
- View the group homepage - the alert should not be displayed
- Add a developer to the group
- Update the namespace statistics
UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker.new.perform
- View the group homepage - the alert should be displayed
- Click the close button on the alert and refresh the page - the alert should not be displayed
Screenshots or screen recordings
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 Josianne Hyson