-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CheckBillingOrderStatus() is misnamed #9
Comments
@riethm For guest upgrade orders, you also need a VM reboot for the changes to take a effect. Is this covered by the true order statuses? If not, how can you really check on the status of a guest upgrade? My feeling is that when checking the billing order status, what most users will really be interested in is the provision status associated with that billing order. We can certainly change the name if this is causing confusion. I also like the idea of passing the billing order item instead of the receipt, to allow checking on multiple items. However, would like to see an example of this need. |
Upgrade orders seem to be different than provisioning orders, in that provisioning orders only reach a final status of 'APPROVED' while upgrades go on to 'COMPLETED'. From what I can tell, once the order status is COMPLETED, the upgrade was complete. But I can hardly ever be certain of that. Also, I did manage to find two upgrade orders in our account with provisioning transactions. |
Personally, I'm not sure it's worth trying to capture the ordering/provisioning/status-update process into a general purpose helper. If we want to have a helper that checks the first provisioning transaction in an order, that's fine, but let's name it appropriately so there will be no false pretense. When I placed an upgrade order and passed the receipt to Trying to avoid a situation like we had with the previous softlayer Go library, where several functions which should have been general purpose were instead tailored for a single use case. That was the impetus for creating this library. |
@riethm I don't think this is a case of a single-use case helper function. I do think that your example of a vm upgrade behaves differently from what would generally be expected, and it is not even something you could count on, since it tells you nothing about the reboot, which is part of "provisioning" that order (i.e. SoftLayer does not provide helpful provisioning status on that kind of order), which is what most users would really be interested on. Should we add more documentation to the function about how it does what it does? What would you add? Also, if you think it should be renamed, what should that new name be? PRs welcome. |
@renier "single-use case" may have been too strong. Limited then because it can only be relied on to be accurate when your order has a single order-item only. My preference would be for one of the following:
VM upgrade orders are indeed different, and would not use this. |
helpers/order/order.go
:The helper name suggests that the status of a Billing_Order is checked, when in-fact:
Provision transactions are not applicable to all types of orders (e.g., guest upgrade orders do not have provision transactions, resulting in a panic when passing an upgrade order receipt to this helper.
These helpers should either be renamed to indicate that they are to be used to check for provisioning transactions, or updated to check the actual order status.
If the former approach is adopted, some thought should also be given as to whether it is appropriate to stop and return after checking only one order item out of potentially multiple to an order
The text was updated successfully, but these errors were encountered: