Skip to content

Retrieve and use (current) subscription name for finalising the purchase

Angelo Gulina requested to merge ag/341564-subs-name into master

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR is a step towards solving the scenario of gitlab-org/gitlab#341564.

The MR goes on to:

  • retrieving the current active subscription name
  • passing it to the frontend GraphQL store
  • sending it back with the request to CDot

Additionally, it addresses misbehaviour described here by adding an isAddon flag to the purchase. While this is not ideal, it is necessary at the moment until the GL <> CDot communication is fully migrated to GraphQL.

Note that the logic outlined here works on the assumption that we will want to link the account ID to the namespace at a later point.

No changelog was provided as the feature is not user-facing (yet).

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

There are no visible changes. The screenshot is provided only for illustration purposes.

Screenshot_2021-10-19_at_07.07.57

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Example below:

  1. Make sure your CustomersDot is running locally
  2. Make sure to have set GITLAB_LICENSE_MODE=test on gdk (see here)
  3. Make sure to have :new_route_ci_minutes_purchase enabled
  4. Make sure to have a Group with a purchased plan
  5. Visit /-/subscriptions/buy_minutes/?selected_group=<your-group-id>
  6. Complete the purchase

You should expect the purchase to be completed with success. In case gitlab-org/customers-gitlab-com!3895 is already merged, you can also verify in your local CustomersDot: the add-on plan should be added to the Subscription entry (see screenshot above).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Angelo Gulina

Merge request reports