Skip to content

Resolve "Maximum Users should always reflect current counts"

What does this MR do?

This MR adjusts the Admin Area -> Overview -> Dashboard page to include current active user count in the "Maximum Users" and "Users over License" metrics. It also changes the contact for "Users over License" from the renewals@gitlab.com email address to support.gitlab.com link.

Previously, these numbers were calculated based on the historical data which is gathered only once a day. If users are added to an instance between the time the historical data cron job runs, these metrics will be incorrect and misleading. Now, if the current active user count (real-time metric) is larger than the historical max user count, the current active user count will be displayed for "Maximum Users" and will be used in determination of the "Users over License" metric.

I didn't touch other pages, or even other metrics on the Dashboard, as that didn't seem to be the intent of the issue. Let me know if you think they should be updated as well.

Screenshots

When current user count and historical count is at or below max for the license: Screen_Shot_2019-09-03_at_4.14.39_PM

When current user count or historical count is above the max for the license: Screen_Shot_2019-09-03_at_4.23.59_PM

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

This does introduce one query for calculating the real-time active user count, but this should not be big impact. I've added tests for the new helper method, and even one that was previously missing.

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Closes #8418 (closed)

Edited by Tyler Amos

Merge request reports