Skip to content

Keep instrumentation key pointer update

What does this MR do and why?

Recently we made a change that when updating product analytics settings, we clear product_analytics_instrumentation_key. This was implemented in order to allow re-installing product analytics in the project level.

This change introduced a bug that now when we set up Custom dashboard projects, the existing product_analytics_instrumentation_key is being removed. (I.e. when setting up custom dashboards.

This MR fixes the bug by cleaning up the product_analytics_instrumentation_key only when project_setting_attributes are modified in the analytics controller.

How to set up and validate locally

  1. Set up a product analytics and complete onboarding
  2. Check that project has instrumentation key
Project.find(id).project_setting.product_analytics_instrumentation_key
  1. Go to Settings -> Analytics -> Custom dashboard projects and choose a project under "Analytics Dashboards ".
  2. Click save changes
  3. Check that project still has instrumentation key
Project.find(id).project_setting.product_analytics_instrumentation_key

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 #427432 (closed)

Edited by Halil Coban

Merge request reports