Commit 0c2fa2c1 authored by Dallas Reedy's avatar Dallas Reedy

Promote the trial_registrations_with_reassurance experiment

- Remove the feature flag
- Remove all uses of the feature flag (mostly calls to GLEX)
- Promote the `try` portion of the view
- Update the view specs

Changelog: added
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/78920
EE: true
parent f2b5a66e
......@@ -20,8 +20,6 @@ module EE
before_action only: :show do
publish_combined_registration_experiment
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'registrations:welcome:show', user: current_user)
end
before_action only: [:trial_getting_started] do
......
......@@ -12,8 +12,6 @@ module Registrations
feature_category :onboarding
def new
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'registrations:groups:new', user: current_user)
@group = Group.new(visibility_level: helpers.default_group_visibility)
experiment(:combined_registration, user: current_user).track(:view_new_group_action)
push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)
......@@ -43,13 +41,6 @@ module Registrations
def apply_trial_for_trial_onboarding_flow
if apply_trial
experiment(:trial_registration_with_reassurance, actor: current_user).track(
:apply_trial,
label: 'registrations:groups:create',
namespace: @group,
user: current_user
)
redirect_to new_users_sign_up_project_path(namespace_id: @group.id, trial: helpers.in_trial_during_signup_flow?, trial_onboarding_flow: true)
else
render action: :new
......
......@@ -22,8 +22,6 @@ module Registrations
@project = Project.new(namespace: @group)
combined_registration_experiment.track(:view_new_group_action)
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'registrations:groups:new', user: current_user)
end
def create
......
......@@ -21,18 +21,6 @@ class TrialRegistrationsController < RegistrationsController
private
# This is called from within the RegistrationsController#create action and is
# given the newly created user.
def after_request_hook(user)
super
return unless user.persisted?
e = experiment(:trial_registration_with_reassurance, actor: user)
e.track(:create_user, label: 'trial_registrations:create', user: user)
e.publish_to_database
end
def set_redirect_url
target_url = new_trial_url(params: request.query_parameters)
......
......@@ -21,13 +21,9 @@ class TrialsController < ApplicationController
feature_category :purchase
def new
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'trials:new', user: current_user)
end
def select
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:render, label: 'trials:select', user: current_user)
end
def create_lead
......@@ -227,9 +223,6 @@ class TrialsController < ApplicationController
@result = GitlabSubscriptions::ApplyTrialService.new.execute(apply_trial_params)
if @result&.dig(:success)
experiment(:trial_registration_with_reassurance, actor: current_user)
.track(:apply_trial, label: 'trials:apply', namespace: @namespace, user: current_user)
experiment(:combined_registration, user: current_user).track(:create_trial)
if discover_group_security_flow?
......
......@@ -5,39 +5,25 @@
= render "layouts/one_trust"
= render "layouts/google_tag_manager_body"
- registration_form_content = capture do
.signup-page
= render 'devise/shared/signup_box',
url: trial_registrations_path,
button_text: _('Continue'),
show_omniauth_providers: social_signin_enabled?,
omniauth_providers_placement: :top
= render 'devise/shared/sign_in_link'
%p.gl-text-center
= s_('InProductMarketing|Want to host GitLab on your servers?')
= link_to s_('InProductMarketing|Start a Self-Managed trial'), 'https://about.gitlab.com/free-trial/#selfmanaged/', data: { track_action: 'click_link', track_label: 'start_self-managed_trial' }
.row
- experiment(:trial_registration_with_reassurance, actor: current_user) do |e|
- if e.should_track?
%span{ data: { track_action: :render, track_experiment: :trial_registration_with_reassurance } }
.col-lg-6.gl-display-none.gl-lg-display-flex.gl-flex-direction-column.gl-align-items-center.gl-justify-content-start
.gl-w-28
= render 'reassurances'
.col-md-6.offset-md-3.offset-lg-0
%h2.gl-lg-display-none.gl-mb-3.gl-mt-0.gl-text-gray-800
= s_('InProductMarketing|Free 30-day trial')
%p.gl-lg-display-none.gl-font-lg.gl-text-gray-800
= s_('InProductMarketing|No credit card required.')
- e.use do
.col-md-6.offset-md-3
%h2.gl-text-center.gl-pb-5.gl-my-0
= _('Start a Free Ultimate Trial')
= registration_form_content
.signup-page
= render 'devise/shared/signup_box',
url: trial_registrations_path,
button_text: _('Continue'),
show_omniauth_providers: social_signin_enabled?,
omniauth_providers_placement: :top
- e.try do
.col-lg-6.gl-display-none.gl-lg-display-flex.gl-flex-direction-column.gl-align-items-center.gl-justify-content-start
.gl-w-28
= render 'reassurances'
.col-md-6.offset-md-3.offset-lg-0
%h2.gl-lg-display-none.gl-mb-3.gl-mt-0.gl-text-gray-800
= s_('InProductMarketing|Free 30-day trial')
%p.gl-lg-display-none.gl-font-lg.gl-text-gray-800
= s_('InProductMarketing|No credit card required.')
= render 'devise/shared/sign_in_link'
= registration_form_content
%p.gl-text-center
= s_('InProductMarketing|Want to host GitLab on your servers?')
= link_to s_('InProductMarketing|Start a Self-Managed trial'), 'https://about.gitlab.com/free-trial/#selfmanaged/', data: { track_action: 'click_link', track_label: 'start_self-managed_trial' }
---
name: trial_registration_with_reassurance
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61639
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/281028
milestone: '14.1'
type: experiment
group: group::conversion
default_enabled: false
......@@ -92,19 +92,6 @@ RSpec.describe Registrations::GroupsController do
context 'with redirection to projects page' do
it { is_expected.to redirect_to(new_users_sign_up_project_path(namespace_id: group.id, trial: false, trial_onboarding_flow: true)) }
end
it 'tracks an event for the trial_registration_with_reassurance experiment', :experiment do
stub_experiments(trial_registration_with_reassurance: :control)
expect(experiment(:trial_registration_with_reassurance)).to track(
:apply_trial,
user: user,
namespace: group,
label: 'registrations:groups:create'
).with_context(actor: user).on_next_instance
post_create
end
end
context 'when failing to apply trial' do
......
......@@ -80,22 +80,6 @@ RSpec.describe TrialRegistrationsController do
expect(User.last).not_to be_confirmed
end
context 'when the trial_registration_with_reassurance experiment is active', :experiment do
before do
stub_experiments(trial_registration_with_reassurance: :control)
end
it 'tracks a "create_user" event & records the actor to the database', :aggregate_failures do
expect(experiment(:trial_registration_with_reassurance)).to track(
:create_user,
user: an_instance_of(User),
label: 'trial_registrations:create'
).with_context(actor: an_instance_of(User)).on_next_instance
expect { post_create }.to change { ExperimentSubject.count }
end
end
context 'derivation of name' do
it 'sets name from first and last name' do
post_create
......
......@@ -47,22 +47,6 @@ RSpec.describe TrialsController, :saas do
response
end
context 'when the trial_registration_with_reassurance experiment is active', :experiment do
before do
stub_experiments(trial_registration_with_reassurance: :control)
end
it 'tracks a "render" event' do
expect(experiment(:trial_registration_with_reassurance)).to track(
:render,
user: user,
label: 'trials:new'
).with_context(actor: user).on_next_instance
get_new
end
end
it 'calls record_experiment_user for the experiments' do
get_new
end
......@@ -323,22 +307,6 @@ RSpec.describe TrialsController, :saas do
it_behaves_like 'an authenticated endpoint'
it_behaves_like 'a dot-com only feature'
context 'when the trial_registration_with_reassurance experiment is active', :experiment do
before do
stub_experiments(trial_registration_with_reassurance: :control)
end
it 'tracks a "render" event' do
expect(experiment(:trial_registration_with_reassurance)).to track(
:render,
user: user,
label: 'trials:select'
).with_context(actor: user).on_next_instance
get_select
end
end
end
describe '#apply' do
......@@ -369,23 +337,6 @@ RSpec.describe TrialsController, :saas do
it { is_expected.to redirect_to("/#{namespace.path}?trial=true") }
context 'when the trial_registration_with_reassurance experiment is active', :experiment do
before do
stub_experiments(trial_registration_with_reassurance: :control)
end
it 'tracks an "apply_trial" event' do
expect(experiment(:trial_registration_with_reassurance)).to track(
:apply_trial,
user: user,
namespace: namespace,
label: 'trials:apply'
).with_context(actor: user).on_next_instance
post_apply
end
end
it 'calls tracking event for combined_registration experiment', :experiment do
expect(experiment(:combined_registration)).to track(:create_trial).on_next_instance
......
......@@ -50,22 +50,6 @@ RSpec.shared_examples "Registrations::GroupsController GET #new" do
expect(assigns(:group).visibility_level).to eq(Gitlab::CurrentSettings.default_group_visibility)
end
context 'when the trial_registration_with_reassurance experiment is active', :experiment do
before do
stub_experiments(trial_registration_with_reassurance: :control)
end
it 'tracks a "render" event' do
expect(experiment(:trial_registration_with_reassurance)).to track(
:render,
user: user,
label: 'registrations:groups:new'
).with_context(actor: user).on_next_instance
get :new
end
end
context 'user without the ability to create a group' do
let(:user) { create(:user, can_create_group: false) }
......
......@@ -12,49 +12,10 @@ RSpec.describe 'trial_registrations/new.html.haml' do
subject { render && rendered }
describe 'trial_registration_with_reassurance experiment', :experiment do
context 'when the experiment is enabled' do
let(:variant) { :control }
before do
stub_experiments(trial_registration_with_reassurance: variant)
end
context 'when in the control' do
it { is_expected.to have_content(_('Start a Free Ultimate Trial')) }
it { is_expected.not_to have_content(s_('InProductMarketing|Free 30-day trial')) }
it { is_expected.not_to have_content(s_('InProductMarketing|No credit card required.')) }
it { is_expected.not_to have_selector('img[alt$=" logo"]') }
end
context 'when in the candidate' do
let(:variant) { :candidate }
it { is_expected.not_to have_content(_('Start a Free Ultimate Trial')) }
it { is_expected.to have_content(s_('InProductMarketing|Free 30-day trial')) }
it { is_expected.to have_content(s_('InProductMarketing|No credit card required.')) }
it { is_expected.to have_selector('img[alt$=" logo"]') }
end
end
describe 'tracking page-render using a frontend event' do
context 'when the experiment should be tracked, like when it is enabled' do
before do
stub_experiments(trial_registration_with_reassurance: :control)
end
it { is_expected.to have_selector('span[data-track-action="render"]') }
end
context 'when the experiment should not be tracked, like when it is disabled' do
before do
stub_feature_flags(trial_registration_with_reassurance: false)
end
it { is_expected.not_to have_selector('span[data-track-action="render"]') }
end
end
end
it { is_expected.not_to have_content(_('Start a Free Ultimate Trial')) }
it { is_expected.to have_content(s_('InProductMarketing|Free 30-day trial')) }
it { is_expected.to have_content(s_('InProductMarketing|No credit card required.')) }
it { is_expected.to have_selector('img[alt$=" logo"]') }
it { is_expected.to have_content(s_('InProductMarketing|Want to host GitLab on your servers?')) }
it { is_expected.to have_link(s_('InProductMarketing|Start a Self-Managed trial'), href: 'https://about.gitlab.com/free-trial/#selfmanaged/') }
......
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