Commit b267299f authored by Ash McKenzie's avatar Ash McKenzie Committed by Ash McKenzie

Add A/B testing support to onboarding

As well as checking if we're gitlab.com and the
:user_onboarding feature flag is enabled, let's
roll the dice with an A/B test controlled by the
:experiment_growth_onboarding feature flag.
parent 9e05fcb8
......@@ -3,6 +3,7 @@
class Dashboard::ProjectsController < Dashboard::ApplicationController
include ParamsBackwardCompatibility
include RendersMemberAccess
include OnboardingExperimentHelper
prepend_before_action(only: [:index]) { authenticate_sessionless_user!(:rss) }
before_action :set_non_archived_param
......
......@@ -5,23 +5,26 @@ module EE
module ProjectsController
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
include ::OnboardingExperimentHelper
private
override :render_projects
def render_projects
if show_onboarding_welcome_page?
redirect_to explore_onboarding_index_path
else
super
end
return redirect_to explore_onboarding_index_path if show_onboarding_welcome_page?
super
end
def show_onboarding_welcome_page?
return false unless ::Gitlab.com?
return false if cookies['onboarding_dismissed'] == 'true'
return false if onboarding_cookie_set?
return false unless allow_access_to_onboarding?
!show_projects?(projects, params)
end
::Feature.enabled?(:user_onboarding) && !show_projects?(projects, params)
def onboarding_cookie_set?
cookies['onboarding_dismissed'] == 'true'
end
end
end
......
# frozen_string_literal: true
class Explore::OnboardingController < Explore::ApplicationController
include ::OnboardingExperimentHelper
before_action :authenticate_user!
before_action :set_project!
......@@ -17,8 +19,6 @@ class Explore::OnboardingController < Explore::ApplicationController
end
def get_onboarding_demo_project
if Gitlab.com? && Feature.enabled?(:user_onboarding)
Project.find_by_full_path("gitlab-org/gitlab-ce")
end
Project.find_by_full_path("gitlab-org/gitlab-ce") if allow_access_to_onboarding?
end
end
......@@ -3,6 +3,8 @@
module EE
module ApplicationHelper
extend ::Gitlab::Utils::Override
include ::OnboardingExperimentHelper
DB_LAG_SHOW_THRESHOLD = 60 # seconds
LOG_CURSOR_CHECK_TIME = ::Gitlab::Geo::LogCursor::Daemon::SECONDARY_CHECK_INTERVAL
EVENT_PROCESSING_TIME = 60.seconds
......@@ -118,7 +120,7 @@ module EE
end
def user_onboarding_enabled?
::Gitlab.com? && ::Feature.enabled?(:user_onboarding)
allow_access_to_onboarding?
end
private
......
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