Commit b93bdfaa authored by Savas Vedova's avatar Savas Vedova

Merge branch 'nicolasdular/cleanup-onboarding-issues-experiment' into 'master'

Cleanup onboarding issues experiment [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!52905
parents b44fe05c af8c5c88
...@@ -35,7 +35,7 @@ class InvitesController < ApplicationController ...@@ -35,7 +35,7 @@ class InvitesController < ApplicationController
def decline def decline
if member.decline_invite! if member.decline_invite!
return render layout: 'devise_experimental_onboarding_issues' if !current_user && member.invite_to_unknown_user? && member.created_by return render layout: 'signup_onboarding' if !current_user && member.invite_to_unknown_user? && member.created_by
path = path =
if current_user if current_user
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class JiraConnect::UsersController < ApplicationController class JiraConnect::UsersController < ApplicationController
feature_category :integrations feature_category :integrations
layout 'devise_experimental_onboarding_issues' layout 'signup_onboarding'
def show def show
@jira_app_link = params.delete(:return_to) @jira_app_link = params.delete(:return_to)
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
module Registrations module Registrations
class ExperienceLevelsController < ApplicationController class ExperienceLevelsController < ApplicationController
layout 'devise_experimental_onboarding_issues' layout 'signup_onboarding'
before_action :check_experiment_enabled
before_action :ensure_namespace_path_param before_action :ensure_namespace_path_param
feature_category :navigation feature_category :navigation
...@@ -27,10 +26,6 @@ module Registrations ...@@ -27,10 +26,6 @@ module Registrations
private private
def check_experiment_enabled
access_denied! unless experiment_enabled?(:onboarding_issues)
end
def ensure_namespace_path_param def ensure_namespace_path_param
redirect_to root_path unless params[:namespace_path].present? redirect_to root_path unless params[:namespace_path].present?
end end
......
...@@ -16,9 +16,7 @@ module Registrations ...@@ -16,9 +16,7 @@ module Registrations
result = ::Users::SignupService.new(current_user, update_params).execute result = ::Users::SignupService.new(current_user, update_params).execute
if result[:status] == :success if result[:status] == :success
process_gitlab_com_tracking return redirect_to new_users_sign_up_group_path if show_signup_onboarding?
return redirect_to new_users_sign_up_group_path if experiment_enabled?(:onboarding_issues) && show_onboarding_issues_experiment?
redirect_to path_for_signed_in_user(current_user) redirect_to path_for_signed_in_user(current_user)
else else
...@@ -36,11 +34,6 @@ module Registrations ...@@ -36,11 +34,6 @@ module Registrations
current_user.role.present? && !current_user.setup_for_company.nil? current_user.role.present? && !current_user.setup_for_company.nil?
end end
def process_gitlab_com_tracking
return false unless ::Gitlab.com?
return false unless show_onboarding_issues_experiment?
end
def update_params def update_params
params.require(:user).permit(:role, :other_role, :setup_for_company) params.require(:user).permit(:role, :other_role, :setup_for_company)
end end
...@@ -58,11 +51,8 @@ module Registrations ...@@ -58,11 +51,8 @@ module Registrations
stored_location_for(user) || dashboard_projects_path stored_location_for(user) || dashboard_projects_path
end end
def show_onboarding_issues_experiment? def show_signup_onboarding?
!helpers.in_subscription_flow? && false
!helpers.in_invitation_flow? &&
!helpers.in_oauth_flow? &&
!helpers.in_trial_flow?
end end
end end
end end
......
...@@ -9,8 +9,4 @@ export const STEPS = { ...@@ -9,8 +9,4 @@ export const STEPS = {
export const SUBSCRIPTON_FLOW_STEPS = [STEPS.yourProfile, STEPS.checkout, STEPS.yourGroup]; export const SUBSCRIPTON_FLOW_STEPS = [STEPS.yourProfile, STEPS.checkout, STEPS.yourGroup];
export const ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS = [ export const SIGNUP_ONBOARDING_FLOW_STEPS = [STEPS.yourProfile, STEPS.yourGroup, STEPS.yourProject];
STEPS.yourProfile,
STEPS.yourGroup,
STEPS.yourProject,
];
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import mountInviteMembers from 'ee/groups/invite'; import mountInviteMembers from 'ee/groups/invite';
import mountVisibilityLevelDropdown from '~/groups/visibility_level'; import mountVisibilityLevelDropdown from '~/groups/visibility_level';
import 'ee/pages/trials/country_select'; import 'ee/pages/trials/country_select';
import { STEPS, ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS } from '../../constants'; import { STEPS, SIGNUP_ONBOARDING_FLOW_STEPS } from '../../constants';
import ProgressBar from '../../components/progress_bar.vue'; import ProgressBar from '../../components/progress_bar.vue';
import RegistrationTrialToggle from '../../components/registration_trial_toggle.vue'; import RegistrationTrialToggle from '../../components/registration_trial_toggle.vue';
...@@ -17,7 +17,7 @@ function mountProgressBar() { ...@@ -17,7 +17,7 @@ function mountProgressBar() {
el, el,
render(createElement) { render(createElement) {
return createElement(ProgressBar, { return createElement(ProgressBar, {
props: { steps: ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS, currentStep: STEPS.yourGroup }, props: { steps: SIGNUP_ONBOARDING_FLOW_STEPS, currentStep: STEPS.yourGroup },
}); });
}, },
}); });
......
import Vue from 'vue'; import Vue from 'vue';
import { STEPS, ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS } from '../../constants'; import { STEPS, SIGNUP_ONBOARDING_FLOW_STEPS } from '../../constants';
import ProgressBar from '../../components/progress_bar.vue'; import ProgressBar from '../../components/progress_bar.vue';
export default () => { export default () => {
...@@ -11,7 +11,7 @@ export default () => { ...@@ -11,7 +11,7 @@ export default () => {
el, el,
render(createElement) { render(createElement) {
return createElement(ProgressBar, { return createElement(ProgressBar, {
props: { steps: ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS, currentStep: STEPS.yourProject }, props: { steps: SIGNUP_ONBOARDING_FLOW_STEPS, currentStep: STEPS.yourProject },
}); });
}, },
}); });
......
import Vue from 'vue'; import Vue from 'vue';
import 'ee/registrations/welcome/other_role'; import 'ee/registrations/welcome/other_role';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import { import { STEPS, SUBSCRIPTON_FLOW_STEPS, SIGNUP_ONBOARDING_FLOW_STEPS } from '../constants';
STEPS,
SUBSCRIPTON_FLOW_STEPS,
ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS,
} from '../constants';
import ProgressBar from '../components/progress_bar.vue'; import ProgressBar from '../components/progress_bar.vue';
export default () => { export default () => {
...@@ -14,16 +10,14 @@ export default () => { ...@@ -14,16 +10,14 @@ export default () => {
if (!el) return null; if (!el) return null;
const isInSubscriptionFlow = parseBoolean(el.dataset.isInSubscriptionFlow); const isInSubscriptionFlow = parseBoolean(el.dataset.isInSubscriptionFlow);
const isOnboardingIssuesExperimentEnabled = parseBoolean( const isSignupOnboardingEnabled = parseBoolean(el.dataset.isSignupOnboardingEnabled);
el.dataset.isOnboardingIssuesExperimentEnabled,
);
let steps; let steps;
if (isInSubscriptionFlow) { if (isInSubscriptionFlow) {
steps = SUBSCRIPTON_FLOW_STEPS; steps = SUBSCRIPTON_FLOW_STEPS;
} else if (isOnboardingIssuesExperimentEnabled) { } else if (isSignupOnboardingEnabled) {
steps = ONBOARDING_ISSUES_EXPERIMENT_FLOW_STEPS; steps = SIGNUP_ONBOARDING_FLOW_STEPS;
} }
return new Vue({ return new Vue({
......
...@@ -29,6 +29,15 @@ module EE ...@@ -29,6 +29,15 @@ module EE
clean_params clean_params
end end
override :show_signup_onboarding?
def show_signup_onboarding?
!helpers.in_subscription_flow? &&
!helpers.in_invitation_flow? &&
!helpers.in_oauth_flow? &&
!helpers.in_trial_flow? &&
helpers.signup_onboarding_enabled?
end
def learn_gitlab_project def learn_gitlab_project
::Project.find(params[:learn_gitlab_project_id]) ::Project.find(params[:learn_gitlab_project_id])
end end
......
...@@ -6,8 +6,8 @@ module Registrations ...@@ -6,8 +6,8 @@ module Registrations
layout 'checkout' layout 'checkout'
before_action :check_signup_onboarding_enabled
before_action :authorize_create_group!, only: :new before_action :authorize_create_group!, only: :new
before_action :check_experiment_enabled
feature_category :navigation feature_category :navigation
...@@ -57,12 +57,12 @@ module Registrations ...@@ -57,12 +57,12 @@ module Registrations
private private
def authorize_create_group! def check_signup_onboarding_enabled
access_denied! unless can?(current_user, :create_group) access_denied! unless helpers.signup_onboarding_enabled?
end end
def check_experiment_enabled def authorize_create_group!
access_denied! unless experiment_enabled?(:onboarding_issues) access_denied! unless can?(current_user, :create_group)
end end
def group_params def group_params
......
...@@ -4,7 +4,7 @@ module Registrations ...@@ -4,7 +4,7 @@ module Registrations
class ProjectsController < ApplicationController class ProjectsController < ApplicationController
layout 'checkout' layout 'checkout'
before_action :check_experiment_enabled before_action :check_signup_onboarding_enabled
before_action :find_namespace, only: :new before_action :find_namespace, only: :new
feature_category :navigation feature_category :navigation
...@@ -38,6 +38,10 @@ module Registrations ...@@ -38,6 +38,10 @@ module Registrations
private private
def check_signup_onboarding_enabled
access_denied! unless helpers.signup_onboarding_enabled?
end
def create_learn_gitlab_project def create_learn_gitlab_project
title, filename = if helpers.in_trial_onboarding_flow? title, filename = if helpers.in_trial_onboarding_flow?
[s_('Learn GitLab - Ultimate trial'), 'learn_gitlab_gold_trial.tar.gz'] [s_('Learn GitLab - Ultimate trial'), 'learn_gitlab_gold_trial.tar.gz']
...@@ -59,10 +63,6 @@ module Registrations ...@@ -59,10 +63,6 @@ module Registrations
learn_gitlab_project learn_gitlab_project
end end
def check_experiment_enabled
access_denied! unless experiment_enabled?(:onboarding_issues)
end
def find_namespace def find_namespace
@namespace = Namespace.find_by_id(params[:namespace_id]) @namespace = Namespace.find_by_id(params[:namespace_id])
......
...@@ -42,7 +42,7 @@ module EE ...@@ -42,7 +42,7 @@ module EE
return true if in_subscription_flow? return true if in_subscription_flow?
return false if in_invitation_flow? || in_oauth_flow? || in_trial_flow? return false if in_invitation_flow? || in_oauth_flow? || in_trial_flow?
onboarding_issues_experiment_enabled? signup_onboarding_enabled?
end end
def welcome_submit_button_text def welcome_submit_button_text
...@@ -52,13 +52,13 @@ module EE ...@@ -52,13 +52,13 @@ module EE
return continue if in_subscription_flow? || in_trial_flow? return continue if in_subscription_flow? || in_trial_flow?
return get_started if in_invitation_flow? || in_oauth_flow? return get_started if in_invitation_flow? || in_oauth_flow?
onboarding_issues_experiment_enabled? ? continue : get_started signup_onboarding_enabled? ? continue : get_started
end end
def data_attributes_for_progress_bar_js_component def data_attributes_for_progress_bar_js_component
{ {
is_in_subscription_flow: in_subscription_flow?.to_s, is_in_subscription_flow: in_subscription_flow?.to_s,
is_onboarding_issues_experiment_enabled: onboarding_issues_experiment_enabled?.to_s is_signup_onboarding_enabled: signup_onboarding_enabled?.to_s
} }
end end
...@@ -66,10 +66,8 @@ module EE ...@@ -66,10 +66,8 @@ module EE
current_user.members.any? current_user.members.any?
end end
private def signup_onboarding_enabled?
::Gitlab.dev_env_or_com? && ::Feature.enabled?(:signup_onboarding, default_enabled: true)
def onboarding_issues_experiment_enabled?
experiment_enabled?(:onboarding_issues)
end end
end end
end end
--- ---
name: onboarding_issues_experiment_percentage name: signup_onboarding
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31656/ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52905
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/224515 rollout_issue_url:
milestone: '13.0' milestone: '13.9'
type: experiment type: development
group: group::conversion group: group::conversion
default_enabled: true default_enabled: true
...@@ -26,6 +26,8 @@ RSpec.describe Registrations::GroupsController do ...@@ -26,6 +26,8 @@ RSpec.describe Registrations::GroupsController do
end end
describe 'GET #new' do describe 'GET #new' do
let(:signup_onboarding_enabled) { true }
subject { get :new } subject { get :new }
context 'with an unauthenticated user' do context 'with an unauthenticated user' do
...@@ -36,7 +38,7 @@ RSpec.describe Registrations::GroupsController do ...@@ -36,7 +38,7 @@ RSpec.describe Registrations::GroupsController do
context 'with an authenticated user' do context 'with an authenticated user' do
before do before do
sign_in(user) sign_in(user)
stub_experiment_for_subject(onboarding_issues: true) allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end end
it { is_expected.to have_gitlab_http_status(:ok) } it { is_expected.to have_gitlab_http_status(:ok) }
...@@ -61,10 +63,8 @@ RSpec.describe Registrations::GroupsController do ...@@ -61,10 +63,8 @@ RSpec.describe Registrations::GroupsController do
it { is_expected.to have_gitlab_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
context 'with the experiment not enabled for user' do context 'signup onboarding not enabled' do
before do let(:signup_onboarding_enabled) { false }
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
...@@ -78,6 +78,7 @@ RSpec.describe Registrations::GroupsController do ...@@ -78,6 +78,7 @@ RSpec.describe Registrations::GroupsController do
let_it_be(:trial_form_params) { { trial: 'false' } } let_it_be(:trial_form_params) { { trial: 'false' } }
let_it_be(:trial_onboarding_issues_enabled) { false } let_it_be(:trial_onboarding_issues_enabled) { false }
let_it_be(:trial_onboarding_flow_params) { {} } let_it_be(:trial_onboarding_flow_params) { {} }
let(:signup_onboarding_enabled) { true }
let(:group_params) { { name: 'Group name', path: 'group-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE, emails: ['', ''] } } let(:group_params) { { name: 'Group name', path: 'group-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE, emails: ['', ''] } }
let(:params) do let(:params) do
{ group: group_params }.merge(glm_params).merge(trial_form_params).merge(trial_onboarding_flow_params) { group: group_params }.merge(glm_params).merge(trial_form_params).merge(trial_onboarding_flow_params)
...@@ -93,7 +94,8 @@ RSpec.describe Registrations::GroupsController do ...@@ -93,7 +94,8 @@ RSpec.describe Registrations::GroupsController do
context 'with an authenticated user' do context 'with an authenticated user' do
before do before do
sign_in(user) sign_in(user)
stub_experiment_for_subject(onboarding_issues: true, trial_onboarding_issues: trial_onboarding_issues_enabled) stub_experiment_for_subject(trial_onboarding_issues: trial_onboarding_issues_enabled)
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end end
it 'creates a group' do it 'creates a group' do
...@@ -162,7 +164,6 @@ RSpec.describe Registrations::GroupsController do ...@@ -162,7 +164,6 @@ RSpec.describe Registrations::GroupsController do
end end
before do before do
allow(controller).to receive(:experiment_enabled?).with(:onboarding_issues).and_call_original
allow(controller).to receive(:experiment_enabled?).with(:trial_during_signup).and_return(true) allow(controller).to receive(:experiment_enabled?).with(:trial_during_signup).and_return(true)
end end
...@@ -258,6 +259,12 @@ RSpec.describe Registrations::GroupsController do ...@@ -258,6 +259,12 @@ RSpec.describe Registrations::GroupsController do
it { is_expected.to have_gitlab_http_status(:ok) } it { is_expected.to have_gitlab_http_status(:ok) }
it { is_expected.to render_template(:new) } it { is_expected.to render_template(:new) }
context 'signup onboarding not enabled' do
let(:signup_onboarding_enabled) { false }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
context 'when the trial onboarding is active' do context 'when the trial onboarding is active' do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:trial_onboarding_flow_params) { { trial_onboarding_flow: true } } let_it_be(:trial_onboarding_flow_params) { { trial_onboarding_flow: true } }
...@@ -267,14 +274,6 @@ RSpec.describe Registrations::GroupsController do ...@@ -267,14 +274,6 @@ RSpec.describe Registrations::GroupsController do
it { is_expected.to render_template(:new) } it { is_expected.to render_template(:new) }
end end
end end
context 'with the experiment not enabled for user' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
end end
end end
end end
...@@ -15,9 +15,11 @@ RSpec.describe Registrations::ProjectsController do ...@@ -15,9 +15,11 @@ RSpec.describe Registrations::ProjectsController do
end end
context 'with an authenticated user' do context 'with an authenticated user' do
let(:signup_onboarding_enabled) { true }
before do before do
sign_in(user) sign_in(user)
stub_experiment_for_subject(onboarding_issues: true) allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end end
it { is_expected.to have_gitlab_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
...@@ -37,10 +39,8 @@ RSpec.describe Registrations::ProjectsController do ...@@ -37,10 +39,8 @@ RSpec.describe Registrations::ProjectsController do
end end
end end
context 'with the experiment not enabled for user' do context 'with signup onboarding not enabled' do
before do let(:signup_onboarding_enabled) { false }
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
...@@ -52,6 +52,7 @@ RSpec.describe Registrations::ProjectsController do ...@@ -52,6 +52,7 @@ RSpec.describe Registrations::ProjectsController do
let_it_be(:trial_onboarding_flow_params) { {} } let_it_be(:trial_onboarding_flow_params) { {} }
let(:params) { { namespace_id: namespace.id, name: 'New project', path: 'project-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE } } let(:params) { { namespace_id: namespace.id, name: 'New project', path: 'project-path', visibility_level: Gitlab::VisibilityLevel::PRIVATE } }
let(:signup_onboarding_enabled) { true }
context 'with an unauthenticated user' do context 'with an unauthenticated user' do
it { is_expected.to have_gitlab_http_status(:redirect) } it { is_expected.to have_gitlab_http_status(:redirect) }
...@@ -59,12 +60,13 @@ RSpec.describe Registrations::ProjectsController do ...@@ -59,12 +60,13 @@ RSpec.describe Registrations::ProjectsController do
end end
context 'with an authenticated user', :sidekiq_inline do context 'with an authenticated user', :sidekiq_inline do
let_it_be(:trial_onboarding_issues_enabled) { false } let_it_be(:trial_onboarding_issues_enabled) { true }
before do before do
namespace.add_owner(user) namespace.add_owner(user)
sign_in(user) sign_in(user)
stub_experiment_for_subject(onboarding_issues: true, trial_onboarding_issues: trial_onboarding_issues_enabled) stub_experiment_for_subject(trial_onboarding_issues: trial_onboarding_issues_enabled)
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end end
it 'creates a new project, a "Learn GitLab" project, sets a cookie and redirects to the experience level page' do it 'creates a new project, a "Learn GitLab" project, sets a cookie and redirects to the experience level page' do
...@@ -112,10 +114,8 @@ RSpec.describe Registrations::ProjectsController do ...@@ -112,10 +114,8 @@ RSpec.describe Registrations::ProjectsController do
it { is_expected.to render_template(:new) } it { is_expected.to render_template(:new) }
end end
context 'with the experiment not enabled for user' do context 'with signup onboarding not enabled' do
before do let(:signup_onboarding_enabled) { false }
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
......
...@@ -108,11 +108,17 @@ RSpec.describe Registrations::WelcomeController do ...@@ -108,11 +108,17 @@ RSpec.describe Registrations::WelcomeController do
end end
describe 'redirection' do describe 'redirection' do
it { is_expected.to redirect_to dashboard_projects_path } context 'when signup_onboarding is not enabled' do
before do
allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(false)
end
it { is_expected.to redirect_to dashboard_projects_path }
end
context 'when part of the onboarding issues experiment' do context 'when signup_onboarding is enabled' do
before do before do
stub_experiment_for_subject(onboarding_issues: true) allow(controller.helpers).to receive(:signup_onboarding_enabled?).and_return(true)
end end
it { is_expected.to redirect_to new_users_sign_up_group_path } it { is_expected.to redirect_to new_users_sign_up_group_path }
......
...@@ -8,8 +8,8 @@ RSpec.describe 'User sees new onboarding flow', :js do ...@@ -8,8 +8,8 @@ RSpec.describe 'User sees new onboarding flow', :js do
before do before do
allow(Gitlab).to receive(:com?).and_return(true) allow(Gitlab).to receive(:com?).and_return(true)
stub_experiment(onboarding_issues: true, trial_during_signup: true) stub_experiment(trial_during_signup: true)
stub_experiment_for_subject(onboarding_issues: true, trial_during_signup: true) stub_experiment_for_subject(trial_during_signup: true)
sign_in(user) sign_in(user)
visit users_sign_up_welcome_path visit users_sign_up_welcome_path
......
...@@ -5,7 +5,6 @@ require 'spec_helper' ...@@ -5,7 +5,6 @@ require 'spec_helper'
RSpec.describe 'User sees new onboarding flow', :js do RSpec.describe 'User sees new onboarding flow', :js do
before do before do
stub_const('Gitlab::QueryLimiting::Transaction::THRESHOLD', 200) stub_const('Gitlab::QueryLimiting::Transaction::THRESHOLD', 200)
stub_experiment_for_subject(onboarding_issues: true)
allow(Gitlab).to receive(:com?).and_return(true) allow(Gitlab).to receive(:com?).and_return(true)
gitlab_sign_in(:user) gitlab_sign_in(:user)
visit users_sign_up_welcome_path visit users_sign_up_welcome_path
......
...@@ -5,10 +5,10 @@ require 'spec_helper' ...@@ -5,10 +5,10 @@ require 'spec_helper'
RSpec.describe 'Welcome screen', :js do RSpec.describe 'Welcome screen', :js do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:signup_onboarding_enabled) { true }
let(:in_invitation_flow) { false } let(:in_invitation_flow) { false }
let(:in_subscription_flow) { false } let(:in_subscription_flow) { false }
let(:in_trial_flow) { false } let(:in_trial_flow) { false }
let(:part_of_onboarding_issues_experiment) { false }
describe 'on GitLab.com' do describe 'on GitLab.com' do
before do before do
...@@ -17,14 +17,15 @@ RSpec.describe 'Welcome screen', :js do ...@@ -17,14 +17,15 @@ RSpec.describe 'Welcome screen', :js do
allow_any_instance_of(EE::WelcomeHelper).to receive(:in_invitation_flow?).and_return(in_invitation_flow) allow_any_instance_of(EE::WelcomeHelper).to receive(:in_invitation_flow?).and_return(in_invitation_flow)
allow_any_instance_of(EE::WelcomeHelper).to receive(:in_subscription_flow?).and_return(in_subscription_flow) allow_any_instance_of(EE::WelcomeHelper).to receive(:in_subscription_flow?).and_return(in_subscription_flow)
allow_any_instance_of(EE::WelcomeHelper).to receive(:in_trial_flow?).and_return(in_trial_flow) allow_any_instance_of(EE::WelcomeHelper).to receive(:in_trial_flow?).and_return(in_trial_flow)
stub_experiment_for_subject(onboarding_issues: part_of_onboarding_issues_experiment) stub_feature_flags(signup_onboarding: signup_onboarding_enabled)
visit users_sign_up_welcome_path visit users_sign_up_welcome_path
end end
it 'shows the welcome page without a progress bar' do it 'shows the welcome page with a progress bar' do
expect(page).to have_content('Welcome to GitLab') expect(page).to have_content('Welcome to GitLab')
expect(page).not_to have_content('Your profile') expect(page).to have_content('Your profile Your GitLab group Your first project')
expect(page).to have_content('Continue')
end end
context 'when in the subscription flow' do context 'when in the subscription flow' do
...@@ -35,27 +36,28 @@ RSpec.describe 'Welcome screen', :js do ...@@ -35,27 +36,28 @@ RSpec.describe 'Welcome screen', :js do
end end
end end
context 'when part of the onboarding issues experiment' do context 'when in the invitation flow' do
let(:part_of_onboarding_issues_experiment) { true } let(:in_invitation_flow) { true }
it 'shows the progress bar with the correct steps' do it 'does not show the progress bar' do
expect(page).to have_content('Your profile Your GitLab group Your first project') expect(page).not_to have_content('Your profile')
end end
end
context 'when in the invitation flow' do context 'when in the trial flow' do
let(:in_invitation_flow) { true } let(:in_trial_flow) { true }
it 'does not show the progress bar' do it 'does not show the progress bar' do
expect(page).not_to have_content('Your profile') expect(page).not_to have_content('Your profile')
end
end end
end
context 'when in the trial flow' do context 'when onboarding_signup is disabled' do
let(:in_trial_flow) { true } let(:signup_onboarding_enabled) { false }
it 'does not show the progress bar' do it 'does not show the progress bar' do
expect(page).not_to have_content('Your profile') expect(page).not_to have_content('Your profile')
end expect(page).to have_content('Get started!')
end end
end end
end end
......
...@@ -30,7 +30,7 @@ RSpec.describe 'Signup on EE' do ...@@ -30,7 +30,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role' select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_true' choose 'user_setup_for_company_true'
click_button 'Get started!' click_button 'Continue'
user = User.find_by_username!(new_user[:username]) user = User.find_by_username!(new_user[:username])
expect(user.email_opted_in).to be_truthy expect(user.email_opted_in).to be_truthy
...@@ -48,7 +48,7 @@ RSpec.describe 'Signup on EE' do ...@@ -48,7 +48,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role' select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_false' choose 'user_setup_for_company_false'
check 'user_email_opted_in' check 'user_email_opted_in'
click_button 'Get started!' click_button 'Continue'
user = User.find_by_username!(new_user[:username]) user = User.find_by_username!(new_user[:username])
expect(user.email_opted_in).to be_truthy expect(user.email_opted_in).to be_truthy
...@@ -65,7 +65,7 @@ RSpec.describe 'Signup on EE' do ...@@ -65,7 +65,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role' select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_false' choose 'user_setup_for_company_false'
click_button 'Get started!' click_button 'Continue'
user = User.find_by_username!(new_user[:username]) user = User.find_by_username!(new_user[:username])
expect(user.email_opted_in).to be_falsey expect(user.email_opted_in).to be_falsey
...@@ -88,7 +88,7 @@ RSpec.describe 'Signup on EE' do ...@@ -88,7 +88,7 @@ RSpec.describe 'Signup on EE' do
select 'Other', from: 'user_role' select 'Other', from: 'user_role'
expect(page).not_to have_field('What is your job title? (optional)') expect(page).not_to have_field('What is your job title? (optional)')
choose 'user_setup_for_company_false' choose 'user_setup_for_company_false'
click_button 'Get started!' click_button 'Continue'
user = User.find_by_username!(new_user[:username]) user = User.find_by_username!(new_user[:username])
expect(user.other_role).to be_blank expect(user.other_role).to be_blank
...@@ -109,7 +109,7 @@ RSpec.describe 'Signup on EE' do ...@@ -109,7 +109,7 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role' select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_false' choose 'user_setup_for_company_false'
click_button 'Get started!' click_button 'Continue'
user = User.find_by_username!(new_user[:username]) user = User.find_by_username!(new_user[:username])
expect(user.other_role).to be_blank expect(user.other_role).to be_blank
...@@ -133,14 +133,14 @@ RSpec.describe 'Signup on EE' do ...@@ -133,14 +133,14 @@ RSpec.describe 'Signup on EE' do
choose 'user_setup_for_company_false' choose 'user_setup_for_company_false'
fill_in 'What is your job title? (optional)', with: job_title fill_in 'What is your job title? (optional)', with: job_title
click_button 'Get started!' click_button 'Continue'
user = User.find_by_username!(new_user[:username]) user = User.find_by_username!(new_user[:username])
expect(user.other_role).to eq(job_title) expect(user.other_role).to eq(job_title)
end end
end end
it 'redirects to step 2 of the signup process, sets the role and setup for company and redirects back' do it 'redirects to step 2 of the signup process when not completed' do
fill_in_signup_form fill_in_signup_form
click_button 'Register' click_button 'Register'
visit new_project_path visit new_project_path
...@@ -149,12 +149,11 @@ RSpec.describe 'Signup on EE' do ...@@ -149,12 +149,11 @@ RSpec.describe 'Signup on EE' do
select 'Software Developer', from: 'user_role' select 'Software Developer', from: 'user_role'
choose 'user_setup_for_company_true' choose 'user_setup_for_company_true'
click_button 'Get started!' click_button 'Continue'
user = User.find_by_username(new_user[:username]) user = User.find_by_username(new_user[:username])
expect(user.software_developer_role?).to be_truthy expect(user.software_developer_role?).to be_truthy
expect(user.setup_for_company).to be_truthy expect(user.setup_for_company).to be_truthy
expect(page).to have_current_path(new_project_path)
end end
end end
...@@ -176,5 +175,18 @@ RSpec.describe 'Signup on EE' do ...@@ -176,5 +175,18 @@ RSpec.describe 'Signup on EE' do
expect(user.email_opted_in_source).to be_blank expect(user.email_opted_in_source).to be_blank
expect(user.email_opted_in_at).to be_nil expect(user.email_opted_in_at).to be_nil
end end
it 'redirects to step 2 of the signup process when not completed and redirects back' do
fill_in_signup_form
click_button 'Register'
visit new_project_path
expect(page).to have_current_path(users_sign_up_welcome_path)
select 'Software Developer', from: 'user_role'
click_button 'Get started!'
expect(page).to have_current_path(new_project_path)
end
end end
end end
...@@ -104,17 +104,17 @@ RSpec.describe EE::WelcomeHelper do ...@@ -104,17 +104,17 @@ RSpec.describe EE::WelcomeHelper do
end end
end end
shared_context 'with the onboarding issues experiment' do shared_context 'with signup onboarding' do
let(:onboarding_issues_experiment_enabled) { false } let(:signup_onboarding_enabled) { false }
before do before do
allow(helper).to receive(:onboarding_issues_experiment_enabled?).and_return(onboarding_issues_experiment_enabled) allow(helper).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
end end
end end
describe '#show_signup_flow_progress_bar?' do describe '#show_signup_flow_progress_bar?' do
include_context 'with the various user flows' include_context 'with the various user flows'
include_context 'with the onboarding issues experiment' include_context 'with signup onboarding'
subject { helper.show_signup_flow_progress_bar? } subject { helper.show_signup_flow_progress_bar? }
...@@ -128,8 +128,8 @@ RSpec.describe EE::WelcomeHelper do ...@@ -128,8 +128,8 @@ RSpec.describe EE::WelcomeHelper do
end end
with_them do with_them do
context 'regardless of if the onboarding issues experiment is enabled' do context 'regardless of signup onboarding' do
where(onboarding_issues_experiment_enabled: [true, false]) where(signup_onboarding_enabled: [true, false])
with_them do with_them do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
...@@ -147,8 +147,8 @@ RSpec.describe EE::WelcomeHelper do ...@@ -147,8 +147,8 @@ RSpec.describe EE::WelcomeHelper do
end end
with_them do with_them do
context 'regardless of if the onboarding issues experiment is enabled' do context 'regardless of signup onboarding' do
where(onboarding_issues_experiment_enabled: [true, false]) where(signup_onboarding_enabled: [true, false])
with_them do with_them do
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
...@@ -158,13 +158,13 @@ RSpec.describe EE::WelcomeHelper do ...@@ -158,13 +158,13 @@ RSpec.describe EE::WelcomeHelper do
end end
context 'and not in the invitation, oauth, or trial flow' do context 'and not in the invitation, oauth, or trial flow' do
where(:onboarding_issues_experiment_enabled, :result) do where(:signup_onboarding_enabled, :result) do
true | true true | true
false | false false | false
end end
with_them do with_them do
it 'depends on whether or not the onboarding issues experiment is enabled' do it 'depends on whether or not signup onboarding is enabldd' do
is_expected.to eq(result) is_expected.to eq(result)
end end
end end
...@@ -174,7 +174,7 @@ RSpec.describe EE::WelcomeHelper do ...@@ -174,7 +174,7 @@ RSpec.describe EE::WelcomeHelper do
describe '#welcome_submit_button_text' do describe '#welcome_submit_button_text' do
include_context 'with the various user flows' include_context 'with the various user flows'
include_context 'with the onboarding issues experiment' include_context 'with signup onboarding'
subject { helper.welcome_submit_button_text } subject { helper.welcome_submit_button_text }
...@@ -185,8 +185,8 @@ RSpec.describe EE::WelcomeHelper do ...@@ -185,8 +185,8 @@ RSpec.describe EE::WelcomeHelper do
end end
with_them do with_them do
context 'regardless of if the onboarding issues experiment is enabled' do context 'regardless of signup onboarding' do
where(onboarding_issues_experiment_enabled: [true, false]) where(signup_onboarding_enabled: [true, false])
with_them do with_them do
it { is_expected.to eq('Continue') } it { is_expected.to eq('Continue') }
...@@ -203,8 +203,8 @@ RSpec.describe EE::WelcomeHelper do ...@@ -203,8 +203,8 @@ RSpec.describe EE::WelcomeHelper do
end end
with_them do with_them do
context 'regardless of if the onboarding issues experiment is enabled' do context 'regardless of signup onboarding' do
where(onboarding_issues_experiment_enabled: [true, false]) where(signup_onboarding_enabled: [true, false])
with_them do with_them do
it { is_expected.to eq('Get started!') } it { is_expected.to eq('Get started!') }
...@@ -214,13 +214,13 @@ RSpec.describe EE::WelcomeHelper do ...@@ -214,13 +214,13 @@ RSpec.describe EE::WelcomeHelper do
end end
context 'and not in the invitation or oauth flow' do context 'and not in the invitation or oauth flow' do
where(:onboarding_issues_experiment_enabled, :result) do where(:signup_onboarding_enabled, :result) do
true | 'Continue' true | 'Continue'
false | 'Get started!' false | 'Get started!'
end end
with_them do with_them do
it 'depends on whether or not the onboarding issues experiment is enabled' do it 'depends on whether or not signup onboarding is enabled' do
is_expected.to eq(result) is_expected.to eq(result)
end end
end end
...@@ -231,7 +231,7 @@ RSpec.describe EE::WelcomeHelper do ...@@ -231,7 +231,7 @@ RSpec.describe EE::WelcomeHelper do
describe '#data_attributes_for_progress_bar_js_component' do describe '#data_attributes_for_progress_bar_js_component' do
before do before do
allow(helper).to receive(:in_subscription_flow?).and_return(options_enabled) allow(helper).to receive(:in_subscription_flow?).and_return(options_enabled)
allow(helper).to receive(:onboarding_issues_experiment_enabled?).and_return(options_enabled) allow(helper).to receive(:signup_onboarding_enabled?).and_return(options_enabled)
end end
subject { helper.tag(:div, data: helper.data_attributes_for_progress_bar_js_component) } subject { helper.tag(:div, data: helper.data_attributes_for_progress_bar_js_component) }
...@@ -243,7 +243,7 @@ RSpec.describe EE::WelcomeHelper do ...@@ -243,7 +243,7 @@ RSpec.describe EE::WelcomeHelper do
with_them do with_them do
it 'always includes both attributes with stringified boolean values' do it 'always includes both attributes with stringified boolean values' do
is_expected.to eq(%{<div data-is-in-subscription-flow="#{attr_values}" data-is-onboarding-issues-experiment-enabled="#{attr_values}" />}) is_expected.to eq(%{<div data-is-in-subscription-flow="#{attr_values}" data-is-signup-onboarding-enabled="#{attr_values}" />})
end end
end end
end end
...@@ -282,4 +282,24 @@ RSpec.describe EE::WelcomeHelper do ...@@ -282,4 +282,24 @@ RSpec.describe EE::WelcomeHelper do
is_expected.to eq(false) is_expected.to eq(false)
end end
end end
describe '#signup_onboarding_enabled?' do
subject { helper.signup_onboarding_enabled? }
where(:is_com, :feature_flag_enabled, :result) do
true | true | true
true | false | false
false | true | false
false | false | false
end
with_them do
before do
expect(Gitlab).to receive(:com?).and_return(is_com)
stub_feature_flags(signup_onboarding: feature_flag_enabled)
end
it { is_expected.to eq(result) }
end
end
end end
...@@ -11,7 +11,7 @@ RSpec.describe 'registrations/welcome/show' do ...@@ -11,7 +11,7 @@ RSpec.describe 'registrations/welcome/show' do
before do before do
allow(view).to receive(:current_user).and_return(user) allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:redirect_path).and_return(redirect_path) allow(view).to receive(:redirect_path).and_return(redirect_path)
allow(view).to receive(:onboarding_issues_experiment_enabled?).and_return(onboarding_issues_experiment_enabled) allow(view).to receive(:signup_onboarding_enabled?).and_return(signup_onboarding_enabled)
allow(Gitlab).to receive(:com?).and_return(true) allow(Gitlab).to receive(:com?).and_return(true)
stub_feature_flags(user_other_role_details: user_other_role_details_enabled) stub_feature_flags(user_other_role_details: user_other_role_details_enabled)
...@@ -20,7 +20,7 @@ RSpec.describe 'registrations/welcome/show' do ...@@ -20,7 +20,7 @@ RSpec.describe 'registrations/welcome/show' do
subject { rendered } subject { rendered }
where(:redirect_path, :onboarding_issues_experiment_enabled, :show_progress_bar, :flow, :is_continue) do where(:redirect_path, :signup_onboarding_enabled, :show_progress_bar, :flow, :is_continue) do
'/-/subscriptions/new' | false | true | :subscription | true '/-/subscriptions/new' | false | true | :subscription | true
'/-/subscriptions/new' | true | true | :subscription | true '/-/subscriptions/new' | true | true | :subscription | true
'/-/trials/new' | false | false | :trial | true '/-/trials/new' | false | false | :trial | true
......
...@@ -34,10 +34,6 @@ ...@@ -34,10 +34,6 @@
module Gitlab module Gitlab
module Experimentation module Experimentation
EXPERIMENTS = { EXPERIMENTS = {
onboarding_issues: {
tracking_category: 'Growth::Conversion::Experiment::OnboardingIssues',
use_backwards_compatible_subject_index: true
},
ci_notification_dot: { ci_notification_dot: {
tracking_category: 'Growth::Expansion::Experiment::CiNotificationDot', tracking_category: 'Growth::Expansion::Experiment::CiNotificationDot',
use_backwards_compatible_subject_index: true use_backwards_compatible_subject_index: true
......
...@@ -21,20 +21,11 @@ RSpec.describe Registrations::ExperienceLevelsController do ...@@ -21,20 +21,11 @@ RSpec.describe Registrations::ExperienceLevelsController do
context 'with an authenticated user' do context 'with an authenticated user' do
before do before do
sign_in(user) sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
end end
it { is_expected.to have_gitlab_http_status(:ok) } it { is_expected.to have_gitlab_http_status(:ok) }
it { is_expected.to render_template('layouts/devise_experimental_onboarding_issues') } it { is_expected.to render_template('layouts/signup_onboarding') }
it { is_expected.to render_template(:show) } it { is_expected.to render_template(:show) }
context 'when not part of the onboarding issues experiment' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
end end
end end
...@@ -52,15 +43,6 @@ RSpec.describe Registrations::ExperienceLevelsController do ...@@ -52,15 +43,6 @@ RSpec.describe Registrations::ExperienceLevelsController do
before do before do
sign_in(user) sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
end
context 'when not part of the onboarding issues experiment' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end end
context 'when user is successfully updated' do context 'when user is successfully updated' do
......
...@@ -9,7 +9,6 @@ RSpec.describe 'Experience level screen' do ...@@ -9,7 +9,6 @@ RSpec.describe 'Experience level screen' do
before do before do
group.add_owner(user) group.add_owner(user)
gitlab_sign_in(user) gitlab_sign_in(user)
stub_experiment_for_subject(onboarding_issues: true)
visit users_sign_up_experience_level_path(namespace_path: group.to_param) visit users_sign_up_experience_level_path(namespace_path: group.to_param)
end end
......
...@@ -7,7 +7,6 @@ require 'spec_helper' ...@@ -7,7 +7,6 @@ require 'spec_helper'
RSpec.describe Gitlab::Experimentation::EXPERIMENTS do RSpec.describe Gitlab::Experimentation::EXPERIMENTS do
it 'temporarily ensures we know what experiments exist for backwards compatibility' do it 'temporarily ensures we know what experiments exist for backwards compatibility' do
expected_experiment_keys = [ expected_experiment_keys = [
:onboarding_issues,
:ci_notification_dot, :ci_notification_dot,
:upgrade_link_in_user_menu_a, :upgrade_link_in_user_menu_a,
:invite_members_version_a, :invite_members_version_a,
......
...@@ -13,7 +13,6 @@ RSpec.describe 'registrations/welcome/show' do ...@@ -13,7 +13,6 @@ RSpec.describe 'registrations/welcome/show' do
allow(view).to receive(:in_trial_flow?).and_return(false) allow(view).to receive(:in_trial_flow?).and_return(false)
allow(view).to receive(:in_invitation_flow?).and_return(false) allow(view).to receive(:in_invitation_flow?).and_return(false)
allow(view).to receive(:in_oauth_flow?).and_return(false) allow(view).to receive(:in_oauth_flow?).and_return(false)
allow(view).to receive(:experiment_enabled?).with(:onboarding_issues).and_return(false)
allow(Gitlab).to receive(:com?).and_return(false) allow(Gitlab).to receive(:com?).and_return(false)
render render
......
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