Skip to content

Return stored seat counts in the subscriptions API endpoint

Amparo Luna requested to merge al-233444-display-current-counts into master

What does this MR do?

In the billing page, we display three counts from seat data that are updated once a day by UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker

Screen_Shot_2020-09-15_at_12.19.58_PM

  • Seats currently in use is currently recalculated at the time of rendering, counting all the users that can be billed at the moment.
  • Max seats used currently renders the value stored in the database, so its value could be behind Seats currently in use at any point if more members were added after the update has been performed.
  • Seats owed is also calculated at the time of rendering and depends on the value of Max seats used.

This MR updates the GET gitlab_subscription for namespace response so that the counts displayed from the GitlabSubscription are what we have stored in the database (the values saved once a day). This way we avoid presenting inconsistencies in the seats data we display.

Related issue

https://gitlab.com/gitlab-org/gitlab/-/issues/233444

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Amparo Luna

Merge request reports

Loading