Skip to content

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 of Seats 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

  1. Purchase a subscription for a group with three seats
  2. Enable the feature flag for the group
    • Feature.enable(:seat_count_alerts, group)
  3. Update the namespace statistics
    • UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker.new.perform
  4. View the group homepage - the alert should not be displayed
  5. Add a developer to the group
  6. Update the namespace statistics
    • UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker.new.perform
  7. View the group homepage - the alert should be displayed
  8. 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.

Edited by Josianne Hyson

Merge request reports