Update Product Analytics onboarding/dashboard flow to reflect updated Snowplow initialization process
Summary
With Integrate Product Analytics initialization work... (#398253 - closed), our project initialization process for Product Analytics will be updated.
The Frontend performs checks such as the presence of jitsuKey in order to provide setup documentation as part of the onboarding flow: https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/assets/javascripts/product_analytics/onboarding/onboarding_setup.vue#L6
Integrate Product Analytics initialization work... (#398253 - closed) introduces a new project setting, product_analytics_instrumentation_key, that we will be using moving forward.
Proposal
Update the existing onboarding and dashboard flows, so that existing UI-based flows that depend on the old jitsu_key project setting continue to work when configuring Product Analytics for new and existing projects.
If the product_analytics_snowplow_support feature flag is enabled, it should check for the product_analytics_instrumentation_key project setting. Otherwise, the jitsu_key project setting.
Feature flag
Please add any Snowplow-specific functionality in addition to what exists for Jitsu behind the product_analytics_snowplow_support feature flag.
This is so we can coordinate a switchover with the external cluster changes and we'll remove the Jitsu-specific code when the feature flag is removed.
Implementation plan
Frontend:
Rename all jitsuKey to trackingKey:
- dashboards_list.vue, onboarding_setup.vue, onboarding_setup_spec.js, analytics_dashboards/index.js
- rename get_project_jitsu_key.query.graphql -> get_project_tracking_key.query.graphql and also update query
- tests
Backend:
Rename jitsu_key to tracking_key in analytics_dashboards_helper.rb and project_type.rb
- when
product_analytics_snowplow_supportFF is enabled, return project.project_setting.product_analytics_instrumentation_key if it exists, otherwise the jitsu_key. - when FF is disabled, continue to only return project.project_setting.jitsu_key
- Update
state_resolver.rbto return correct onboarding state when using Snowplow. - tests