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
How to set up and validate locally
-
Enable FF -
Feature.enable(:allow_service_account_creation_on_trial, Group.find_by_name(<group_name>)) -
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
- 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
🤦
- 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
-
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) -
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' }) -
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
