Count in admin portal isn't always accurate

Problem

Because we're using .find in https://gitlab.com/gitlab-org/customers-gitlab-com/blob/953786c214559b2562506c8809a8416e4a9ac77e/app/views/rails_admin/main/list_gitlab_namespaces.html.haml#L29 and not doing any further processing, we're reading a quantity from something that may, or may not, be a license count in accounts with multiple Order objects.

See: https://gitlab.com/gitlab-com/support/dotcom/dotcom-internal/issues/1302 for an example.

Proposal

Correctly determine the number of license seats by either:

  • querying the group on GitLab.com directly (this count is usually right)
  • be potentially inaccurate in a different way (e.g. max of the quantity in all the orders)
  • add a check that the Order returned has the right type of subscription for the quantity to make sense in this context
  • ... something else?

Result

Next steps (if any)

How will we measure success?

Affected customers:

Edited by Lyle Kozloff