Skip to content

Blocks unprovisioned access to product analytics apis

What does this MR do and why?

This allows product analytics apis to restrict product analytics api calls when not provisioned/purchased

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Set GDK to SaaS simulation and enable product analytics feature flag.

  • Create a new group or an already existing group, with ultimate subscription.

  • Enable the feature flag product_analytics_billing for the group namespace

    Feature.enable(:product_analytics_billing, namespace, type: :wip)
  • Make an api call to the product analytics APIs (/load, /meta, etc.). It should return a 404 Not Found error (If you haven't setup your own PA cluster or purchased PA addon)

  • Purchase a PA addon using the api or setup your own cluster

  • PA api calls should be unblocked now.

  • You can try out the same with GraphQL api projectInitializeProductAnalytics

    mutation {
      projectInitializeProductAnalytics(input: 
        {projectPath: "gitlab-org/my-website"}) {
        project {
          id
          fullPath
        }
        errors
      }
    }
    

Related to #451250

Edited by Surabhi Suman

Merge request reports