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
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Visit any group or project member pages such as
http://127.0.0.1:3000/admin/subscription
- Run
bin/rails c
and thenLicense.destroy_all
to delete all current licenses. Note: this action is non-reversible! - 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
- Do one of these two:
-
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: -
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 aCloudActivation
record to be created:
-
- Apply this patch: fake-cloud-license-renewal-of-legacy-license.patch
- Find the subscription activation code in http://localhost:5000/ and activate it in your instance.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #352092 (closed)