Auto assign the new members a duo pro seat
What does this MR do and why?
This MR is the last piece of https://gitlab.com/groups/gitlab-org/-/epics/13637, tackling https://gitlab.com/gitlab-org/gitlab/-/issues/458119 and https://gitlab.com/gitlab-org/gitlab/-/issues/460250
In this MR we:
- Auto-assign the new members a duo pro seat if the group setting is enabled.
- Document the usage of the feature.
Screenshots or screen recordings
Auto-assign when seats are available:
Screen_Recording_2024-05-06_at_12.22.26
Project members:
Screen_Recording_2024-05-06_at_12.34.14
Sub-group members:
Screen_Recording_2024-05-06_at_12.36.02
When no seats are available, the member is successfully added and no duo pro seats are assigned:
Screen_Recording_2024-05-06_at_12.30.38
How to set up and validate locally
- As a group owner, pick any root namespace, and validate that the field is not present and the above recording is not applicable.
- Purchase Duo Pro for that namespace, use
rails c
directly for easier testing.namespace = YOUR_NAMESPACE add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"} add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!( add_on: add_on, namespace: namespace, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0001' ) # enable the feature flag Feature.enable(:auto_assign_gitlab_duo_pro_seats)
- Validate that the process matches the recordings
- Validate that no duo pro seats available is not breaking the member addition process
Edited by Mohamed Hamda