Commit 3f3b7f68 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'nicolasdular/cleanup-onboarding-issue-tracking' into 'master'

Remove onboarding issue tracking

See merge request gitlab-org/gitlab!52349
parents 7d755fad 7b51d9ba
......@@ -319,9 +319,7 @@ class GroupsController < Groups::ApplicationController
private
def successful_creation_hooks
track_experiment_event(:onboarding_issues, 'created_namespace')
end
def successful_creation_hooks; end
def groups
if @group.supports_events?
......
......@@ -14,7 +14,6 @@ module Registrations
if current_user.save
hide_advanced_issues
record_experiment_user(:default_to_issues_board)
if experiment_enabled?(:default_to_issues_board) && learn_gitlab.available?
redirect_to namespace_project_board_path(params[:namespace_path], learn_gitlab.project, learn_gitlab.board)
......
......@@ -39,9 +39,6 @@ module Registrations
def process_gitlab_com_tracking
return false unless ::Gitlab.com?
return false unless show_onboarding_issues_experiment?
track_experiment_event(:onboarding_issues, 'signed_up')
record_experiment_user(:onboarding_issues)
end
def update_params
......
......@@ -143,103 +143,5 @@ RSpec.describe Registrations::WelcomeController do
end
end
end
describe 'recording the user and tracking events for the onboarding issues experiment' do
using RSpec::Parameterized::TableSyntax
let(:on_gitlab_com) { false }
let(:experiment_enabled) { false }
let(:experiment_enabled_for_user) { false }
let(:in_subscription_flow) { false }
let(:in_invitation_flow) { false }
let(:in_oauth_flow) { false }
let(:in_trial_flow) { false }
before do
sign_in(user)
allow(::Gitlab).to receive(:com?).and_return(on_gitlab_com)
stub_experiment(onboarding_issues: experiment_enabled)
stub_experiment_for_subject(onboarding_issues: experiment_enabled_for_user)
allow(controller.helpers).to receive(:in_subscription_flow?).and_return(in_subscription_flow)
allow(controller.helpers).to receive(:in_invitation_flow?).and_return(in_invitation_flow)
allow(controller.helpers).to receive(:in_oauth_flow?).and_return(in_oauth_flow)
allow(controller.helpers).to receive(:in_trial_flow?).and_return(in_trial_flow)
end
context 'when on GitLab.com' do
let(:on_gitlab_com) { true }
context 'and the onboarding issues experiment is enabled' do
let(:experiment_enabled) { true }
context 'and we’re not in the subscription, invitation, oauth, or trial flow' do
where(:experiment_enabled_for_user, :group_type) do
true | :experimental
false | :control
end
with_them do
it 'adds the user to the experiments table with the correct group_type' do
expect(::Experiment).to receive(:add_user).with(:onboarding_issues, group_type, user, {})
subject
end
it 'tracks a signed_up event', :snowplow do
subject
expect_snowplow_event(
category: 'Growth::Conversion::Experiment::OnboardingIssues',
action: 'signed_up',
label: anything,
property: "#{group_type}_group"
)
end
end
end
context 'but we’re in the subscription, invitation, oauth, or trial flow' do
where(:in_subscription_flow, :in_invitation_flow, :in_oauth_flow, :in_trial_flow) do
true | false | false | false
false | true | false | false
false | false | true | false
false | false | false | true
end
with_them do
it 'does not add the user to the experiments table' do
expect(::Experiment).not_to receive(:add_user)
subject
end
it 'does not track a signed_up event', :snowplow do
subject
expect_no_snowplow_event
end
end
end
end
end
context 'when not on GitLab.com, regardless of whether or not the experiment is enabled' do
where(experiment_enabled: [true, false])
with_them do
it 'does not add the user to the experiments table' do
expect(::Experiment).not_to receive(:add_user)
subject
end
it 'does not track a signed_up event', :snowplow do
subject
expect_no_snowplow_event
end
end
end
end
end
end
......@@ -306,66 +306,6 @@ RSpec.describe GroupsController, factory_default: :keep do
end
end
end
describe 'tracking group creation for onboarding issues experiment' do
before do
sign_in(user)
end
subject(:create_namespace) { post :create, params: { group: { name: 'new_group', path: 'new_group' } } }
context 'experiment disabled' do
before do
stub_experiment(onboarding_issues: false)
end
it 'does not track anything', :snowplow do
create_namespace
expect_no_snowplow_event
end
end
context 'experiment enabled' do
before do
stub_experiment(onboarding_issues: true)
end
context 'and the user is part of the control group' do
before do
stub_experiment_for_subject(onboarding_issues: false)
end
it 'tracks the event with the "created_namespace" action with the "control_group" property', :snowplow do
create_namespace
expect_snowplow_event(
category: 'Growth::Conversion::Experiment::OnboardingIssues',
action: 'created_namespace',
label: anything,
property: 'control_group'
)
end
end
context 'and the user is part of the experimental group' do
before do
stub_experiment_for_subject(onboarding_issues: true)
end
it 'tracks the event with the "created_namespace" action with the "experimental_group" property', :snowplow do
create_namespace
expect_snowplow_event(
category: 'Growth::Conversion::Experiment::OnboardingIssues',
action: 'created_namespace',
label: anything,
property: 'experimental_group'
)
end
end
end
end
end
describe 'GET #index' do
......
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