← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~ajmitch/launchpad/prerelease-backports into lp:launchpad

 

Andrew Mitchell has proposed merging lp:~ajmitch/launchpad/prerelease-backports into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1050187 in Launchpad itself: "Backports pocket to be open for uploads prior to release"
  https://bugs.launchpad.net/launchpad/+bug/1050187

For more details, see:
https://code.launchpad.net/~ajmitch/launchpad/prerelease-backports/+merge/124100

Also allow uploads to the backports pocket when the series status is not CURRENT or SUPPORTED
-- 
https://code.launchpad.net/~ajmitch/launchpad/prerelease-backports/+merge/124100
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~ajmitch/launchpad/prerelease-backports into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/tests/test_uploadpolicy.py'
--- lib/lp/archiveuploader/tests/test_uploadpolicy.py	2012-08-22 17:06:08 +0000
+++ lib/lp/archiveuploader/tests/test_uploadpolicy.py	2012-09-13 05:00:30 +0000
@@ -249,6 +249,20 @@
         self.assertTrue(insecure_policy.autoApprove(
             make_fake_upload(is_ppa=True)))
 
+    def test_insecure_does_not_approve_backports_before_release(self):
+        # Uploads to the BACKPORTS pocket are approved by the insecure policy
+        self.setHoaryStatus(SeriesStatus.CURRENT)
+        insecure_policy = findPolicyByName("insecure")
+        insecure_policy.setOptions(FakeOptions(distroseries="hoary-backports"))
+        self.assertFalse(insecure_policy.autoApprove(make_fake_upload()))
+
+    def test_insecure_does_not_approve_backports_after_release(self):
+        # Uploads to the BACKPORTS pocket are approved by the insecure policy
+        self.setHoaryStatus(SeriesStatus.CURRENT)
+        insecure_policy = findPolicyByName("insecure")
+        insecure_policy.setOptions(FakeOptions(distroseries="hoary-backports"))
+        self.assertFalse(insecure_policy.autoApprove(make_fake_upload()))
+
     def test_buildd_does_not_approve_uefi(self):
         # Uploads to the primary archive containing UEFI custom files are
         # not approved.

=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py	2012-09-07 05:43:28 +0000
+++ lib/lp/soyuz/model/archive.py	2012-09-13 05:00:30 +0000
@@ -1267,6 +1267,7 @@
         pre_release_pockets = (
             PackagePublishingPocket.RELEASE,
             PackagePublishingPocket.PROPOSED,
+            PackagePublishingPocket.BACKPORTS,
             )
         if (pocket not in pre_release_pockets and
             distroseries.status not in stable_states):

=== modified file 'lib/lp/soyuz/tests/test_archive.py'
--- lib/lp/soyuz/tests/test_archive.py	2012-08-21 14:15:43 +0000
+++ lib/lp/soyuz/tests/test_archive.py	2012-09-13 05:00:30 +0000
@@ -621,6 +621,18 @@
             pocket=PackagePublishingPocket.PROPOSED,
             distroseries=distroseries)
 
+    def test_checkUpload_backports_development(self):
+        archive, distroseries = self.makeArchiveAndActiveDistroSeries(
+            purpose=ArchivePurpose.PRIMARY)
+        sourcepackagename = self.factory.makeSourcePackageName()
+        person = self.factory.makePerson()
+        removeSecurityProxy(archive).newPackageUploader(
+            person, sourcepackagename)
+        self.assertCanUpload(
+            archive, person, sourcepackagename,
+            pocket=PackagePublishingPocket.BACKPORTS,
+            distroseries=distroseries)
+
     def test_checkUpload_disabled_archive(self):
         archive, distroseries = self.makeArchiveAndActiveDistroSeries(
             purpose=ArchivePurpose.PRIMARY)


Follow ups