Commit 25a499e9 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch...

Merge branch '348352-experiment-cleanup-display-known-fields-in-locked-fields-within-trial-sign-up-form' into 'master'

Revert experiment: Lock known fields during trial

See merge request gitlab-org/gitlab!76831
parents fc24eca2 12be6cd0
...@@ -41,9 +41,6 @@ module Registrations ...@@ -41,9 +41,6 @@ module Registrations
def apply_trial_for_trial_onboarding_flow def apply_trial_for_trial_onboarding_flow
if apply_trial if apply_trial
record_experiment_user(:remove_known_trial_form_fields_welcoming, namespace_id: @group.id)
record_experiment_conversion_event(:remove_known_trial_form_fields_welcoming)
experiment(:trial_registration_with_reassurance, actor: current_user).track( experiment(:trial_registration_with_reassurance, actor: current_user).track(
:apply_trial, :apply_trial,
label: 'registrations:groups:create', label: 'registrations:groups:create',
......
...@@ -42,8 +42,6 @@ module Registrations ...@@ -42,8 +42,6 @@ module Registrations
if helpers.registration_verification_enabled? if helpers.registration_verification_enabled?
redirect_to new_users_sign_up_verification_path(url_params.merge(combined: true)) redirect_to new_users_sign_up_verification_path(url_params.merge(combined: true))
elsif helpers.in_trial_onboarding_flow? elsif helpers.in_trial_onboarding_flow?
record_experiment_user(:remove_known_trial_form_fields_welcoming, namespace_id: @group.id)
record_experiment_conversion_event(:remove_known_trial_form_fields_welcoming)
redirect_to trial_getting_started_users_sign_up_welcome_path(url_params) redirect_to trial_getting_started_users_sign_up_welcome_path(url_params)
else else
......
...@@ -20,7 +20,6 @@ class TrialsController < ApplicationController ...@@ -20,7 +20,6 @@ class TrialsController < ApplicationController
def new def new
experiment(:trial_registration_with_reassurance, actor: current_user) experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'trials:new', user: current_user) .track(:render, label: 'trials:new', user: current_user)
record_experiment_user(:remove_known_trial_form_fields_welcoming, remove_known_trial_form_fields_context)
end end
def select def select
...@@ -212,15 +211,6 @@ class TrialsController < ApplicationController ...@@ -212,15 +211,6 @@ class TrialsController < ApplicationController
group group
end end
def remove_known_trial_form_fields_context
{
first_name_present: current_user.first_name.present?,
last_name_present: current_user.last_name.present?,
company_name_present: current_user.organization.present?,
variant: helpers.remove_known_trial_form_fields_variant
}
end
def redirect_trial_user_to_feature_experiment_flow def redirect_trial_user_to_feature_experiment_flow
experiment(:redirect_trial_user_to_feature, namespace: @namespace) do |e| experiment(:redirect_trial_user_to_feature, namespace: @namespace) do |e|
e.use { redirect_to group_url(@namespace, { trial: true }) } e.use { redirect_to group_url(@namespace, { trial: true }) }
...@@ -239,9 +229,6 @@ class TrialsController < ApplicationController ...@@ -239,9 +229,6 @@ class TrialsController < ApplicationController
@result = GitlabSubscriptions::ApplyTrialService.new.execute(apply_trial_params) @result = GitlabSubscriptions::ApplyTrialService.new.execute(apply_trial_params)
if @result&.dig(:success) if @result&.dig(:success)
record_experiment_user(:remove_known_trial_form_fields_welcoming, namespace_id: @namespace.id)
record_experiment_conversion_event(:remove_known_trial_form_fields_welcoming)
experiment(:trial_registration_with_reassurance, actor: current_user) experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:apply_trial, label: 'trials:apply', namespace: @namespace, user: current_user) .track(:apply_trial, label: 'trials:apply', namespace: @namespace, user: current_user)
......
...@@ -74,16 +74,6 @@ module EE ...@@ -74,16 +74,6 @@ module EE
} }
end end
def remove_known_trial_form_fields_variant
if experiment_enabled?(:remove_known_trial_form_fields_welcoming, subject: current_user)
:welcoming
elsif experiment_enabled?(:remove_known_trial_form_fields_noneditable, subject: current_user)
:noneditable
else
:control
end
end
def only_trialable_group_namespace def only_trialable_group_namespace
trialable_group_namespaces.first if trialable_group_namespaces.count == 1 trialable_group_namespaces.first if trialable_group_namespaces.count == 1
end end
......
...@@ -9,37 +9,20 @@ ...@@ -9,37 +9,20 @@
= _("Start your Free Ultimate Trial") = _("Start your Free Ultimate Trial")
%p.gl-text-center %p.gl-text-center
- if remove_known_trial_form_fields_variant == :welcoming = s_('Trial|Your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information to activate your trial.')
- salutation = current_user.first_name.present? ? " #{current_user.first_name}" : ''
- company = current_user.organization.present? ? current_user.organization : s_('Trial|your company')
= s_("Trial|Hi%{salutation}, your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information about %{company} to activate your trial.") % { salutation: salutation, company: company }
- else
= s_('Trial|Your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information to activate your trial.')
= render 'errors' = render 'errors'
= form_tag create_lead_trials_path(glm_params), method: :post do |f| = form_tag create_lead_trials_path(glm_params), method: :post do |f|
- if remove_known_trial_form_fields_variant == :welcoming && current_user.first_name.present? .form-group
= hidden_field_tag :first_name, current_user.first_name = label_tag :first_name, s_('Trial|First name'), for: :first_name, class: 'col-form-label'
- else = text_field_tag :first_name, params[:first_name] || current_user.first_name, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'first_name' }
.form-group .form-group
= label_tag :first_name, s_('Trial|First name'), for: :first_name, class: 'col-form-label' = label_tag :last_name, s_('Trial|Last name'), for: :last_name, class: 'col-form-label'
- readonly = remove_known_trial_form_fields_variant == :noneditable && current_user.first_name.present? = text_field_tag :last_name, params[:last_name] || current_user.last_name, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'last_name' }
= text_field_tag :first_name, params[:first_name] || current_user.first_name, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'first_name' }, readonly: readonly .form-group
- if remove_known_trial_form_fields_variant == :welcoming && current_user.last_name.present? = label_tag :company_name, s_('Trial|Company name'), for: :company_name, class: 'col-form-label'
= hidden_field_tag :last_name, current_user.last_name = text_field_tag :company_name, params[:company_name] || current_user.organization, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'company_name' }
- else
.form-group
= label_tag :last_name, s_('Trial|Last name'), for: :last_name, class: 'col-form-label'
- readonly = remove_known_trial_form_fields_variant == :noneditable && current_user.last_name.present?
= text_field_tag :last_name, params[:last_name] || current_user.last_name, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'last_name' }, readonly: readonly
- if remove_known_trial_form_fields_variant == :welcoming && current_user.organization.present?
= hidden_field_tag :company_name, current_user.organization
- else
.form-group
= label_tag :company_name, s_('Trial|Company name'), for: :company_name, class: 'col-form-label'
- readonly = remove_known_trial_form_fields_variant == :noneditable && current_user.organization.present?
= text_field_tag :company_name, params[:company_name] || current_user.organization, class: 'form-control gl-form-input', required: true, data: { qa_selector: 'company_name' }, readonly: readonly
.form-group.gl-select2-html5-required-fix .form-group.gl-select2-html5-required-fix
= label_tag :company_size, s_('Trial|Number of employees'), for: :company_size, class: 'col-form-label' = label_tag :company_size, s_('Trial|Number of employees'), for: :company_size, class: 'col-form-label'
= select_tag :company_size, company_size_options_for_select(params[:company_size]), class: 'select2', required: true, data: { qa_selector: 'number_of_employees' } = select_tag :company_size, company_size_options_for_select(params[:company_size]), class: 'select2', required: true, data: { qa_selector: 'number_of_employees' }
......
---
name: remove_known_trial_form_fields_noneditable_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65493
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/337439
milestone: '14.2'
type: experiment
group: group::conversion
default_enabled: false
---
name: remove_known_trial_form_fields_welcoming_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65493
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/337439
milestone: '14.2'
type: experiment
group: group::conversion
default_enabled: false
...@@ -87,8 +87,6 @@ RSpec.describe Registrations::GroupsController do ...@@ -87,8 +87,6 @@ RSpec.describe Registrations::GroupsController do
expect_next_instance_of(GitlabSubscriptions::ApplyTrialService) do |service| expect_next_instance_of(GitlabSubscriptions::ApplyTrialService) do |service|
expect(service).to receive(:execute).with(apply_trial_params).and_return({ success: true }) expect(service).to receive(:execute).with(apply_trial_params).and_return({ success: true })
end end
expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields_welcoming, namespace_id: group.id)
expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields_welcoming)
end end
context 'with redirection to projects page' do context 'with redirection to projects page' do
......
...@@ -56,17 +56,6 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do ...@@ -56,17 +56,6 @@ RSpec.describe Registrations::GroupsProjectsController, :experiment do
it_behaves_like 'hides email confirmation warning' it_behaves_like 'hides email confirmation warning'
context 'when group and project can be created' do context 'when group and project can be created' do
context 'when in the in_trial_onboarding_flow' do
let(:extra_params) { { trial_onboarding_flow: true } }
it 'tracks events for the remove_known_trial_form_fields_welcoming experiment' do
expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields_welcoming, namespace_id: anything)
expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields_welcoming)
post_create
end
end
it 'creates a group' do it 'creates a group' do
expect { post_create }.to change { Group.count }.by(1) expect { post_create }.to change { Group.count }.by(1)
end end
......
...@@ -4,14 +4,6 @@ require 'spec_helper' ...@@ -4,14 +4,6 @@ require 'spec_helper'
RSpec.describe TrialsController, :saas do RSpec.describe TrialsController, :saas do
let_it_be(:user) { create(:user, email_opted_in: true, last_name: 'Doe') } let_it_be(:user) { create(:user, email_opted_in: true, last_name: 'Doe') }
let_it_be(:remove_known_trial_form_fields_context) do
{
first_name_present: user.first_name.present?,
last_name_present: user.last_name.present?,
company_name_present: user.organization.present?,
variant: :control
}
end
let(:dev_env_or_com) { true } let(:dev_env_or_com) { true }
let(:logged_in) { true } let(:logged_in) { true }
...@@ -72,8 +64,6 @@ RSpec.describe TrialsController, :saas do ...@@ -72,8 +64,6 @@ RSpec.describe TrialsController, :saas do
end end
it 'calls record_experiment_user for the experiments' do it 'calls record_experiment_user for the experiments' do
expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields_welcoming, remove_known_trial_form_fields_context)
get_new get_new
end end
...@@ -379,13 +369,6 @@ RSpec.describe TrialsController, :saas do ...@@ -379,13 +369,6 @@ RSpec.describe TrialsController, :saas do
it { is_expected.to redirect_to("/#{namespace.path}?trial=true") } it { is_expected.to redirect_to("/#{namespace.path}?trial=true") }
it 'calls the record conversion method for the experiments' do
expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields_welcoming, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields_welcoming)
post_apply
end
context 'when the trial_registration_with_reassurance experiment is active', :experiment do context 'when the trial_registration_with_reassurance experiment is active', :experiment do
before do before do
stub_experiments(trial_registration_with_reassurance: :control) stub_experiments(trial_registration_with_reassurance: :control)
...@@ -453,8 +436,6 @@ RSpec.describe TrialsController, :saas do ...@@ -453,8 +436,6 @@ RSpec.describe TrialsController, :saas do
it { is_expected.to render_template(:select) } it { is_expected.to render_template(:select) }
it 'does not call the record conversion method for the experiments' do it 'does not call the record conversion method for the experiments' do
expect(controller).not_to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields_welcoming)
post_apply post_apply
end end
......
...@@ -266,29 +266,6 @@ RSpec.describe EE::TrialHelper do ...@@ -266,29 +266,6 @@ RSpec.describe EE::TrialHelper do
end end
end end
describe '#remove_known_trial_form_fields_variant' do
let_it_be(:user) { create(:user) }
subject { helper.remove_known_trial_form_fields_variant }
before do
helper.extend(Gitlab::Experimentation::ControllerConcern)
allow(helper).to receive(:current_user).and_return(user)
stub_experiment_for_subject(remove_known_trial_form_fields_welcoming: welcoming, remove_known_trial_form_fields_noneditable: noneditable)
end
where(:welcoming, :noneditable, :result) do
true | true | :welcoming
true | false | :welcoming
false | true | :noneditable
false | false | :control
end
with_them do
it { is_expected.to eq(result) }
end
end
describe '#only_trialable_group_namespace' do describe '#only_trialable_group_namespace' do
subject { helper.only_trialable_group_namespace } subject { helper.only_trialable_group_namespace }
......
...@@ -9,7 +9,6 @@ RSpec.describe 'trials/new.html.haml' do ...@@ -9,7 +9,6 @@ RSpec.describe 'trials/new.html.haml' do
before do before do
allow(view).to receive(:current_user) { user } allow(view).to receive(:current_user) { user }
allow(view).to receive(:remove_known_trial_form_fields_variant).and_return(variant)
render render
end end
...@@ -23,55 +22,4 @@ RSpec.describe 'trials/new.html.haml' do ...@@ -23,55 +22,4 @@ RSpec.describe 'trials/new.html.haml' do
sizes = ['Please select', '1 - 99', '100 - 499', '500 - 1,999', '2,000 - 9,999', '10,000 +'] sizes = ['Please select', '1 - 99', '100 - 499', '500 - 1,999', '2,000 - 9,999', '10,000 +']
is_expected.to have_select('company_size', options: sizes, selected: []) is_expected.to have_select('company_size', options: sizes, selected: [])
end end
context 'remove_known_trial_form_fields noneditable experiment is enabled' do
let_it_be(:variant) { :noneditable }
it { is_expected.to have_content('Your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information to activate your trial.') }
context 'the user has already values in first, last and company names' do
let_it_be(:user) { build(:user, first_name: 'John', last_name: 'Doe', organization: 'ACME') }
it 'has readonly fields', :aggregate_failures do
is_expected.to have_field('first_name', readonly: true)
is_expected.to have_field('last_name', readonly: true)
is_expected.to have_field('company_name', readonly: true)
end
end
context 'the user empty values for first, last and company names' do
let_it_be(:user) { build(:user, first_name: '', last_name: '', organization: '') }
it 'has fields', :aggregate_failures do
is_expected.to have_field('first_name')
is_expected.to have_field('last_name')
is_expected.to have_field('company_name')
end
end
end
context 'remove_known_trial_form_fields welcoming experiment is enabled' do
let_it_be(:variant) { :welcoming }
context 'the user has already values in first, last and company names' do
let_it_be(:user) { build(:user, first_name: 'John', last_name: 'Doe', organization: 'ACME') }
it { is_expected.to have_content('Hi John, your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information about ACME to activate your trial.') }
it 'has hidden fields' do
is_expected.to have_field('first_name', type: :hidden)
is_expected.to have_field('last_name', type: :hidden)
is_expected.to have_field('company_name', type: :hidden)
end
end
context 'the user empty values for first, last and company names' do
let_it_be(:user) { build(:user, first_name: '', last_name: '', organization: '') }
it { is_expected.to have_content('Hi, your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information about your company to activate your trial.') }
it 'has fields' do
is_expected.to have_field('first_name')
is_expected.to have_field('last_name')
is_expected.to have_field('company_name')
end
end
end
end end
...@@ -30,14 +30,6 @@ ...@@ -30,14 +30,6 @@
module Gitlab module Gitlab
module Experimentation module Experimentation
EXPERIMENTS = { EXPERIMENTS = {
remove_known_trial_form_fields_welcoming: {
tracking_category: 'Growth::Conversion::Experiment::RemoveKnownTrialFormFieldsWelcoming',
rollout_strategy: :user
},
remove_known_trial_form_fields_noneditable: {
tracking_category: 'Growth::Conversion::Experiment::RemoveKnownTrialFormFieldsNoneditable',
rollout_strategy: :user
}
}.freeze }.freeze
class << self class << self
......
...@@ -37283,9 +37283,6 @@ msgstr "" ...@@ -37283,9 +37283,6 @@ msgstr ""
msgid "Trial|GitLab Ultimate trial (optional)" msgid "Trial|GitLab Ultimate trial (optional)"
msgstr "" msgstr ""
msgid "Trial|Hi%{salutation}, your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information about %{company} to activate your trial."
msgstr ""
msgid "Trial|How many employees will use Gitlab?" msgid "Trial|How many employees will use Gitlab?"
msgstr "" msgstr ""
...@@ -37316,9 +37313,6 @@ msgstr "" ...@@ -37316,9 +37313,6 @@ msgstr ""
msgid "Trial|Your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information to activate your trial." msgid "Trial|Your GitLab Ultimate trial lasts for 30 days, but you can keep your free GitLab account forever. We just need some additional information to activate your trial."
msgstr "" msgstr ""
msgid "Trial|your company"
msgstr ""
msgid "Trigger" msgid "Trigger"
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