Skip to content

Add a param to indicate the purchase request is from GitLab.com

Vamsi Vempati requested to merge cdot-9697-be-tracking-for-new-purchase into master

What does this MR do and why?

Sends a new param in the new subscription purchase request to Customers Portal to indicate that the purchase originated from GitLab.com.

MR that consumes this new param in Customers Portal: https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/10155/diffs

Related to https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/9697

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

log/development_json.log content:

{
  "method": "POST",
  "path": "/subscriptions",
  "format": "json",
  "controller": "SubscriptionsController",
  "action": "create",
  "status": 201,
  ...
  "unpermitted_params": [
    "purchase_flow",
    ...
  ],
  "params": [
    {
      "key": "purchase_flow",
      "value": "gitlab"
    },
    ...
  ],
  ...
}

How to set up and validate locally

Application setup

  1. Customers Dot needs to be setup in order to view the billing page for a group
  2. Start GDK in SaaS mode GITLAB_SIMULATE_SAAS=1 gdk start

Group setup

  1. Create a Group
  2. [SaaS subscription]: Go to [Group] > Settings > Billing > Click on Upgrade to Premium / Upgrade to Ultimate
  3. [Add-on]: Got to [Group] > Settings > Usage Quotas > Pipelines / Storage > Click on Buy additional compute minutes / Buy storage

New param verification

  1. Open log/development_json.log in Customers Portal repo
  2. Look for subscription creation request with the new param is_purchase_from_gitlab_com set to true for requests from GitLab.com
Edited by Vamsi Vempati

Merge request reports