Seats limitation removed from service account creation

What does this MR do and why?

Solves https://gitlab.com/gitlab-org/gitlab/-/work_items/583474

With this MR we are removing the limit for Service account creation for premium subscription. Making it behave like Ultimate subscription where we can create unlimited number of service account users for a group.

How to set up and validate locally

  1. Check the subscription for your group

    group = Group.find_by_name(<groupn_name>)
    group_subscription = group.gitlab_subscription
  2. Fetch the number of seats against the subscription and update it to a small number

    seats = group_subscription.seats
    group_subscription.update!(seats: 2) 
  3. For Group level Service account first make sure your gdk instance is running SAAS mode -

    1. Create the service account users equal to the number of seats using api - https://docs.gitlab.com/api/service_accounts/#create-a-group-service-account and try creating one more than the seat count
      ```
      curl --request POST --header "PRIVATE-TOKEN: <token_value>" "https://gdk.test:3443/api/v4/groups/<group_id>/service_accounts" --data "email=SA34_8@example.com"
      ```
  4. You should be able to create a service account for the group.

Merge request reports

Loading