-
Notifications
You must be signed in to change notification settings - Fork 266
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
billing: marketplace UI (PROJQUAY-6551) #2595
Conversation
adds UI in billing section for managing user and org-bound skus add more unit tests for org binding change endpoint for bulk attaching skus to orgs
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2595 +/- ##
==========================================
+ Coverage 70.63% 70.67% +0.03%
==========================================
Files 434 434
Lines 39887 39919 +32
Branches 5173 5180 +7
==========================================
+ Hits 28174 28212 +38
+ Misses 10088 10079 -9
- Partials 1625 1628 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
endpoints/api/billing.py
Outdated
@@ -1019,7 +1058,7 @@ def delete(self, orgname, subscription_id): | |||
return ("Organization not valid", 400) | |||
|
|||
model.organization_skus.remove_subscription_from_org(organization.id, subscription_id) | |||
return ("Deleted", 204) | |||
return ("Deleted", 200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to change from 204 to 200?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having trouble updating the frontend component when removing a sku because 204 returned an empty response
endpoints/api/billing.py
Outdated
@@ -1040,7 +1079,7 @@ def get(self): | |||
user = get_authenticated_user() | |||
account_number = marketplace_users.get_account_number(user) | |||
if not account_number: | |||
raise NotFound() | |||
return [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, why go from 404 to 200? The client should be able to handle this.
An empty list should be returned in the case where the account number exists, but no subscriptions is attached to that user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same reason as above, the billing ui would look like it was indefinitely loading when the api returned the 404. I found a way to properly handle the frontend though and updated the response codes accordingly
* billing: marketplace UI adds UI in billing section for managing user and org-bound skus add more unit tests for org binding changed endpoint for bulk attaching skus to orgs
adds UI in billing section for managing user and org-bound skus
add new skus for bulk purchase orders
change api endpoints to allow bulk attaching skus to orgs