Closed Bug 880040 Opened 11 years ago Closed 8 years ago

PUT region on an app

Categories

(Marketplace Graveyard :: API, defect, P3)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: andy+bugzilla, Unassigned, Mentored)

References

Details

(Whiteboard: [lang=py][marketplace-transition])

When you get an app from the API you get the regions. As a dict. The client then (rightfully so) put back all the data. The problem is that the region is being put back as a list. Something that the client doesn't understand.

It would be nicer if the regions were a list of URLs pointing to the region resources. Then when the PUT occurred, the client could just pass back the URLs of the regions they'd like to use.

This requires:

- changing the output of regions on the app resource
- changing the input of regions

For the moment since this broke things, I've commented it out.

https://github.com/mozilla/zamboni/commit/e8d58c
And don't forget the search side of this. This make @robhudson all happy and not like you've just given him a pint of Coors Lite.
Priority: -- → P4
This would make krupa happier if we could fix this so in the API QA could turn regions on off for test apps en masse.
Priority: P4 → P2
Assignee: nobody → wraithan
Assignee: wraithan → nobody
Depends on: 910623
The documentation on the regions parameter was removed in https://github.com/mozilla/zamboni/commit/98c1bb903bd03e85478f06429d87f7af7ece8d99#diff-5d3f3edc027f7584d97983db4d72a692L193, make sure it gets added back when this is fixed.
Assignee: nobody → mpillard
Because we need to handle special regions, payments, calculate difference between previous and new regions etc I believe the best approach would be to re-use mkt.developers.RegionForm, and possibly do that on a separate endpoint to make the implementation easier (we can always adapt later, but keeping it separate initially will make things much easier to test and avoid introducing new problems in the current API)

Something like a 'regions' @action on the AppViewSet should work.
Assignee: mpillard → nobody
Priority: P2 → P3
Whiteboard: [contribute]
Whiteboard: [contribute] → [good first bug]
Hi Andy/MP-Team, it looks like this might not be very much clear to the newbie how to fix this. Can you put some information here for newbies so that they can pick this bug and fix it.

Thanks,
Ram
Flags: needinfo?(amckay)
I don't know if this is relevant any more, someone on the marketplace team might be able to help.
Flags: needinfo?(amckay)
This is still relevant.  The bug description is pretty good IMHO, and should be accessible to python developers, particularly if they are already familiar with Django. This requires changing the backend code (in the "zamboni" repository, where our API lives), the instructions to set it up are available over at http://marketplace.readthedocs.org/en/latest/topics/backend.html

It probably requires modifying the serializers in https://github.com/mozilla/zamboni/blob/master/mkt/webapps/serializers.py ; we use Django REST Framework, so this documentation should be useful: http://www.django-rest-framework.org/api-guide/serializers/
Whiteboard: [good first bug] → [good first bug][lang=py]
Mathieu, would you mentor this bug?
Flags: needinfo?(mpillard)
Yes, but do note the python/Django requirement. It's only a good first bug for contributors knowing Python, preferably Django as well.
Flags: needinfo?(mpillard)
Sure, it think this has become clear from comment 8. Nevertheless, someone who would be willing to answer specific questions helps people not knowing zamboni inside out a lot.

Thanks!
Mentor: mpillard
Whiteboard: [good first bug][lang=py] → [lang=py]
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Whiteboard: [lang=py] → [lang=py][marketplace-transition]
You need to log in before you can comment on or make changes to this bug.