Early Access Program tracking init
What does this MR do and why?
Creates some base product usage activity tracking mechanism for future GitLab Early Access program initiative.
Issue for more details.
Screenshots or screen recordings
Negative scenario 2
Example check for each existing user that didn't do anything but feature flag is enabled:
Positive scenario
Example check for user that participates in Early access program AND agreed on product usage data collection AND feature flag is enabled:
How to set up and validate locally
Negative scenario 1
Example check for each existing user that didn't do anything:
- As signed in user go to some owned project page.
- On left-sidebar click on
Code > Snippets > New snippet
. - Create snippet with any code you like.
- In rails console check that no tracking event created:
EarlyAccessProgram::TrackingEvent.none?
should returntrue
.
Negative scenario 2
Example check for each existing user that didn't do anything but feature flag is enabled:
- In rails console enable feature flag for your user
Feature.enable(:early_access_program, User.find(<your-id>))
- As signed in user go to some owned project page.
- On left-sidebar click on
Code > Snippets > New snippet
. - Create snippet with any code you like. (optionally you can edit existing one)
- In rails console check that no tracking event created:
EarlyAccessProgram::TrackingEvent.none?
should returntrue
.
Positive scenario
Example check for user that participates in Early access program AND agreed on product usage data collection AND feature flag is enabled:
- In rails console enable feature flag for your user
Feature.enable(:early_access_program, User.find(<your-id>))
- In rails console mark your user as Early access program participant and agreed on product usage data collection by
User.find(<your-id>).user_preference.update!(early_access_program_participant: true, early_access_program_tracking: true)
- As signed in user go to some owned project page.
- On left-sidebar click on
Code > Snippets > New snippet
. - Create snippet with any code you like. (optionally you can edit existing one)
- In rails console check that no tracking event created:
EarlyAccessProgram::TrackingEvent.none?
should returnfalse
. - See list of tracking events by typing
EarlyAccessProgram::TrackingEvent.all
in rails console.
Edited by Rostyslav Safonov