Skip to content

Product Analytics self-managed provider does not inherit from instance-level connection

What does this MR do and why?

Resolves a bug where instance-level settings are not correctly inherited by projects onboarding with product analytics.

When selecting "self-managed provider" during onboarding:

instance settings project settings should be
self-managed analytics provider optional, inherit instance-level if not supplied
gitlab-managed analytics provider required

This MR also adds a checkbox, which makes the choice between instance-level and project-level self-managed provider selection a deliberate action. When a project has no project-level config, the checkbox is checked by default. When a project is already configured with project-level config, the checkbox is unchecked by default.

Designs are based off of the work which will be done in a future iteration to bring the settings form into the onboarding flow: Allow configuring project-level provider settin... (#451315) For now, the confirmation modal + redirects remain.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After Notes
image image instance-level settings are self-managed provider. allow selecting instance-level or project-level config. checked by default as there are no project-level settings configured
image unchecked. project-settings are not yet configured
image then, existing redirect flow prompts to configure project-level settings
image unchecked by default, since there are project-level settings configured. project-level settings are configured correctly
image when instance-level settings are a GitLab-managed provider (e.g. on gitlab.com) then the checkbox is unavailable.

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. Be sure to run your GDK as .com
  3. View the onboarding page for a new project at Project > Analytics > Analytics dashboards > Set Up [product analytics].
  4. Verify the scenarios described above.

Note: you can hardcode a true here if you want to test the "GitLab-managed provider in instance-level settings" scenarios without setting up actual GitLab-managed provider config values

Note2: comment out this this.initialize(); line to prevent project actually onboarding. it will go into loading state but if you refresh, won't be onboarded. Handy for clicking through the various scenarios without needing fresh projects over-and-over

Related to #455930 (closed)

Edited by Elwyn Benson

Merge request reports