Code review comment for lp:~bac/launchpad/bug-422128

Revision history for this message
Brad Crittenden (bac) wrote :

= Summary =

Originally it was noted in bug 422128 that changing the ownership of a product to a
private team failed if that product had any product releases owned by the original
owner of the product. That failure was because a ProductRelease could not be owned
by a private team and the view code was changing the ownership of the ProductRelease too.

Further investigation showed that the view code was changing product releases,
product series, and translation import queue entries that were owned by the old
product owner.

== Proposed fix ==

The first fix was to get the ownership reassignment out of the view and into the
model where it belongs. Being in the view meant that changing a product's owner via
the API wouldn't do the same artifact ownership reassignment.

Once that was done, changing ProductRelease and TranslationImportQueueEntry to allow
the owner and importer, respectively, to be a private team was straightforward.

The webservice tests for registry items was moved to the proper place under lp/registry.

== Pre-implementation notes ==

None.

== Implementation details ==

As above.

== Tests ==

bin/test -t private-team-roles.txt -t xx-project-registry.txt -t doc/product.txt

== Demo and Q/A ==

On launchpad.dev change the owner of firefox and ensure it works.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/interfaces/productrelease.py
  lib/lp/registry/model/productrelease.py
  lib/lp/registry/doc/private-team-roles.txt
  lib/lp/registry/doc/product.txt
  lib/lp/registry/browser/product.py
  lib/lp/translations/model/translationimportqueue.py
  lib/lp/testing/factory.py
  lib/lp/registry/tests/test_doc.py
  lib/lp/registry/stories/webservice/xx-project-registry.txt
  lib/lp/registry/model/product.py
  lib/lp/registry/model/milestone.py
  lib/lp/translations/interfaces/translationimportqueue.py

== Pylint notices ==

lib/lp/registry/interfaces/productrelease.py
    25: [F0401] Unable to import 'lazr.enum' (No module named enum)
    34: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
    35: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)
    36: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)

lib/lp/registry/browser/product.py
    56: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

lib/lp/registry/model/product.py
    29: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

lib/lp/translations/interfaces/translationimportqueue.py
    9: [F0401] Unable to import 'lazr.enum' (No module named enum)
    19: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)
    20: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
    21: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)

« Back to merge proposal