Commit 725f7841 authored by Doug Stull's avatar Doug Stull

Merge branch 'jejejack0n/experiment/bypass_registration_cleanup' into 'master'

Cleans up the bypass_registration experiment

See merge request gitlab-org/gitlab!83225
parents 1ac01a3e 1d21bef5
---
name: bypass_registration
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72827
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/340560
milestone: '14.5'
type: experiment
group: group::adoption
default_enabled: false
...@@ -48,6 +48,11 @@ module EE ...@@ -48,6 +48,11 @@ module EE
private private
def show_company_form?
update_params[:setup_for_company] == 'true' &&
::Feature.enabled?(:about_your_company_registration_flow)
end
override :update_params override :update_params
def update_params def update_params
clean_params = super.merge(params.require(:user).permit(:email_opted_in, :registration_objective)) clean_params = super.merge(params.require(:user).permit(:email_opted_in, :registration_objective))
...@@ -74,11 +79,6 @@ module EE ...@@ -74,11 +79,6 @@ module EE
helpers.signup_onboarding_enabled? helpers.signup_onboarding_enabled?
end end
def show_company_form?
update_params[:setup_for_company] == 'true' &&
::Feature.enabled?(:about_your_company_registration_flow)
end
def authorized_for_trial_onboarding! def authorized_for_trial_onboarding!
access_denied! unless can?(current_user, :owner_access, learn_gitlab_project) access_denied! unless can?(current_user, :owner_access, learn_gitlab_project)
end end
...@@ -100,11 +100,8 @@ module EE ...@@ -100,11 +100,8 @@ module EE
override :update_success_path override :update_success_path
def update_success_path def update_success_path
if params[:joining_project] == 'true' if params[:joining_project] == 'true'
bypass_registration_event(:joining_project)
path_for_signed_in_user(current_user) path_for_signed_in_user(current_user)
else else
bypass_registration_event(:creating_project)
if show_company_form? if show_company_form?
new_users_sign_up_company_path new_users_sign_up_company_path
else else
...@@ -112,10 +109,6 @@ module EE ...@@ -112,10 +109,6 @@ module EE
end end
end end
end end
def bypass_registration_event(event_name)
experiment(:bypass_registration, user: current_user).track(event_name, user: current_user)
end
end end
end end
end end
...@@ -56,19 +56,7 @@ module EE ...@@ -56,19 +56,7 @@ module EE
end end
def registration_objective_options def registration_objective_options
options = localized_jobs_to_be_done_choices.dup localized_jobs_to_be_done_choices.dup
experiment(:bypass_registration, user: current_user) do |e|
e.control do
options.merge(
joining_team: _('I’m joining my team who’s already on GitLab')
)
end
e.candidate do
options
end
e.run
end
end end
end end
end end
- return unless Gitlab.com? - return unless Gitlab.com?
- return if in_trial_flow? - return if in_trial_flow?
- experiment(:bypass_registration, user: current_user) do |e| .row
- e.try do .form-group.col-sm-12
.row = label_tag :joining_project, _('What would you like to do?'), class: 'label-bold'
.form-group.col-sm-12 .form-check.gl-mb-2
= label_tag :joining_project, _('What would you like to do?'), class: 'label-bold' = radio_button_tag :joining_project, false, false, required: true, class: 'form-check-input'
.form-check.gl-mb-2 = label_tag :joining_project_false, class: 'form-check-label normal' do
= radio_button_tag :joining_project, false, false, required: true, class: 'form-check-input' = _('Create a new project')
= label_tag :joining_project_false, class: 'form-check-label normal' do .form-text.gl-text-gray-600
= _('Create a new project') = _('House your files, plan your work, collaborate on code, and more.')
.form-text.gl-text-gray-600 .form-check
= _('House your files, plan your work, collaborate on code, and more.') = radio_button_tag :joining_project, true, false, required: true, class: 'form-check-input'
.form-check = label_tag :joining_project_true, class: 'form-check-label normal' do
= radio_button_tag :joining_project, true, false, required: true, class: 'form-check-input' = _('Join a project')
= label_tag :joining_project_true, class: 'form-check-label normal' do .form-text.gl-text-gray-600
= _('Join a project') = _('Join your team on GitLab and contribute to an existing project')
.form-text.gl-text-gray-600
= _('Join your team on GitLab and contribute to an existing project')
- e.publish_to_database
...@@ -263,20 +263,6 @@ RSpec.describe Registrations::WelcomeController do ...@@ -263,20 +263,6 @@ RSpec.describe Registrations::WelcomeController do
let(:joining_project) { 'true' } let(:joining_project) { 'true' }
it { is_expected.to redirect_to dashboard_projects_path } it { is_expected.to redirect_to dashboard_projects_path }
it 'creates a "joining_project" experiment track event' do
expect(experiment(:bypass_registration)).to track(:joining_project, user: user).on_next_instance
subject
end
end
context 'when joining_project is "false"', :experiment do
it 'creates a "creating_project" experiment track event' do
expect(experiment(:bypass_registration)).to track(:creating_project, user: user).on_next_instance
subject
end
end end
context 'when joining_project is "false"' do context 'when joining_project is "false"' do
......
...@@ -18,6 +18,7 @@ RSpec.describe 'Combined registration flow', :js do ...@@ -18,6 +18,7 @@ RSpec.describe 'Combined registration flow', :js do
expect(page).to have_content('Welcome to GitLab') expect(page).to have_content('Welcome to GitLab')
choose 'My company or team' choose 'My company or team'
choose 'Create a new project'
click_on 'Continue' click_on 'Continue'
end end
......
...@@ -16,6 +16,7 @@ RSpec.describe 'User sees new onboarding flow', :js do ...@@ -16,6 +16,7 @@ RSpec.describe 'User sees new onboarding flow', :js do
expect(page).to have_content('Welcome to GitLab') expect(page).to have_content('Welcome to GitLab')
choose 'My company or team' choose 'My company or team'
choose 'Create a new project'
click_on 'Continue' click_on 'Continue'
expect(page).to have_content('GitLab Ultimate trial (optional)') expect(page).to have_content('GitLab Ultimate trial (optional)')
......
...@@ -16,6 +16,7 @@ RSpec.describe 'User sees new onboarding flow', :js do ...@@ -16,6 +16,7 @@ RSpec.describe 'User sees new onboarding flow', :js do
expect(page).to have_content('Welcome to GitLab') expect(page).to have_content('Welcome to GitLab')
choose 'Just me' choose 'Just me'
choose 'Create a new project'
click_on 'Continue' click_on 'Continue'
expect(page).to have_content('Create your group') expect(page).to have_content('Create your group')
......
...@@ -30,6 +30,7 @@ RSpec.describe 'Welcome screen', :js do ...@@ -30,6 +30,7 @@ RSpec.describe 'Welcome screen', :js do
page.select('Software Developer', from: 'user_role') page.select('Software Developer', from: 'user_role')
choose 'user_setup_for_company_true' choose 'user_setup_for_company_true'
choose 'Create a new project'
click_button 'Continue' click_button 'Continue'
...@@ -54,6 +55,7 @@ RSpec.describe 'Welcome screen', :js do ...@@ -54,6 +55,7 @@ RSpec.describe 'Welcome screen', :js do
page.select('Software Developer', from: 'user_role') page.select('Software Developer', from: 'user_role')
choose 'user_setup_for_company_true' choose 'user_setup_for_company_true'
choose 'Create a new project'
expect(page).not_to have_selector('input[name="user[email_opted_in]', visible: true) expect(page).not_to have_selector('input[name="user[email_opted_in]', visible: true)
...@@ -67,6 +69,7 @@ RSpec.describe 'Welcome screen', :js do ...@@ -67,6 +69,7 @@ RSpec.describe 'Welcome screen', :js do
page.select('Software Developer', from: 'user_role') page.select('Software Developer', from: 'user_role')
choose 'user_setup_for_company_false' choose 'user_setup_for_company_false'
choose 'Create a new project'
expect(page).to have_selector('input[name="user[email_opted_in]', visible: true) expect(page).to have_selector('input[name="user[email_opted_in]', visible: true)
......
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe EE::RegistrationsHelper do RSpec.describe EE::RegistrationsHelper do
include Devise::Test::ControllerHelpers include Devise::Test::ControllerHelpers
let(:expected_keys) { UserDetail.registration_objectives.keys - ['joining_team'] }
describe '#shuffled_registration_objective_options' do describe '#shuffled_registration_objective_options' do
subject(:shuffled_options) { helper.shuffled_registration_objective_options } subject(:shuffled_options) { helper.shuffled_registration_objective_options }
...@@ -11,23 +12,12 @@ RSpec.describe EE::RegistrationsHelper do ...@@ -11,23 +12,12 @@ RSpec.describe EE::RegistrationsHelper do
it 'has values that match all UserDetail registration objective keys' do it 'has values that match all UserDetail registration objective keys' do
shuffled_option_values = shuffled_options.map { |item| item.last } shuffled_option_values = shuffled_options.map { |item| item.last }
expect(shuffled_option_values).to contain_exactly(*UserDetail.registration_objectives.keys) expect(shuffled_option_values).to contain_exactly(*expected_keys)
end end
it '"other" is always the last option' do it '"other" is always the last option' do
expect(shuffled_options.last).to eq(['A different reason', 'other']) expect(shuffled_options.last).to eq(['A different reason', 'other'])
end end
context 'when the bypass_registration experiment is candidate', :experiment do
before do
stub_experiments({ bypass_registration: :candidate })
end
it "excludes the joining_team option" do
shuffled_option_values = shuffled_options.map { |item| item.last }
expect(shuffled_option_values).to contain_exactly(*UserDetail.registration_objectives.keys.reject {|k| k == "joining_team"})
end
end
end end
describe '#registration_verification_enabled?' do describe '#registration_verification_enabled?' do
......
...@@ -53,16 +53,7 @@ RSpec.describe 'registrations/welcome/show' do ...@@ -53,16 +53,7 @@ RSpec.describe 'registrations/welcome/show' do
end end
it { is_expected_to_have_progress_bar(status: show_progress_bar) } it { is_expected_to_have_progress_bar(status: show_progress_bar) }
it { is_expected_to_show_joining_question(show_joining_question) }
context 'bypass_registration experiment' do
it { is_expected.not_to have_selector('#joining_project_true') }
context 'when in the candidate variant' do
let(:experiments) { { bypass_registration: :candidate } }
it { is_expected_to_show_joining_question(show_joining_question) }
end
end
context 'feature flag other_role_details is enabled' do context 'feature flag other_role_details is enabled' do
let_it_be(:user_other_role_details_enabled) { true } let_it_be(:user_other_role_details_enabled) { true }
......
...@@ -21295,9 +21295,6 @@ msgstr "" ...@@ -21295,9 +21295,6 @@ msgstr ""
msgid "Iteration|cannot be more than 500 years in the future" msgid "Iteration|cannot be more than 500 years in the future"
msgstr "" msgstr ""
msgid "I’m joining my team who’s already on GitLab"
msgstr ""
msgid "Jaeger URL" msgid "Jaeger URL"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment