← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jml/launchpad/allow-upload-without-coc into lp:launchpad/devel

 

Jonathan Lange has proposed merging lp:~jml/launchpad/allow-upload-without-coc into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


PPA uploaders shouldn't need to sign the code of conduct. This branch makes it so.
-- 
https://code.launchpad.net/~jml/launchpad/allow-upload-without-coc/+merge/40218
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jml/launchpad/allow-upload-without-coc into lp:launchpad/devel.
=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py	2010-10-25 13:16:10 +0000
+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py	2010-11-05 17:57:49 +0000
@@ -65,8 +65,8 @@
         self.name16 = getUtility(IPersonSet).getByName("name16")
         beta_testers.addMember(self.name16, admin)
         # Pop the two messages notifying the team modification.
-        unused = stub.test_emails.pop()
-        unused = stub.test_emails.pop()
+        stub.test_emails.pop()
+        stub.test_emails.pop()
 
         # create name16 PPA
         self.name16_ppa = getUtility(IArchiveSet).new(
@@ -639,40 +639,6 @@
             pub_foocomm.sourcepackagerelease.component.name, 'partner')
         self.assertEqual(pub_foocomm.component.name, 'main')
 
-    def testUploadSignedByCodeOfConductNonSigner(self):
-        """Check if a CoC non-signer can upload to his PPA."""
-        self.name16.activesignatures[0].active = False
-        self.layer.commit()
-
-        upload_dir = self.queueUpload("bar_1.0-1", "~name16/ubuntu")
-        self.processUpload(self.uploadprocessor, upload_dir)
-
-        self.assertEqual(
-            self.uploadprocessor.last_processed_upload.rejection_message,
-            "PPA uploads must be signed by an Ubuntu Code of Conduct signer.")
-        self.assertTrue(self.name16.archive is not None)
-
-    def testUploadSignedByBetaTesterMember(self):
-        """Check if a non-member of launchpad-beta-testers can upload to PPA.
-
-        PPA was opened for public access in 1.1.11 (22th Nov 2007), so we will
-        keep this test as a simple reference to the check disabled in code
-        (uploadpolicy.py).
-        """
-        beta_testers = getUtility(
-            ILaunchpadCelebrities).launchpad_beta_testers
-        self.name16.leave(beta_testers)
-        # Pop the message notifying the membership modification.
-        run_mail_jobs()
-        unused = stub.test_emails.pop()
-
-        upload_dir = self.queueUpload("bar_1.0-1", "~name16/ubuntu")
-        self.processUpload(self.uploadprocessor, upload_dir)
-
-        self.assertEqual(
-            self.uploadprocessor.last_processed_upload.queue_root.status,
-            PackageUploadStatus.DONE)
-
     def testMixedUpload(self):
         """Mixed PPA uploads are rejected with a appropriate message."""
         upload_dir = self.queueUpload(
@@ -938,7 +904,7 @@
         self.processUpload(self.uploadprocessor, upload_dir)
         # Discard the announcement email and check the acceptance message
         # content.
-        announcement = stub.test_emails.pop()
+        stub.test_emails.pop()
 
         self.assertEqual(
             self.uploadprocessor.last_processed_upload.queue_root.status,
@@ -972,7 +938,7 @@
         # Create a fake "bar" package and publish it in section "web".
         publisher = SoyuzTestPublisher()
         publisher.prepareBreezyAutotest()
-        pub_src = publisher.getPubSource(
+        publisher.getPubSource(
             sourcename="bar", version="1.0-1", section="web",
             archive=self.name16_ppa, distroseries=self.breezy,
             status=PackagePublishingStatus.PUBLISHED)
@@ -1175,7 +1141,7 @@
         queue_item.setAccepted()
         queue_item.realiseUpload()
         self.layer.commit()
-        unused = stub.test_emails.pop()
+        stub.test_emails.pop()
 
         # Now upload a 3.0 (quilt) source with missing orig*.tar.* to a
         # PPA. All of the missing files will be retrieved from the
@@ -1328,7 +1294,7 @@
         publisher.prepareBreezyAutotest()
 
         # Publish To Breezy:
-        pub_bin1 = publisher.getPubBinaries(
+        publisher.getPubBinaries(
             archive=self.name16.archive, distroseries=self.breezy,
             status=PackagePublishingStatus.PUBLISHED)
 
@@ -1339,7 +1305,7 @@
         warty['i386'].addOrUpdateChroot(fake_chroot)
 
         # Publish To Warty:
-        pub_bin2 = publisher.getPubBinaries(
+        publisher.getPubBinaries(
             archive=self.name16.archive, distroseries=warty,
             status=PackagePublishingStatus.PUBLISHED)
 

=== modified file 'lib/lp/archiveuploader/uploadpolicy.py'
--- lib/lp/archiveuploader/uploadpolicy.py	2010-10-06 11:46:51 +0000
+++ lib/lp/archiveuploader/uploadpolicy.py	2010-11-05 17:57:49 +0000
@@ -214,26 +214,6 @@
         """Insecure policy allows PPA upload."""
         return False
 
-    def checkSignerIsUbuntuCodeOfConductSignee(self, upload):
-        """Reject the upload if not signed by an Ubuntu CoC signer."""
-        if not upload.changes.signer.is_ubuntu_coc_signer:
-            upload.reject(
-                'PPA uploads must be signed by an Ubuntu '
-                'Code of Conduct signer.')
-
-    def checkSignerIsBetaTester(self, upload):
-        """Reject the upload if the upload signer is not a 'beta-tester'.
-
-        For being a 'beta-tester' a person must be a valid member of
-        launchpad-beta-tester team/celebrity.
-        """
-        beta_testers = getUtility(
-            ILaunchpadCelebrities).launchpad_beta_testers
-        if not upload.changes.signer.inTeam(beta_testers):
-            upload.reject(
-                "PPA is only allowed for members of "
-                "launchpad-beta-testers team.")
-
     def checkArchiveSizeQuota(self, upload):
         """Reject the upload if target archive size quota will be exceeded.
 
@@ -277,17 +257,9 @@
         """The insecure policy does not allow SECURITY uploads for now.
 
         If the upload is targeted to any PPA, checks if the signer is an
-        Ubuntu Code of Conduct signer, and if so is a member of
-        'launchpad-beta-tests'.
+        Ubuntu Code of Conduct signer.
         """
         if upload.is_ppa:
-            # XXX cprov 2007-06-13: checks for PPA uploads are not yet
-            # established. We may decide for only one of the checks.  Either
-            # in a specific team or having an Ubuntu CoC signer (or similar
-            # flag). This code will be revisited before releasing PPA
-            # publicly.
-            self.checkSignerIsUbuntuCodeOfConductSignee(upload)
-            #self.checkSignerIsBetaTester(upload)
             self.checkArchiveSizeQuota(upload)
         else:
             if self.pocket == PackagePublishingPocket.SECURITY: