Initialize new product analytics stack via GraphQL
What does this MR do and why?
- Adds a new GraphQL mutation:
projectInitializeProductAnalytics
which attempts to initialize the product analytics tooling for an individual project. - The job will be attempted 4 times before failing, and allowing the user to trigger the process again.
- We're using a custom way of deduplicating using redis keys rather than
:until_executed
so that the frontend can know if a job is currently in progress. (I'm open to better ways to achieve this!)
Screencast
See demonstration: https://youtu.be/NCkbsPHWYtg
How to set up and validate locally
- Enable the feature flag:
echo "Feature.enable(:cube_api_proxy)" | rails c
. - Set up the devkit and start it running using
docker-compose up
. - Visit admin settings and make sure that the settings have been set:
/admin/application_settings/general#js-product-analytics-settings
- As an authenticated user who has developer+ access to a particular project, make the following GraphQL call:
mutation {
projectInitializeProductAnalytics(input: { projectPath: "flightjs/project_twenty" }) {
project {
fullPath
}
errors
}
}
- Assert that a new background job has been created.
- Assert that a new connection is created in jitsu.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #383050 (closed)
Edited by Max Woolf