Avoid using customer relationship for subscription methods on the Order model
Purpose
There are many cases where Orders in CDot production have a zuora_account_id
value but the Customer of the Order does not have a zuora_account_id
. This can be a problem when getting the subscription
or current_subscription
for an order. These methods use the order.customer.zuora_account_id
instead of order.zuora_account_id
. The subscription won't be found for those orders when it actually exists in Zuora.
We should consider updating these subscription methods or if there are any negative consequences. Some changes were made in https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/4551, as part of https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/3837.
There may be other changes necessary to make as we are still seeing reports where provisioning fails due to the relationship of the Customer on the Order. As recently as April 28 2022, this was reported as a problem (originally raised in #2118 (comment 928465165)).
Follow-up
The following discussion is from !2985.