Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
90385228
Commit
90385228
authored
Dec 23, 2021
by
Dallas Reedy
Committed by
Dmitry Gruzd
Dec 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tracking for the Continuous Onboarding iteration 2 experiment
parent
ba14ce92
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
64 deletions
+19
-64
app/experiments/change_continuous_onboarding_link_urls_experiment.rb
...ents/change_continuous_onboarding_link_urls_experiment.rb
+0
-9
app/helpers/learn_gitlab_helper.rb
app/helpers/learn_gitlab_helper.rb
+6
-2
spec/experiments/change_continuous_onboarding_link_urls_experiment_spec.rb
...change_continuous_onboarding_link_urls_experiment_spec.rb
+0
-53
spec/helpers/learn_gitlab_helper_spec.rb
spec/helpers/learn_gitlab_helper_spec.rb
+13
-0
No files found.
app/experiments/change_continuous_onboarding_link_urls_experiment.rb
deleted
100644 → 0
View file @
ba14ce92
# frozen_string_literal: true
class
ChangeContinuousOnboardingLinkUrlsExperiment
<
ApplicationExperiment
# rubocop:disable Gitlab/NamespacedClass
attr_writer
:namespace
def
track
(
action
,
**
event_args
)
super
(
action
,
**
event_args
.
merge
(
namespace:
@namespace
))
end
end
app/helpers/learn_gitlab_helper.rb
View file @
90385228
...
...
@@ -27,8 +27,12 @@ module LearnGitlabHelper
urls_to_use
=
nil
experiment
(
:change_continuous_onboarding_link_urls
)
do
|
e
|
e
.
namespace
=
project
.
namespace
experiment
(
:change_continuous_onboarding_link_urls
,
namespace:
project
.
namespace
,
actor:
current_user
,
sticky_to:
project
.
namespace
)
do
|
e
|
e
.
use
{
urls_to_use
=
action_urls
}
e
.
try
{
urls_to_use
=
new_action_urls
(
project
)
}
end
...
...
spec/experiments/change_continuous_onboarding_link_urls_experiment_spec.rb
deleted
100644 → 0
View file @
ba14ce92
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
ChangeContinuousOnboardingLinkUrlsExperiment
,
:snowplow
do
before
do
stub_experiments
(
change_continuous_onboarding_link_urls:
'control'
)
end
describe
'#track'
do
context
'when no namespace has been set'
do
it
'tracks the action as normal'
do
subject
.
track
(
:some_action
)
expect_snowplow_event
(
category:
subject
.
name
,
action:
'some_action'
,
namespace:
nil
,
context:
[
{
schema:
'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0'
,
data:
an_instance_of
(
Hash
)
}
]
)
end
end
context
'when a namespace has been set'
do
let_it_be
(
:namespace
)
{
create
(
:namespace
)
}
before
do
subject
.
namespace
=
namespace
end
it
'tracks the action and merges the namespace into the event args'
do
subject
.
track
(
:some_action
)
expect_snowplow_event
(
category:
subject
.
name
,
action:
'some_action'
,
namespace:
namespace
,
context:
[
{
schema:
'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0'
,
data:
an_instance_of
(
Hash
)
}
]
)
end
end
end
end
spec/helpers/learn_gitlab_helper_spec.rb
View file @
90385228
...
...
@@ -176,6 +176,19 @@ RSpec.describe LearnGitlabHelper do
)
})
end
it
'calls experiment with expected context & options'
do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
expect
(
helper
).
to
receive
(
:experiment
).
with
(
:change_continuous_onboarding_link_urls
,
namespace:
namespace
,
actor:
user
,
sticky_to:
namespace
)
learn_gitlab_data
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment