Merge lp:~jcsackett/launchpad/invalid-product-names into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Curtis Hovey on 2012-10-31 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 16224 |
| Proposed branch: | lp:~jcsackett/launchpad/invalid-product-names |
| Merge into: | lp:launchpad |
| Diff against target: |
132 lines (+24/-7) 8 files modified
lib/lp/code/model/tests/test_branchlookup.py (+1/-1) lib/lp/code/xmlrpc/branch.py (+1/-1) lib/lp/code/xmlrpc/codehosting.py (+6/-1) lib/lp/code/xmlrpc/tests/test_codehosting.py (+10/-0) lib/lp/codehosting/inmemory.py (+2/-0) lib/lp/codehosting/vfs/branchfs.py (+1/-1) lib/lp/xmlrpc/configure.zcml (+1/-1) lib/lp/xmlrpc/faults.py (+2/-2) |
| To merge this branch: | bzr merge lp:~jcsackett/launchpad/invalid-product-names |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Curtis Hovey (community) | code | 2012-10-31 | Approve on 2012-10-31 |
|
Review via email:
|
|||
Commit Message
Updates handling of InvalidProductName on bzr push to return an error message to the user rather than OOPSing.
Description of the Change
Summary
=======
When someone pushes to an invalid product name (i.e. one that doesn't satisfy
our name validation), an unexpected error is triggered.
We should just handle it as we do non-existant products and products you don't
have permission to post to, rather than OOPSing.
Preimp
======
Spoke with Curtis Hovey.
Implementation
==============
The InvalidProductName exception is now caught in a block that handles all the
other expected errors when getting branch information from the path. In its
place, an xmlrpc fault.InvalidPr
This is trapped and and returned as a PermissionDenied fault, as that is the
only fault that we return in order to avoid the bzr client being "clever" by
suggesting --create-prrefix or other solutions be tried.
Also: updated InvalidProductI
reason to have two separate names for the same error.
Tests were written, which required adding a clause to check if the product
name is valid an if not raise the expected error in the InMemory backend. I
confess I can't figure out the purpose of the inmemory backend, as it seems to
be a mock of some sort but we test everything directly against the db.
Tests
=====
bin/test -vvct test_createBran
QA
==
Attempt to push a branch to fiz:bar/trunk on qastaging. You should get back a
permission denied error about the branch being an invalid name, rather than an
unexpected error dump.
LoC
===
I have ~300 LoC of credit.
Lint
====
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/

Thank you.