Skip to content

Allow group owners to enable duo pro auto assign

Mohamed Hamda requested to merge 458118-auto-assign-namespace-setting into master

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

  1. As a group owner, pick any root namespace, and validate that the field is not present and the above recording is not applicable.
  2. 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)
  3. Validate that the update process matches the recording
  4. Verify that only owners and admins can update this setting
  5. Validate that the feature is not applicable for non-root namespaces
  6. Validate that the feature is not applicable for SM (Make sure you are disabling the feature flag).

Related to #458118

Edited by Mohamed Hamda

Merge request reports