Skip to content
Snippets Groups Projects
Verified Commit fe799630 authored by Gosia Ksionek's avatar Gosia Ksionek :palm_tree: Committed by GitLab
Browse files

Merge branch '453987-remove-feature-flag' into 'master'

Remove use_registration_type_db_value feature flag

See merge request !148595



Merged-by: Gosia Ksionek's avatarGosia Ksionek <mksionek@gitlab.com>
Approved-by: default avatarSerhii Yarynovskyi <syarynovskyi@gitlab.com>
Approved-by: Gosia Ksionek's avatarGosia Ksionek <mksionek@gitlab.com>
Co-authored-by: Doug Stull's avatarDoug Stull <dstull@gitlab.com>
parents 3f599e69 a1e3f2bf
No related branches found
No related tags found
1 merge request!148595Remove use_registration_type_db_value feature flag
Pipeline #1241612374 passed
......@@ -59,7 +59,6 @@ def convert_to_automatic_trial?
def invite?
# TODO: As the next step in https://gitlab.com/gitlab-org/gitlab/-/issues/435745, we can remove the
# invited_registration_type? from this logic as we will be fully driving off the db value.
return invited_registration_type? if ::Feature.disabled?(:use_registration_type_db_value, user)
user.onboarding_status_registration_type == REGISTRATION_TYPE[:invite] || invited_registration_type?
end
......@@ -69,10 +68,6 @@ def trial?
# the params and stored location considerations as we will be fully driving off the db registration_type.
return false unless enabled?
if ::Feature.disabled?(:use_registration_type_db_value, user)
return trial_from_params? || trial_from_stored_location?
end
user.onboarding_status_registration_type == REGISTRATION_TYPE[:trial] ||
trial_from_params? || trial_from_stored_location?
end
......@@ -123,7 +118,6 @@ def enabled?
def subscription?
return false unless enabled?
return subscription_from_stored_location? if ::Feature.disabled?(:use_registration_type_db_value, user)
user.onboarding_status_registration_type == REGISTRATION_TYPE[:subscription] ||
subscription_from_stored_location?
......@@ -150,7 +144,6 @@ def trial_from_the_beginning?
# identity_verification area and this method is not called there.
# TODO: We can simplify/remove this method once we cutover to DB only solution as the next step in
# https://gitlab.com/gitlab-org/gitlab/-/issues/435745.
return trial_from_params? if ::Feature.disabled?(:use_registration_type_db_value, user)
trial_from_params? || (user.onboarding_status_initial_registration_type.present? && initial_trial?)
end
......@@ -196,7 +189,6 @@ def invited_registration_type?
def initial_trial?
# TODO: As the next step in https://gitlab.com/gitlab-org/gitlab/-/issues/435745, we can remove the
# return true condition here and simplify this area as we drive off the db values.
return true if ::Feature.disabled?(:use_registration_type_db_value, user)
return true unless user.onboarding_status_initial_registration_type
user.onboarding_status_initial_registration_type == REGISTRATION_TYPE[:trial]
......
---
name: use_registration_type_db_value
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/435745
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146261
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/453987
milestone: '16.11'
group: group::acquisition
type: gitlab_com_derisk
default_enabled: false
......@@ -116,21 +116,16 @@
user_without_members
end
where(:current_user, :use_registration_type_db_value, :expected_result) do
ref(:user) | true | true
ref(:user_without_members) | true | false
ref(:user_with_invite_registration_type) | true | true
ref(:user_with_invite_registration_type) | false | false
ref(:user_without_invite_registration_type) | true | false
where(:current_user, :expected_result) do
ref(:user) | true
ref(:user_without_members) | false
ref(:user_with_invite_registration_type) | true
ref(:user_without_invite_registration_type) | false
end
with_them do
let(:instance) { described_class.new(nil, nil, current_user) }
before do
stub_feature_flags(use_registration_type_db_value: use_registration_type_db_value)
end
subject { instance.invite? }
it { is_expected.to eq(expected_result) }
......@@ -262,26 +257,25 @@
let(:user_with_trial) { build_stubbed(:user) { |u| u.onboarding_status_registration_type = 'trial' } }
where(:params, :current_user, :session, :onboarding_enabled?, :use_registration_type_db_value, :expected_result) do
{ trial: 'true' } | ref(:user) | {} | false | true | false
{ trial: 'false' } | ref(:user_with_trial) | {} | true | true | true
{ trial: 'false' } | ref(:user_with_trial) | {} | true | false | false
{ trial: 'false' } | ref(:user) | {} | true | true | false
{ trial: 'true' } | ref(:user) | {} | true | true | true
{ trial: 'false' } | ref(:user) | ref(:user_on_trial) | false | true | false
{ trial: 'false' } | ref(:user) | ref(:user_on_trial) | true | true | true
{ trial: 'true' } | ref(:user) | ref(:user_on_trial) | true | true | true
{ trial: 'false' } | ref(:user) | ref(:redirect_on_trial) | false | true | false
{ trial: 'false' } | ref(:user) | ref(:redirect_on_trial) | true | true | true
{ trial: 'true' } | ref(:user) | ref(:redirect_on_trial) | true | true | true
{ trial: 'false' } | ref(:user) | ref(:user_not_on_trial) | true | true | false
{ trial: 'false' } | ref(:user) | ref(:redirect_not_on_trial) | true | true | false
{ trial: 'false' } | ref(:user) | ref(:combined_on_trial) | true | true | true
{} | ref(:user) | {} | true | true | false
{} | ref(:user) | {} | false | true | false
{ trial: '' } | ref(:user) | {} | false | true | false
{ trial: '' } | ref(:user) | {} | true | true | false
{ trial: '' } | ref(:user) | nil | true | true | false
where(:params, :current_user, :session, :onboarding_enabled?, :expected_result) do
{ trial: 'true' } | ref(:user) | {} | false | false
{ trial: 'false' } | ref(:user_with_trial) | {} | true | true
{ trial: 'false' } | ref(:user) | {} | true | false
{ trial: 'true' } | ref(:user) | {} | true | true
{ trial: 'false' } | ref(:user) | ref(:user_on_trial) | false | false
{ trial: 'false' } | ref(:user) | ref(:user_on_trial) | true | true
{ trial: 'true' } | ref(:user) | ref(:user_on_trial) | true | true
{ trial: 'false' } | ref(:user) | ref(:redirect_on_trial) | false | false
{ trial: 'false' } | ref(:user) | ref(:redirect_on_trial) | true | true
{ trial: 'true' } | ref(:user) | ref(:redirect_on_trial) | true | true
{ trial: 'false' } | ref(:user) | ref(:user_not_on_trial) | true | false
{ trial: 'false' } | ref(:user) | ref(:redirect_not_on_trial) | true | false
{ trial: 'false' } | ref(:user) | ref(:combined_on_trial) | true | true
{} | ref(:user) | {} | true | false
{} | ref(:user) | {} | false | false
{ trial: '' } | ref(:user) | {} | false | false
{ trial: '' } | ref(:user) | {} | true | false
{ trial: '' } | ref(:user) | nil | true | false
end
with_them do
......@@ -290,7 +284,6 @@
subject { instance.trial? }
before do
stub_feature_flags(use_registration_type_db_value: use_registration_type_db_value)
stub_saas_features(onboarding: onboarding_enabled?)
end
......@@ -307,15 +300,13 @@
before do
stub_saas_features(onboarding: true)
stub_feature_flags(use_registration_type_db_value: use_registration_type_db_value)
end
where(:params, :current_user, :use_registration_type_db_value, :expected_result) do
{ trial: 'true' } | ref(:user) | true | true
{ trial: 'false' } | ref(:user) | true | false
{ trial: 'false' } | ref(:user_with_initial_trial) | true | true
{ trial: 'false' } | ref(:user_with_initial_trial) | false | false
{ trial: 'false' } | ref(:user_with_initial_free) | true | false
where(:params, :current_user, :expected_result) do
{ trial: 'true' } | ref(:user) | true
{ trial: 'false' } | ref(:user) | false
{ trial: 'false' } | ref(:user_with_initial_trial) | true
{ trial: 'false' } | ref(:user_with_initial_free) | false
end
with_them do
......@@ -392,14 +383,6 @@
let(:current_user) { build_stubbed(:user) { |u| u.onboarding_status_registration_type = 'subscription' } }
it { is_expected.to eq(true) }
context 'when feature flag use_registration_type_db_value is disabled' do
before do
stub_feature_flags(use_registration_type_db_value: false)
end
it { is_expected.to eq(false) }
end
end
end
......@@ -495,22 +478,6 @@
end
end
context 'when feature flag use_registration_type_db_value is disabled' do
let(:current_user) { build_stubbed(:user) { |u| u.onboarding_status_initial_registration_type = 'trial' } }
before do
stub_feature_flags(use_registration_type_db_value: false)
end
it { is_expected.to eq('SaaS Trial') }
context 'with no trial in params' do
let(:params) { {} }
it { is_expected.to eq('SaaS Trial - defaulted') }
end
end
context 'when it is initially free registration_type' do
let(:current_user) { build_stubbed(:user) { |u| u.onboarding_status_initial_registration_type = 'free' } }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment