Skip to content

Fix(SM: Subscription): Refresh local state

What does this MR do and why?

Describe in detail what your merge request does and why.

Refresh the local state to reflect the changes correctly on the frontend, when submitting a new license. The particular issue this fixes is when the user submits a license that is not the current license, e.g. a future-dated license.

Screenshots or screen recordings

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

This was a hard situation to mimic, so going to post the whole recording of how we got it to work here: https://youtu.be/97luo257L14

Screen_Shot_2022-02-11_at_17.10.41

How to set up and validate locally

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

  1. Visit any group or project member pages such as http://127.0.0.1:3000/admin/subscription
  2. Run bin/rails c and then License.destroy_all to delete all current licenses. Note: this action is non-reversible!
  3. Make sure to have CustomersDot set up with Zuora to create a back-dated legacy license that is about to expire (started a year minus a week ago) and add it. You can follow the instructions here (a bit out-dated, but still works): https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/doc/resource_videos.md
  4. Do one of these two:
    1. Log into https://apisandbox.zuora.com/, find the subscription and update it to be cloud license to Yes and create a new order with its renewal:

      Screen_Shot_2022-02-11_at_16.59.26
    2. Log into http://localhost:5000/admin/customer, find the customer and click "Zuora Subscriptions" (the little bookmark on the right) and update all the fields to Yes. Click on the little cloud icon next to the subscription to force a CloudActivation record to be created:

      Screen_Shot_2022-02-11_at_16.57.22
  5. Apply this patch: fake-cloud-license-renewal-of-legacy-license.patch
  6. Find the subscription activation code in http://localhost:5000/ and activate it in your instance.
  7. You should see that the current subscription is still the same and that the cloud license subscription was added to the list in the Subscription History Table

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

Edited by Michael Lunøe

Merge request reports

Loading