Fetch eligibility for new purchase from customers app
What does this MR do?
Addresses: customers-gitlab-com#2344 (closed)
Prior to this change, the eligibility logic for whether or not a group was eligible for a new subscription was defined on both customers and the GitLab application.
This resulted in changes being made in the customers flow that were not reflected in the GitLab flow.
This MR:
- Removes the GitLab app logic to determine if a namespace is eligible for a new purchase
- Start calling the purchase eligibility endpoint on the customers app to determine if the namespace is eligible
This is a follow up from https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/2603 which introduced the new endpoint on the customers app.
💡 Steps to reproduce
- The
repurchase_expired_subscriptions: true
feature flag must be set oncustomers-dot
-
Create a customer with an expired subscription in the grace period
- Create a new user on
gitlab
and link to acustomers-dot
account - Create a personal subscription for the customers namespace (to link the customer account in Zuora)
- Create a new subscription in Zuora for this customer account, backdated so that it expired in the last week
- Setup video for this is here: https://www.youtube.com/watch?v=OyPddapv1BY
- Create a new user on
-
Link the expired subscription to a group
- Create a new group on
gitlab
- Comment out
SubscriptionController
expired guard clause - Comment out
NamspaceTransactionValidator
expired guard clause - Navigate to
Manage Purchaces
in customers, and copy the subscription ID (egA-S00073959
) of the expired subscription - Click
Change linked namespace
on the non-expired subscription (for the personal namespace) - Replace the subscription ID in the URL with the copied ID of the expired one
- Select the group in the dropdown and save
- Create a new group on
-
View the state of the dropdown on customers dot
- Navigate to
Buy new subscription > Add new subscription > Buy now > Buy ... plan
- The group with the expired plan should appear in the namespace list
- Navigate to
- Enable the
move_gitlab_purchases_to_gitlab: true
feature flag -
View the status of the dropdown on gitlab
- Make sure you're running gitlab EE (ie have a license uploaded)
- Create a new group on
gitlab
without a paid plan (this ensures the dropdown will actually show up) - Navigate to
Buy new subscription > Add new subscription > Buy now > Buy ... plan
- Only the free group should appear in the namespace dropdown
Customers Dot | Gitlab.com [BEFORE] | Gitlab.com [AFTER] |
---|---|---|
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
~~Label as security and @ mention @gitlab-com/gl-security/appsec
~~ -
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Alex Kalderimis