Merge lp:~laney/launchpad/add-sponsor-field-to-spph into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | j.c.sackett on 2012-01-19 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 14708 | ||||
| Proposed branch: | lp:~laney/launchpad/add-sponsor-field-to-spph | ||||
| Merge into: | lp:launchpad | ||||
| Prerequisite: | lp:~laney/launchpad/spph-sponsor | ||||
| Diff against target: |
322 lines (+82/-49) 5 files modified
lib/lp/soyuz/interfaces/publishing.py (+12/-1) lib/lp/soyuz/model/publishing.py (+10/-5) lib/lp/soyuz/scripts/packagecopier.py (+9/-4) lib/lp/soyuz/scripts/tests/test_copypackage.py (+50/-39) lib/lp/soyuz/stories/webservice/xx-source-package-publishing.txt (+1/-0) |
||||
| To merge this branch: | bzr merge lp:~laney/launchpad/add-sponsor-field-to-spph | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| j.c.sackett (community) | 2012-01-19 | Approve on 2012-01-19 | |
| Richard Harding (community) | code* | 2012-01-09 | Approve on 2012-01-19 |
|
Review via email:
|
|||
Commit Message
[r=jcsackett,
Description of the Change
If copyPackage is sponsored, save sponsor in SPPH.
== Test ==
bin/test -cvv -t test_copypackage -t publishing.txt -t archive.txt -t builds.txt
Total: 112 tests, 0 failures, 0 errors in 4 minutes 59.660 seconds.
== Demo and QA ==
Find a package which is newer in Debian than Ubuntu and copy it into Ubuntu using copyPackage and setting the sponsored field to some user. Ensure that the sponsor field of the resulting SPPH is set to your user.
== lint ==
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
1456: Line exceeds 78 characters.
1456: E501 line too long (82 characters)
make: *** [lint] Error 2
Preexisting and AFAICS not fixable as it is matching a string from an email.
| Steve Kowalik (stevenk) wrote : | # |
| Richard Harding (rharding) wrote : | # |
Can the test for test_sponsored_
Other than that, approving.
| j.c.sackett (jcsackett) wrote : | # |
This looks okay, but I really would like the duplicated boilerplate in the
tests handled.
One approach I would prefer to just mashing the tests together is in the diff
below.
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -1,4 +1,4 @@
> -# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
> +# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
> # GNU Affero General Public License version 3 (see the file LICENSE).
>
> __metaclass__ = type
> @@ -1526,6 +1526,30 @@
> 'Sponsored <email address hidden>', announcement[
> self.assertEqua
>
> + def test_sponsored_
> + # If it's a sponsored copy then the SPPH's sponsored field is set to
> + # the user who sponsored the copy.
> + archive = self.test_
> + source = self.test_
> + archive=archive, version='1.0-2', architecturehin
> + changelog = self.factory.
> + source.
> + # Copying to a primary archive reads the changes to close bugs.
> + transaction.
> + nobby = self.createNobb
> + getUtility(
> + nobby, SourcePackageFo
> + nobby.changeslist = '<email address hidden>'
> + sponsored_person = self.factory.
> + displayname=
> + [copied_source] = do_copy(
> + [source], archive, nobby, source.pocket, False,
> + person=
> + check_permissio
> + sponsored=
> + self.assertEqua
> + copied_
> +
> def test_copy_
> # When copying a package that generates a notification,
> # the changelog should contain all of the changelog_entry texts for
> @@ -1663,6 +1687,26 @@
> target_
> copied_
>
> + def test_unsponsore
> + # If the copy is not sponsored, SPPH.sponsor is none
> + archive = self.test_
> + source = self.test_
> + archive=archive, version='1.0-2', architecturehin
> + source.
> + nobby = self.createNobb
> + getUtility(
> + nobby, SourcePackageFo
> + target_archive = self.factory.
> + distribution=
| j.c.sackett (jcsackett) wrote : | # |
I note that this now removes several `changelog_entry = '* Foo!' lines, but it's been verified the tests all still pass.
This looks ok to land.

This can not land until the DB patch in lp:~laney/launchpad/spph-sponsor hits production.