fix review_types argument of the API's Branch.createMergeProposal method
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
Leonard Richardson |
Bug Description
The reviewers and the review_types argument of the Branch.
To fix this bug there are tow possible solutions:
* make the types optional too, by appending emtpy strings to the review_types list like
review_types += [""]*(len(
* or expose the ValueError as a 400 Bad Request with some verbose information
Current error representation:
In [7]: b.createMergePr
-------
HTTPError Traceback (most recent call last)
/media/
/usr/lib/
458 extra_headers = { 'Content-type' : media_type }
459 response, content = self.root.
--> 460 url, in_representation, http_method, extra_headers=
461
462 if response.status == 201:
/usr/lib/
202 # Turn non-2xx responses into exceptions.
203 if response.status // 100 != 2:
--> 204 raise HTTPError(response, content)
205 return response, content
206
HTTPError: HTTP Error 500: Internal Server Error
-------
Response: {'connection': 'close',
'content-length': '10',
'content-type': 'text/plain',
'date': 'Thu, 11 Feb 2010 11:38:19 GMT',
'server': 'zope.server.http (HTTP)',
'status': '500',
'via': '1.1 wildcard.
'x-lazr-oopsid': 'OOPS-1503S125',
'x-powered-by': 'Zope (www.zope.org), Python (www.python.org)'}
Content: 'ValueError'
-------
I'm happy to fix this bug, if someone tells me what the "correct" solutions would look like
Related branches
- Abel Deuring (community): Approve (code)
-
Diff: 139 lines (+42/-9)4 files modifiedlib/lp/code/interfaces/branch.py (+9/-0)
lib/lp/code/model/branch.py (+2/-1)
lib/lp/code/stories/webservice/xx-branchmergeproposal.txt (+0/-1)
lib/lp/code/tests/test_branch_webservice.py (+31/-7)
Changed in launchpad-code: | |
status: | New → Triaged |
importance: | Undecided → High |
tags: | added: code-review oops |
Changed in launchpad: | |
importance: | High → Critical |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Markus,
I think that the API exposed method should do detailed checking, and give a verbose error message if it is bad. The only thing I'm not sure on is how to make it not OOPS, but instead to return a known error.