← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jcsackett/launchpad/registry-errors-649836 into lp:launchpad/devel

 

j.c.sackett has proposed merging lp:~jcsackett/launchpad/registry-errors-649836 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #649836 Webservice related registry exception and error types should be collected in registry.errors
  https://bugs.launchpad.net/bugs/649836


Summary
=======

Cleans up the webservice exceptions in registry by moving them all to lp.registry.errors and registering that module with the webservice. This helps our ongoing efforts to get away from circular import problems and start moving things out of canonical.launchpad.interfaces

Proposed Fix
============

Create an lp.registry.errors module and move all exceptions with the webservice_error directive in them to this module. Register the new module in lp/registry/configure.zcml so they're not part of the mess in canonical/launchpad.


Pre-Implementation Talk
=======================

Spoke with Curtis Hovey about restricting the scope of the branch since there's substantially more we'll want to move into errors over time.


Implementation details
======================

As in proposed.

Tests
=====

bin/test -m lp.registry
bin/test -t webservice

Demo and Q/A
============

This is largely not demo-able; everything over the webservice should continue to work largely as it has, with the exception of a few changed error codes. (400 -> more specific errors)

Lint
====

make lint output:



= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/canonical/launchpad/testing/pages.py
  lib/lp/code/model/branchnamespace.py
  lib/lp/registry/errors.py
  lib/lp/registry/interfaces/distributionmirror.py
  lib/lp/registry/interfaces/person.py
  lib/lp/registry/interfaces/sourcepackagename.py
  lib/lp/registry/interfaces/teammembership.py
  lib/lp/registry/model/distribution.py
  lib/lp/registry/model/distributionmirror.py
  lib/lp/registry/model/person.py
  lib/lp/registry/model/sourcepackagename.py

./lib/canonical/launchpad/testing/pages.py
     460: E302 expected 2 blank lines, found 1
      96: Line contains a call to pdb.
./lib/lp/code/model/branchnamespace.py
     541: E301 expected 1 blank line, found 0
./lib/lp/registry/interfaces/distributionmirror.py
     163: Line exceeds 78 characters.
     169: Line exceeds 78 characters.
./lib/lp/registry/interfaces/person.py
     494: E302 expected 2 blank lines, found 1
./lib/lp/registry/model/distribution.py
    1254: E231 missing whitespace after ','
    1260: E231 missing whitespace after ','
    1272: E231 missing whitespace after ','
    1258: Line exceeds 78 characters.
./lib/lp/registry/model/distributionmirror.py
     589: E501 line too long (80 characters)
     455: Line exceeds 78 characters.
     473: Line exceeds 78 characters.
     589: Line exceeds 78 characters.
     807: Line exceeds 78 characters.
     860: Line exceeds 78 characters.
./lib/lp/registry/model/sourcepackagename.py
     148: W601 .has_key() is deprecated, use 'in'

This has touched so many files the lint output is all over the place; everything that's left is either lint complaining about valid things (e.g. commas in 1-tuples) or something I'm not sure should be altered. I have fixed everything that seems to related to my changes.
-- 
https://code.launchpad.net/~jcsackett/launchpad/registry-errors-649836/+merge/36994
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/registry-errors-649836 into lp:launchpad/devel.