Skip to content

Set New Subgroup Members to Awaiting if Root Group User Cap Reached

Jason Goodman requested to merge awaiting-member-subgroup-user-cap-reached into master

What does this MR do and why?

If a root group has a Saas user cap set, and the user cap has been exceeded, then a new member added to a subgroup should have an awaiting membership status.

This MR makes this so.

Previously, a new member added to a subgroup could have an active members.status, because user_cap_reached? was only counting billable members from the subgroup down the tree - it was not counting billable members for the entire tree starting from the root_ancestor.

So for instance, say we have a root group with 10 members and a subgroup with 2. And the root group has a user cap of 12 members. Adding a new member to the root group would result in an awaiting status, because all 12 members are counted. However, adding a new member to the subgroup would result in an active status, because only the 2 members of the subgroup are counted.

Issues: #332595 (closed) / #332592 (closed)

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 Jason Goodman

Merge request reports