Allow service account creation for trial groups with verified identity

What does this MR do and why?

Solves https://gitlab.com/gitlab-org/gitlab/-/work_items/576086 Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/573402

Screenshots or screen recordings

For a group with trial account, we can see Service accounts option is available in the side menu

Screenshot 2025-10-28 at 1.38.14 PM.png

How to set up and validate locally

  1. Enable FF -

    Feature.enable(:allow_service_account_creation_on_trial, Group.find_by_name(<group_name>))
  2. Follow the guide to create a subscription for a group on local gdk for SAAS setup - https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/main/doc/setup/installation_steps.md#connecting-customersdot-to-gitlab

    1. Optional you can create a gitlab subscription using API https://docs.gitlab.com/development/internal_api/gitlab_subscriptions/#create-a-subscription - I figured this existed much later 🤦
  3. Change the group subscription to trial subscription using the script in rails console

    group = Group.find_by_name(<group_name>)
    group.gitlab_subscription.update(trial_starts_on: 1.day.ago, trial_ends_on: (Date.current + 1.year), trial: true)
  4. Make sure group owner's identity is verified - You can use this rails script to verify identity of the user

    user = User.find_by_email(<email id of group owner>)
    record = ::Users::PhoneNumberValidation.for_user(user.id).first_or_initialize
    record.save!
    record.assign_attributes({ country: 'US', international_dial_code: 1, phone_number: '555' })
  5. You should be able to create service account for the group after trial subscription is there. Play around by making user identity as unverified and you should not be able to create Service account any more

Edited by Aboobacker MK

Merge request reports

Loading