Make `Billable Members Count` available for subgroups via API
Problem
Today, it's challenging for customers to understand what billable members contribute to each Group's total user count. Group Counts (example below) don't necessarily reflect "billable" users, and could represent guest or non billed members of a group.
Billable users reflect the total counts for the instance making it challenging to track used seats per-group in larger organizations.
Proposal
MVC:
Modify the Namespace API to return Billable Members Count
. This would allow you to query for a group or subgroup and return the counts of billable members. To start we could simply add this endpoint and allow customers to query it through the command line
Of note
- The billable member amount for the specific subgroup should be returned (not the total billable members for the namespace)
- A root group may have zero or unlimited subgroups
Follow on iterations
- Wrap a simple interface around exporting the data (automating the query) and downloading a csv of the data for analysis.
- Call this endpoint to render the group admin interface and append a count of the total billable members (e.g. https://gitlab.com/groups/**/-/group_members)
- Refer to who is a billable member on each member list item in the group admin interface (e.g. https://gitlab.com/groups/**/-/group_members)
- Update the high-level group view (e.g. https://gitlab.com/gitlab-org) to show billable user counts in addition to total group members to administrators.
Reference
-
Namespace by ID API
- Is available with an access token to users with
Owner
+ role - Provides data for Group and Subgroups, not projects.
- Available for both self-managed and SaaS
- Is available with an access token to users with
-
billable_members_count
- Returns data for the immediate group being queried and nested membership as well.
- When generated for a root Group, returns the sum total of membership for the entire namespace. This includes the direct membership/invited groups at the root group + direct membership/invited groups of all subgroups and projects beneath the root group.
- When generated for a Sub Group, returns the sum total of: direct member count/invited groups at the subgroup level + the subgroup creator (technically inherited) + direct member count from nested descendants (subgroup or project).
- Does not return inherited membership from parent.
-
members_count_with_descendants
- Direct membership of the group + descendant members of nested subgroups.
- Does not include invited group membership.
- Does not include descendant members of nested projects.
- This feels like a bug, I can't imagine this metric, in this form is intended.
-
seats_in_use
- Is only returned for root namespace, not subgroup.
- Should be the same value as
billable_members_count
for the root namespace.
Edited by Amanda Rueda