Allow group owners to enable duo pro auto assign
What does this MR do and why?
Those changes are the base needed to deliver https://gitlab.com/groups/gitlab-org/-/epics/13637+
In this MR:
- We allow group owners to enable auto-assign Duo Pro seats, for
GitLab.com
. - Changes are guarded with the
auto_assign_gitlab_duo_pro_seats
feature flag, which is currently disabled - Changes are accessed via group settings only
- Changes are introduced for
GitLab.com
and not SM.
Screenshots/Recording
Screen_Recording_2024-04-30_at_11.18.53
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 update process matches the recording
- Verify that only owners and admins can update this setting
- Validate that the feature is not applicable for non-root namespaces
- Validate that the feature is not applicable for SM (Make sure you are disabling the feature flag).
Related to #458118
Edited by Mohamed Hamda