Skip to content

Set up initial onboarding decision tree for product analytics

Robert Hunt requested to merge 381315-create-onboarding-decision-logic into master

This MR adds onto the work done in Set up new file structure for onboarding split ... (!105809 - merged).

This MR adds the start of the decision-making process for the onboarding flow. It checks if the jitsuKey exists and if the Cube API returns any data. Based upon the results it either sends the user to the onboarding flow or dashboards listing.

To help validate this, I have added a feature spec to check the decision-making process end-to-end.

MR Step
Set up new file structure for onboarding split ... (!105809 - merged)
Set up initial onboarding decision tree for pro... (!105811 - merged) 👈 You are here
The decision tree we're working with

image

Screenshots or screen recordings

Situation Screencast
Unknown error Screen_Recording_2022-12-02_at_12.41.27
Onboarding incomplete Screen_Recording_2022-11-25_at_14.20.12
Onboarding complete Screen_Recording_2022-11-25_at_14.19.43

How to set up and validate locally

Make sure you are on at least GitLab Premium.

  1. Enable the feature flag: echo "Feature.enable(:cube_api_proxy)" | rails c.
  2. Set up the devkit and start it running using docker-compose up.
  3. Visit admin settings and make sure that the settings have been set: /admin/application_settings/general#js-product-analytics-settings.
  4. Visit a dashboard on a project that hasn't been set up yet: /[GROUP]/[PROJECT]/-/product_analytics/dashboards/.
  5. Validate the onboarding app is shown.
  6. As an authenticated user who has developer+ access to the project, make the following GraphQL call:
mutation {
  projectInitializeProductAnalytics(input: { projectPath: "[PATH_TO_PROJECT]" }) {
    project {
      fullPath
    }
    errors
  }
}
  1. Refresh the page and check that the onboarding app is still being shown.
  2. Generate some events for the project, in groupproduct analytics we've been using a browser extension like tapermonkey + this userscript to generate events.
    • Using the userscript above you need to change the host to your devkit's Jitsu URL and use your Jitsu key created for the project (under project.project_settings.jitsu_key).
  3. Once events have been created, refresh the dashboard page and check the dashboard listing is shown.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #381315 (closed)

Edited by Robert Hunt

Merge request reports