Commit 6726be7f authored by Alper Akgun's avatar Alper Akgun

Promote continuous onboarding A variant

Experiment cleanup: Continuous onboarding

Changelog: added
parent 13d43101
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13 25C19.6274 25 25 19.6274 25 13C25 6.37258 19.6274 1 13 1C6.37258 1 1 6.37258 1 13C1 19.6274 6.37258 25 13 25Z" fill="white" stroke="#C2B7E6" stroke-width="2"/>
<path d="M1.16748 12.3359C2.88075 11.7701 4.4618 10.8635 5.81545 9.67055C7.16911 8.47763 8.26738 7.02313 9.04415 5.39461M6.94481 2.60461C9.28681 6.43995 13.5115 8.99995 18.3335 8.99995C20.2715 8.99995 22.1135 8.58661 23.7748 7.84261L6.94481 2.60461Z" stroke="#C2B7E6"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1176 15.8941H15.7647C15.7647 17.447 14.4941 18.7176 12.9412 18.7176C11.3882 18.7176 10.1176 17.447 10.1176 15.8941ZM9.05882 15.1882C8.47294 15.1882 8 14.7153 8 14.1294C8 13.5435 8.47294 13.0706 9.05882 13.0706C9.64471 13.0706 10.1176 13.5435 10.1176 14.1294C10.1176 14.7153 9.64471 15.1882 9.05882 15.1882ZM16.8235 15.1882C16.2376 15.1882 15.7647 14.7153 15.7647 14.1294C15.7647 13.5435 16.2376 13.0706 16.8235 13.0706C17.4094 13.0706 17.8824 13.5435 17.8824 14.1294C17.8824 14.7153 17.4094 15.1882 16.8235 15.1882Z" fill="#6B4FBB"/>
</svg>
<svg width="40" height="39" viewBox="0 0 40 39" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M32.2886 3.99573H37.8624C38.1834 3.99573 38.4435 4.25587 38.4435 4.57679V33.9598C38.4435 34.2808 38.1834 34.5409 37.8624 34.5409H32.2886V3.99573Z" fill="#F0F0F0" stroke="#DBDBDB" stroke-width="2"/>
<path d="M10.757 9.4011L10.7363 4.92686C10.7337 4.35386 11.1491 3.86447 11.7148 3.77395L30.908 0.703095C31.614 0.590124 32.2537 1.13556 32.2537 1.85062V37.0106C32.2537 37.723 31.6184 38.2678 30.9143 38.1591L11.8555 35.2171C11.2908 35.13 10.8733 34.6453 10.8707 34.074L10.8502 29.6368" stroke="#DBDBDB" stroke-width="2"/>
<path d="M11.2195 29.7561C16.877 29.7561 21.4634 25.1698 21.4634 19.5122C21.4634 13.8547 16.877 9.26831 11.2195 9.26831C5.56194 9.26831 0.975586 13.8547 0.975586 19.5122C0.975586 25.1698 5.56194 29.7561 11.2195 29.7561Z" stroke="#6E49CB"/>
<path d="M11.2194 27.8048C15.7994 27.8048 19.5121 24.0921 19.5121 19.5122C19.5121 14.9322 15.7994 11.2195 11.2194 11.2195C6.63952 11.2195 2.92676 14.9322 2.92676 19.5122C2.92676 24.0921 6.63952 27.8048 11.2194 27.8048Z" fill="#6E49CB"/>
<path d="M11.2194 27.8048C15.7994 27.8048 19.5121 24.0921 19.5121 19.5122C19.5121 14.9322 15.7994 11.2195 11.2194 11.2195C6.63952 11.2195 2.92676 14.9322 2.92676 19.5122C2.92676 24.0921 6.63952 27.8048 11.2194 27.8048Z" fill="white" fill-opacity="0.9"/>
<path d="M10.8843 23.4146V16.276" stroke="#6E49CB" stroke-linecap="round"/>
<path d="M7.31689 19.6609H14.634" stroke="#6E49CB" stroke-linecap="round"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="40" height="39.0244" fill="white"/>
</clipPath>
</defs>
</svg>
This diff is collapsed.
This diff is collapsed.
<svg width="32" height="30" viewBox="0 0 32 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9653 29.8263L21.8368 11.6285H10.0933L15.9653 29.8263Z" fill="#E38800"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9656 29.8263L10.0936 11.6285H1.86475L15.9656 29.8263Z" fill="#F7980A"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.86441 11.6285L0.0800968 17.1586C-0.0826524 17.663 0.0955967 18.2156 0.521693 18.5273L15.9652 29.8261L1.86441 11.6285Z" fill="#FCA326"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.86426 11.6286H10.0933L6.55678 0.668335C6.37489 0.104294 5.58257 0.104447 5.40067 0.668335L1.86426 11.6286Z" fill="#E38800"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.9653 29.8263L21.8369 11.6285H30.0658L15.9653 29.8263Z" fill="#F7980A"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.0662 11.6285L31.8505 17.1586C32.0132 17.663 31.835 18.2156 31.4089 18.5273L15.9653 29.8261L30.0662 11.6285Z" fill="#FCA326"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.066 11.6286H21.8369L25.3735 0.668335C25.5554 0.104294 26.3477 0.104447 26.5296 0.668335L30.066 11.6286Z" fill="#E38800"/>
</svg>
<svg width="38" height="24" viewBox="0 0 38 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M33.6353 7.51765H33.8824L32.4706 5.80941L31.0588 7.50353L29.6471 5.80941L28.2353 7.50353L26.8235 5.80941L25.4118 7.50353L24 5.80941L22.5882 7.51765H23.1318C23.6965 8.89412 24 10.4118 24 12C24 14.0047 23.5059 15.8824 22.6447 17.5482C24.0353 19.1576 26.0541 20.1176 28.2353 20.1176C32.3294 20.1176 35.6471 16.7718 35.6471 12.6353C35.6471 10.6588 34.8847 8.85177 33.6353 7.51765ZM22.0094 5.36471C23.7035 3.88235 25.9059 3.03529 28.2353 3.03529C33.5012 3.03529 37.7647 7.34118 37.7647 12.6353C37.7647 17.9294 33.5012 22.2353 28.2353 22.2353C25.6376 22.2353 23.2235 21.1765 21.4588 19.3835C19.2706 22.1929 15.84 24 12 24C5.36471 24 0 18.6353 0 12C0 5.36471 5.36471 0 12 0C14.2729 0 16.3976 0.635295 18.2118 1.72941C19.7153 2.64706 21.0141 3.88235 22.0094 5.37177V5.36471ZM3.52941 8.47059C3.07059 9.55765 2.82353 10.7506 2.82353 12C2.82353 17.0682 6.93177 21.1765 12 21.1765C17.0682 21.1765 21.1765 17.0682 21.1765 12C21.1765 10.7506 20.9294 9.55765 20.4706 8.47059H14.1176C13.7435 8.47059 13.3835 8.32941 13.1294 8.04706L12 6.94588L10.8706 8.06118C10.6165 8.34353 10.2565 8.48471 9.88235 8.48471H3.52941V8.47059ZM18.6212 5.64706C16.9271 3.88235 14.5553 2.82353 12 2.82353C9.44471 2.82353 7.07294 3.88235 5.37882 5.64706H9.29647L11.0047 3.95294C11.5271 3.38824 12.4165 3.38824 12.9812 3.95294L14.6753 5.64706H18.5859H18.6212Z" fill="#E1DBF2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.1292 14.3435C24.6633 14.3435 24.2821 13.9623 24.2821 13.4964C24.2821 13.0164 24.6633 12.6353 25.1292 12.6353C25.5951 12.6353 25.9762 13.0164 25.9762 13.4823C25.9762 13.9623 25.5951 14.3435 25.1292 14.3435ZM31.3409 14.3435C30.8751 14.3435 30.4939 13.9623 30.4939 13.4964C30.4939 13.0164 30.8751 12.6353 31.3409 12.6353C31.8068 12.6353 32.188 13.0164 32.188 13.4823C32.188 13.9623 31.8068 14.3435 31.3409 14.3435ZM9.17624 15.5294H14.8233C14.8233 17.0823 13.5527 18.3529 11.9998 18.3529C10.4468 18.3529 9.17624 17.0823 9.17624 15.5294ZM8.11742 14.8235C7.53153 14.8235 7.05859 14.3505 7.05859 13.7647C7.05859 13.1788 7.53153 12.7058 8.11742 12.7058C8.7033 12.7058 9.17624 13.1788 9.17624 13.7647C9.17624 14.3505 8.7033 14.8235 8.11742 14.8235ZM15.8821 14.8235C15.2962 14.8235 14.8233 14.3505 14.8233 13.7647C14.8233 13.1788 15.2962 12.7058 15.8821 12.7058C16.468 12.7058 16.9409 13.1788 16.9409 13.7647C16.9409 14.3505 16.468 14.8235 15.8821 14.8235Z" fill="#6B4FBB"/>
</svg>
import Tracking from '~/tracking';
export default function trackLearnGitlab(learnGitlabA) {
Tracking.event('projects:learn_gitlab:index', 'page_init', {
label: 'learn_gitlab',
property: learnGitlabA
? 'Growth::Conversion::Experiment::LearnGitLabA'
: 'Growth::Activation::Experiment::LearnGitLabB',
});
}
<script>
import { GlProgressBar, GlSprintf } from '@gitlab/ui';
import { pick } from 'lodash';
import { s__ } from '~/locale';
import { ACTION_LABELS } from '../constants';
import LearnGitlabInfoCard from './learn_gitlab_info_card.vue';
export default {
components: { LearnGitlabInfoCard, GlProgressBar, GlSprintf },
i18n: {
title: s__('LearnGitLab|Learn GitLab'),
description: s__(
'LearnGitLab|Ready to get started with GitLab? Follow these steps to set up your workspace, plan and commit changes, and deploy your project.',
),
percentageCompleted: s__(`LearnGitLab|%{percentage}%{percentSymbol} completed`),
workspace: {
title: s__('LearnGitLab|Set up your workspace'),
description: s__(
"LearnGitLab|Complete these tasks first so you can enjoy GitLab's features to their fullest:",
),
},
plan: {
title: s__('LearnGitLab|Plan and execute'),
description: s__(
'LearnGitLab|Create a workflow for your new workspace, and learn how GitLab features work together:',
),
},
deploy: {
title: s__('LearnGitLab|Deploy'),
description: s__(
'LearnGitLab|Use your new GitLab workflow to deploy your application, monitor its health, and keep it secure:',
),
},
},
props: {
actions: {
required: true,
type: Object,
},
},
maxValue: Object.keys(ACTION_LABELS).length,
methods: {
infoProps(action) {
return {
...this.actions[action],
...pick(ACTION_LABELS[action], ['title', 'actionLabel', 'description', 'trialRequired']),
};
},
progressValue() {
return Object.values(this.actions).filter((a) => a.completed).length;
},
progressPercentage() {
return Math.round((this.progressValue() / this.$options.maxValue) * 100);
},
},
};
</script>
<template>
<div>
<div class="row">
<div class="gl-mb-7 col-md-8 col-lg-7">
<h1 class="gl-font-size-h1">{{ $options.i18n.title }}</h1>
<p class="gl-text-gray-700 gl-mb-0">{{ $options.i18n.description }}</p>
</div>
</div>
<div class="gl-mb-3">
<p class="gl-text-gray-500 gl-mb-2" data-testid="completion-percentage">
<gl-sprintf :message="$options.i18n.percentageCompleted">
<template #percentage>{{ progressPercentage() }}</template>
<template #percentSymbol>%</template>
</gl-sprintf>
</p>
<gl-progress-bar :value="progressValue()" :max="$options.maxValue" />
</div>
<h2 class="gl-font-lg gl-mb-3">{{ $options.i18n.workspace.title }}</h2>
<p class="gl-text-gray-700 gl-mb-6">{{ $options.i18n.workspace.description }}</p>
<div class="row row-cols-2 row-cols-md-3 row-cols-lg-4">
<div class="col gl-mb-6"><learn-gitlab-info-card v-bind="infoProps('userAdded')" /></div>
<div class="col gl-mb-6"><learn-gitlab-info-card v-bind="infoProps('gitWrite')" /></div>
<div class="col gl-mb-6">
<learn-gitlab-info-card v-bind="infoProps('pipelineCreated')" />
</div>
<div class="col gl-mb-6"><learn-gitlab-info-card v-bind="infoProps('trialStarted')" /></div>
<div class="col gl-mb-6">
<learn-gitlab-info-card v-bind="infoProps('codeOwnersEnabled')" />
</div>
<div class="col gl-mb-6">
<learn-gitlab-info-card v-bind="infoProps('requiredMrApprovalsEnabled')" />
</div>
</div>
<h2 class="gl-font-lg gl-mb-3">{{ $options.i18n.plan.title }}</h2>
<p class="gl-text-gray-700 gl-mb-6">{{ $options.i18n.plan.description }}</p>
<div class="row row-cols-2 row-cols-md-3 row-cols-lg-4">
<div class="col gl-mb-6">
<learn-gitlab-info-card v-bind="infoProps('issueCreated')" />
</div>
<div class="col gl-mb-6">
<learn-gitlab-info-card v-bind="infoProps('mergeRequestCreated')" />
</div>
</div>
<h2 class="gl-font-lg gl-mb-3">{{ $options.i18n.deploy.title }}</h2>
<p class="gl-text-gray-700 gl-mb-6">{{ $options.i18n.deploy.description }}</p>
<div class="row row-cols-2 row-cols-lg-4 g-2 g-lg-3">
<div class="col gl-mb-6">
<learn-gitlab-info-card v-bind="infoProps('securityScanEnabled')" />
</div>
</div>
</div>
</template>
import Vue from 'vue';
import trackLearnGitlab from '~/learn_gitlab/track_learn_gitlab';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import LearnGitlabA from '../components/learn_gitlab_a.vue';
import LearnGitlabB from '../components/learn_gitlab_b.vue';
function initLearnGitlab() {
const el = document.getElementById('js-learn-gitlab-app');
......@@ -14,14 +12,10 @@ function initLearnGitlab() {
const actions = convertObjectPropsToCamelCase(JSON.parse(el.dataset.actions));
const sections = convertObjectPropsToCamelCase(JSON.parse(el.dataset.sections));
const { learnGitlabA } = gon.experiments;
trackLearnGitlab(learnGitlabA);
return new Vue({
el,
render(createElement) {
return createElement(learnGitlabA ? LearnGitlabA : LearnGitlabB, {
return createElement(LearnGitlabA, {
props: { actions, sections },
});
},
......
......@@ -7,8 +7,6 @@ class Projects::LearnGitlabController < Projects::ApplicationController
feature_category :users
def index
push_frontend_experiment(:learn_gitlab_a, subject: current_user)
push_frontend_experiment(:learn_gitlab_b, subject: current_user)
end
private
......
......@@ -3,21 +3,10 @@
module LearnGitlabHelper
def learn_gitlab_experiment_enabled?(project)
return false unless current_user
return false unless continous_onboarding_experiment_enabled_for_user?
learn_gitlab_onboarding_available?(project)
end
def learn_gitlab_experiment_tracking_category
return unless current_user
if Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_a, subject: current_user)
Gitlab::Experimentation.get_experiment(:learn_gitlab_a).tracking_category
elsif Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_b, subject: current_user)
Gitlab::Experimentation.get_experiment(:learn_gitlab_b).tracking_category
end
end
def onboarding_actions_data(project)
attributes = onboarding_progress(project).attributes.symbolize_keys
......@@ -31,11 +20,6 @@ module LearnGitlabHelper
end
end
def continous_onboarding_experiment_enabled_for_user?
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_a, subject: current_user) ||
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_b, subject: current_user)
end
def onboarding_sections_data
{
workspace: {
......
......@@ -88,7 +88,6 @@ module SidebarsHelper
current_user: user,
container: project,
learn_gitlab_experiment_enabled: learn_gitlab_experiment_enabled?(project),
learn_gitlab_experiment_tracking_category: learn_gitlab_experiment_tracking_category,
current_ref: current_ref,
jira_issues_integration: project_jira_issues_integration?,
can_view_pipeline_editor: can_view_pipeline_editor?(project),
......
---
name: learn_gitlab_a_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53089
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/281022
milestone: '13.9'
type: experiment
group: group::conversion
default_enabled: false
---
name: learn_gitlab_b_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53089
rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/306
milestone: '13.9'
type: experiment
group: group::conversion
default_enabled: false
......@@ -2,8 +2,6 @@
module Registrations
class GroupsController < ApplicationController
include ::Gitlab::Utils::StrongMemoize
layout 'minimal'
before_action :check_if_gl_com_or_dev
......@@ -12,8 +10,6 @@ module Registrations
feature_category :onboarding
def new
record_experiment_user(:learn_gitlab_a, learn_gitlab_context)
record_experiment_user(:learn_gitlab_b, learn_gitlab_context)
@group = Group.new(visibility_level: helpers.default_group_visibility)
end
......@@ -73,9 +69,6 @@ module Registrations
end
def registration_onboarding_flow
record_experiment_conversion_event(:learn_gitlab_a, namespace_id: @group.id)
record_experiment_conversion_event(:learn_gitlab_b, namespace_id: @group.id)
if helpers.in_trial_during_signup_flow?
create_lead_and_apply_trial_flow
else
......@@ -135,14 +128,5 @@ module Registrations
success
end
def learn_gitlab_context
strong_memoize(:learn_gitlab_context) do
in_experiment_group_a = Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_a, subject: current_user)
in_experiment_group_b = !in_experiment_group_a && Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_b, subject: current_user)
{ in_experiment_group_a: in_experiment_group_a, in_experiment_group_b: in_experiment_group_b }
end
end
end
end
......@@ -25,11 +25,6 @@ module Registrations
if @project.saved?
learn_gitlab_project = create_learn_gitlab_project
onboarding_context = {
namespace_id: learn_gitlab_project.namespace_id,
project_id: @project.id,
learn_gitlab_project_id: learn_gitlab_project.id
}
experiment(:jobs_to_be_done, user: current_user)
.track(:create_project, project: @project)
......@@ -40,14 +35,7 @@ module Registrations
if helpers.in_trial_onboarding_flow?
redirect_to trial_getting_started_users_sign_up_welcome_path(learn_gitlab_project_id: learn_gitlab_project.id)
else
record_experiment_user(:learn_gitlab_a, onboarding_context)
record_experiment_user(:learn_gitlab_b, onboarding_context)
if continous_onboarding_experiment_enabled_for_user?
redirect_to continuous_onboarding_getting_started_users_sign_up_welcome_path(project_id: @project.id)
else
redirect_to users_sign_up_experience_level_path(namespace_path: @project.namespace)
end
redirect_to continuous_onboarding_getting_started_users_sign_up_welcome_path(project_id: @project.id)
end
else
render :new
......@@ -93,7 +81,7 @@ module Registrations
end
def learn_gitlab_template_path
file = if helpers.in_trial_onboarding_flow? || learn_gitlab_experiment_enabled?
file = if helpers.in_trial_onboarding_flow?
LEARN_GITLAB_ULTIMATE_TEMPLATE
else
LEARN_GITLAB_TEMPLATE
......@@ -101,10 +89,5 @@ module Registrations
Rails.root.join('vendor', 'project_templates', file)
end
def learn_gitlab_experiment_enabled?
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_a, subject: current_user) ||
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_b, subject: current_user)
end
end
end
......@@ -29,12 +29,6 @@ RSpec.describe Registrations::GroupsController do
describe 'GET #new', :aggregate_failures do
let(:dev_env_or_com) { true }
let(:learn_gitlab_context) do
{
in_experiment_group_a: false,
in_experiment_group_b: false
}
end
subject { get :new }
......@@ -60,28 +54,6 @@ RSpec.describe Registrations::GroupsController do
expect(assigns(:group).visibility_level).to eq(Gitlab::CurrentSettings.default_group_visibility)
end
context 'with different experiment rollouts' do
before do
stub_experiment_for_subject(learn_gitlab_a: experiment_a, learn_gitlab_b: experiment_b)
end
where(:experiment_a, :experiment_b, :context) do
false | false | { in_experiment_group_a: false, in_experiment_group_b: false }
false | true | { in_experiment_group_a: false, in_experiment_group_b: true }
true | false | { in_experiment_group_a: true, in_experiment_group_b: false }
true | true | { in_experiment_group_a: true, in_experiment_group_b: false }
end
with_them do
it 'sets the correct context', :aggregate_failures do
expect(controller).to receive(:record_experiment_user).with(:learn_gitlab_a, context)
expect(controller).to receive(:record_experiment_user).with(:learn_gitlab_b, context)
subject
end
end
end
context 'user without the ability to create a group' do
let(:user) { create(:user, can_create_group: false) }
......@@ -194,16 +166,6 @@ RSpec.describe Registrations::GroupsController do
context 'when not in the trial onboarding - registration_onboarding_flow' do
let_it_be(:group) { create(:group) }
it 'calls the record user for learn gitlab experiment' do
expect_next_instance_of(Groups::CreateService) do |service|
expect(service).to receive(:execute).and_return(group)
end
expect(controller).to receive(:record_experiment_conversion_event).with(:learn_gitlab_a, namespace_id: group.id)
expect(controller).to receive(:record_experiment_conversion_event).with(:learn_gitlab_b, namespace_id: group.id)
subject
end
context 'when trial_during_signup - trial_during_signup_flow' do
let_it_be(:glm_params) { { glm_source: 'gitlab.com', glm_content: 'content' } }
let_it_be(:trial_form_params) do
......
......@@ -67,9 +67,6 @@ RSpec.describe Registrations::ProjectsController do
context 'with an authenticated user', :sidekiq_inline do
let_it_be(:first_project) { create(:project) }
let_it_be(:onboarding_context) do
{ learn_gitlab_project_id: project.id, namespace_id: project.namespace_id, project_id: first_project.id }
end
before do
namespace.add_owner(user)
......@@ -77,11 +74,16 @@ RSpec.describe Registrations::ProjectsController do
allow(::Gitlab).to receive(:dev_env_or_com?).and_return(dev_env_or_com)
end
it 'creates a new project, a "Learn GitLab" project, sets a cookie and redirects to the experience level page' do
expect { subject }.to change { namespace.projects.pluck(:name) }.from([]).to(['New project', s_('Learn GitLab')])
it 'creates a new project, a "Learn GitLab" project, sets a cookie and redirects to the continuous onboarding page' do
allow_next_instance_of(::Projects::CreateService) do |service|
allow(service).to receive(:execute).and_return(first_project)
end
allow_next_instance_of(::Projects::GitlabProjectsImportService) do |service|
allow(service).to receive(:execute).and_return(project)
end
expect(subject).to have_gitlab_http_status(:redirect)
expect(subject).to redirect_to(users_sign_up_experience_level_path(namespace_path: namespace.to_param))
expect(namespace.projects.find_by_name(s_('Learn GitLab'))).to be_import_finished
expect(subject).to redirect_to(continuous_onboarding_getting_started_users_sign_up_welcome_path(project_id: first_project.id))
end
it 'tracks an event for the jobs_to_be_done experiment', :experiment do
......@@ -103,27 +105,12 @@ RSpec.describe Registrations::ProjectsController do
subject
end
it 'tracks learn gitlab experiments' do
allow_next_instance_of(::Projects::CreateService) do |service|
allow(service).to receive(:execute).and_return(first_project)
end
allow_next_instance_of(::Projects::GitlabProjectsImportService) do |service|
allow(service).to receive(:execute).and_return(project)
end
expect(controller).to receive(:record_experiment_user).with(:learn_gitlab_a, onboarding_context)
expect(controller).to receive(:record_experiment_user).with(:learn_gitlab_b, onboarding_context)
subject
end
context 'learn gitlab project' do
using RSpec::Parameterized::TableSyntax
where(:trial, :experiment_enabled, :project_name, :template) do
false | false | 'Learn GitLab' | described_class::LEARN_GITLAB_TEMPLATE
false | true | 'Learn GitLab' | described_class::LEARN_GITLAB_ULTIMATE_TEMPLATE
true | false | 'Learn GitLab - Ultimate trial' | described_class::LEARN_GITLAB_ULTIMATE_TEMPLATE
true | true | 'Learn GitLab - Ultimate trial' | described_class::LEARN_GITLAB_ULTIMATE_TEMPLATE
where(:trial, :project_name, :template) do
false | 'Learn GitLab' | described_class::LEARN_GITLAB_TEMPLATE
true | 'Learn GitLab - Ultimate trial' | described_class::LEARN_GITLAB_ULTIMATE_TEMPLATE
end
with_them do
......@@ -133,7 +120,6 @@ RSpec.describe Registrations::ProjectsController do
let(:trial_onboarding_flow_params) { { trial_onboarding_flow: trial } }
before do
stub_experiment_for_subject(learn_gitlab_a: experiment_enabled)
allow(File).to receive(:open).and_call_original
expect(File).to receive(:open).with(path).and_yield(handle)
end
......
......@@ -6,11 +6,13 @@ RSpec.describe 'User sees new onboarding flow', :js do
before do
stub_const('Gitlab::QueryLimiting::Transaction::THRESHOLD', 200)
allow(Gitlab).to receive(:com?).and_return(true)
end
it 'shows continuous onboarding flow pages' do
visit '/'
gitlab_sign_in(:user)
visit users_sign_up_welcome_path
end
def common_flow
expect(page).to have_content('Welcome to GitLab')
expect(page).to have_content('Your profile Your GitLab group Your first project')
expect(page).to have_css('li.current', text: 'Your profile')
......@@ -37,29 +39,12 @@ RSpec.describe 'User sees new onboarding flow', :js do
expect(page).to have_field('project_path', with: 'test')
click_on 'Create project'
end
it 'shows onboarding flow pages' do
common_flow
expect(page).to have_content('Welcome to the guided GitLab tour')
expect(page).to have_content('Get started with GitLab')
Sidekiq::Worker.drain_all
click_on 'Show me the basics'
click_on "Ok, let's go"
expect(page).to have_content('Learn GitLab')
expect(page).to have_css('.selectable', text: 'Label = ~Novice')
end
context 'continuous onboarding experiment enabled' do
before do
stub_experiment_for_subject(learn_gitlab_a: true, learn_gitlab_b: true)
end
it 'shows continuous onboarding flow pages' do
common_flow
expect(page).to have_content('Get started with GitLab')
end
end
end
......@@ -44,14 +44,6 @@ module Gitlab
show_trial_status_in_sidebar: {
tracking_category: 'Growth::Conversion::Experiment::ShowTrialStatusInSidebar',
rollout_strategy: :group
},
learn_gitlab_a: {
tracking_category: 'Growth::Conversion::Experiment::LearnGitLabA',
rollout_strategy: :user
},
learn_gitlab_b: {
tracking_category: 'Growth::Activation::Experiment::LearnGitLabB',
rollout_strategy: :user
}
}.freeze
......
......@@ -40,8 +40,7 @@ module Sidebars
{
class: 'home',
data: {
track_label: 'learn_gitlab',
track_property: context.learn_gitlab_experiment_tracking_category
track_label: 'learn_gitlab'
}
}
end
......
......@@ -27,13 +27,6 @@ RSpec.describe Projects::LearnGitlabController do
it { is_expected.to render_template(:index) }
it 'pushes experiment to frontend' do
expect(controller).to receive(:push_frontend_experiment).with(:learn_gitlab_a, subject: user)
expect(controller).to receive(:push_frontend_experiment).with(:learn_gitlab_b, subject: user)
subject
end
context 'learn_gitlab experiment not enabled' do
let(:learn_gitlab_experiment_enabled) { false }
......
import { mockTracking } from 'helpers/tracking_helper';
import trackLearnGitlab from '~/learn_gitlab/track_learn_gitlab';
describe('trackTrialUserErrors', () => {
let spy;
describe('when an error is present', () => {
beforeEach(() => {
spy = mockTracking('projects:learn_gitlab_index', document.body, jest.spyOn);
});
it('tracks the error message', () => {
trackLearnGitlab();
expect(spy).toHaveBeenCalledWith('projects:learn_gitlab:index', 'page_init', {
label: 'learn_gitlab',
property: 'Growth::Activation::Experiment::LearnGitLabB',
});
});
});
});
import { GlProgressBar } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
import LearnGitlabB from '~/pages/projects/learn_gitlab/components/learn_gitlab_b.vue';
import { testActions } from './mock_data';
describe('Learn GitLab Design B', () => {
let wrapper;
const createWrapper = () => {
wrapper = mount(LearnGitlabB, { propsData: { actions: testActions } });
};
beforeEach(() => {
createWrapper();
});
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it('renders correctly', () => {
expect(wrapper.element).toMatchSnapshot();
});
it('renders the progress percentage', () => {
const text = wrapper.find('[data-testid="completion-percentage"]').text();
expect(text).toBe('22% completed');
});
it('renders the progress bar with correct values', () => {
const progressBar = wrapper.findComponent(GlProgressBar);
expect(progressBar.attributes('value')).toBe('2');
expect(progressBar.attributes('max')).toBe('9');
});
});
......@@ -63,17 +63,14 @@ RSpec.describe LearnGitlabHelper do
subject { helper.learn_gitlab_experiment_enabled?(project) }
where(:experiment_a, :experiment_b, :onboarding, :learn_gitlab_available, :result) do
true | false | true | true | true
false | true | true | true | true
false | false | true | true | false
true | true | true | false | false
true | true | false | true | false
where(:onboarding, :learn_gitlab_available, :result) do
true | true | true
true | false | false
false | true | false
end
with_them do
before do
stub_experiment_for_subject(learn_gitlab_a: experiment_a, learn_gitlab_b: experiment_b)
allow(OnboardingProgress).to receive(:onboarding?).with(project.namespace).and_return(onboarding)
allow_next(LearnGitlab::Project, user).to receive(:available?).and_return(learn_gitlab_available)
end
......@@ -88,10 +85,6 @@ RSpec.describe LearnGitlabHelper do
end
context 'when not signed in' do
before do
stub_experiment_for_subject(learn_gitlab_a: true, learn_gitlab_b: true)
end
it { is_expected.to eq(false) }
end
end
......@@ -106,41 +99,4 @@ RSpec.describe LearnGitlabHelper do
expect(sections.values.map { |section| section.keys }).to eq([[:svg]] * 3)
end
end
describe '.learn_gitlab_experiment_tracking_category' do
using RSpec::Parameterized::TableSyntax
let_it_be(:user) { create(:user) }
subject { helper.learn_gitlab_experiment_tracking_category }
where(:experiment_a, :experiment_b, :result) do
false | false | nil
false | true | 'Growth::Activation::Experiment::LearnGitLabB'
true | false | 'Growth::Conversion::Experiment::LearnGitLabA'
true | true | 'Growth::Conversion::Experiment::LearnGitLabA'
end
with_them do
before do
stub_experiment_for_subject(learn_gitlab_a: experiment_a, learn_gitlab_b: experiment_b)
end
context 'when signed in' do
before do
sign_in(user)
end
it { is_expected.to eq(result) }
end
end
context 'when not signed in' do
before do
stub_experiment_for_subject(learn_gitlab_a: true, learn_gitlab_b: true)
end
it { is_expected.to eq(nil) }
end
end
end
......@@ -5,14 +5,12 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do
let_it_be(:project) { build(:project) }
let_it_be(:experiment_enabled) { true }
let_it_be(:tracking_category) { 'Growth::Activation::Experiment::LearnGitLabB' }
let(:context) do
Sidebars::Projects::Context.new(
current_user: nil,
container: project,
learn_gitlab_experiment_enabled: experiment_enabled,
learn_gitlab_experiment_tracking_category: tracking_category
learn_gitlab_experiment_enabled: experiment_enabled
)
end
......@@ -27,7 +25,6 @@ RSpec.describe Sidebars::Projects::Menus::LearnGitlabMenu do
{
class: 'home',
data: {
track_property: tracking_category,
track_label: 'learn_gitlab'
}
}
......
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