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

Proposed by Jonathan Lange
Status: Merged
Approved by: Māris Fogels
Approved revision: no longer in the source branch.
Merged at revision: 11894
Proposed branch: lp:~jml/launchpad/allow-upload-without-coc
Merge into: lp:launchpad
Diff against target: 152 lines (+9/-71)
2 files modified
lib/lp/archiveuploader/tests/test_ppauploadprocessor.py (+7/-41)
lib/lp/archiveuploader/uploadpolicy.py (+2/-30)
To merge this branch: bzr merge lp:~jml/launchpad/allow-upload-without-coc
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Review via email: mp+40218@code.launchpad.net

Description of the change

PPA uploaders shouldn't need to sign the code of conduct. This branch makes it so.

To post a comment you must log in.
Revision history for this message
Māris Fogels (mars) wrote :

Hi Jono,

This change looks great, r=mars. And you deserve bonus points for removing that XXX comment.

Maris

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
2--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2010-10-25 13:16:10 +0000
3+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2010-11-08 13:33:50 +0000
4@@ -65,8 +65,8 @@
5 self.name16 = getUtility(IPersonSet).getByName("name16")
6 beta_testers.addMember(self.name16, admin)
7 # Pop the two messages notifying the team modification.
8- unused = stub.test_emails.pop()
9- unused = stub.test_emails.pop()
10+ stub.test_emails.pop()
11+ stub.test_emails.pop()
12
13 # create name16 PPA
14 self.name16_ppa = getUtility(IArchiveSet).new(
15@@ -639,40 +639,6 @@
16 pub_foocomm.sourcepackagerelease.component.name, 'partner')
17 self.assertEqual(pub_foocomm.component.name, 'main')
18
19- def testUploadSignedByCodeOfConductNonSigner(self):
20- """Check if a CoC non-signer can upload to his PPA."""
21- self.name16.activesignatures[0].active = False
22- self.layer.commit()
23-
24- upload_dir = self.queueUpload("bar_1.0-1", "~name16/ubuntu")
25- self.processUpload(self.uploadprocessor, upload_dir)
26-
27- self.assertEqual(
28- self.uploadprocessor.last_processed_upload.rejection_message,
29- "PPA uploads must be signed by an Ubuntu Code of Conduct signer.")
30- self.assertTrue(self.name16.archive is not None)
31-
32- def testUploadSignedByBetaTesterMember(self):
33- """Check if a non-member of launchpad-beta-testers can upload to PPA.
34-
35- PPA was opened for public access in 1.1.11 (22th Nov 2007), so we will
36- keep this test as a simple reference to the check disabled in code
37- (uploadpolicy.py).
38- """
39- beta_testers = getUtility(
40- ILaunchpadCelebrities).launchpad_beta_testers
41- self.name16.leave(beta_testers)
42- # Pop the message notifying the membership modification.
43- run_mail_jobs()
44- unused = stub.test_emails.pop()
45-
46- upload_dir = self.queueUpload("bar_1.0-1", "~name16/ubuntu")
47- self.processUpload(self.uploadprocessor, upload_dir)
48-
49- self.assertEqual(
50- self.uploadprocessor.last_processed_upload.queue_root.status,
51- PackageUploadStatus.DONE)
52-
53 def testMixedUpload(self):
54 """Mixed PPA uploads are rejected with a appropriate message."""
55 upload_dir = self.queueUpload(
56@@ -938,7 +904,7 @@
57 self.processUpload(self.uploadprocessor, upload_dir)
58 # Discard the announcement email and check the acceptance message
59 # content.
60- announcement = stub.test_emails.pop()
61+ stub.test_emails.pop()
62
63 self.assertEqual(
64 self.uploadprocessor.last_processed_upload.queue_root.status,
65@@ -972,7 +938,7 @@
66 # Create a fake "bar" package and publish it in section "web".
67 publisher = SoyuzTestPublisher()
68 publisher.prepareBreezyAutotest()
69- pub_src = publisher.getPubSource(
70+ publisher.getPubSource(
71 sourcename="bar", version="1.0-1", section="web",
72 archive=self.name16_ppa, distroseries=self.breezy,
73 status=PackagePublishingStatus.PUBLISHED)
74@@ -1175,7 +1141,7 @@
75 queue_item.setAccepted()
76 queue_item.realiseUpload()
77 self.layer.commit()
78- unused = stub.test_emails.pop()
79+ stub.test_emails.pop()
80
81 # Now upload a 3.0 (quilt) source with missing orig*.tar.* to a
82 # PPA. All of the missing files will be retrieved from the
83@@ -1328,7 +1294,7 @@
84 publisher.prepareBreezyAutotest()
85
86 # Publish To Breezy:
87- pub_bin1 = publisher.getPubBinaries(
88+ publisher.getPubBinaries(
89 archive=self.name16.archive, distroseries=self.breezy,
90 status=PackagePublishingStatus.PUBLISHED)
91
92@@ -1339,7 +1305,7 @@
93 warty['i386'].addOrUpdateChroot(fake_chroot)
94
95 # Publish To Warty:
96- pub_bin2 = publisher.getPubBinaries(
97+ publisher.getPubBinaries(
98 archive=self.name16.archive, distroseries=warty,
99 status=PackagePublishingStatus.PUBLISHED)
100
101
102=== modified file 'lib/lp/archiveuploader/uploadpolicy.py'
103--- lib/lp/archiveuploader/uploadpolicy.py 2010-11-05 14:17:11 +0000
104+++ lib/lp/archiveuploader/uploadpolicy.py 2010-11-08 13:33:50 +0000
105@@ -215,26 +215,6 @@
106 """Insecure policy allows PPA upload."""
107 return False
108
109- def checkSignerIsUbuntuCodeOfConductSignee(self, upload):
110- """Reject the upload if not signed by an Ubuntu CoC signer."""
111- if not upload.changes.signer.is_ubuntu_coc_signer:
112- upload.reject(
113- 'PPA uploads must be signed by an Ubuntu '
114- 'Code of Conduct signer.')
115-
116- def checkSignerIsBetaTester(self, upload):
117- """Reject the upload if the upload signer is not a 'beta-tester'.
118-
119- For being a 'beta-tester' a person must be a valid member of
120- launchpad-beta-tester team/celebrity.
121- """
122- beta_testers = getUtility(
123- ILaunchpadCelebrities).launchpad_beta_testers
124- if not upload.changes.signer.inTeam(beta_testers):
125- upload.reject(
126- "PPA is only allowed for members of "
127- "launchpad-beta-testers team.")
128-
129 def checkArchiveSizeQuota(self, upload):
130 """Reject the upload if target archive size quota will be exceeded.
131
132@@ -277,18 +257,10 @@
133 def policySpecificChecks(self, upload):
134 """The insecure policy does not allow SECURITY uploads for now.
135
136- If the upload is targeted to any PPA, checks if the signer is an
137- Ubuntu Code of Conduct signer, and if so is a member of
138- 'launchpad-beta-tests'.
139+ If the upload is targeted to any PPA, checks if the upload is within
140+ the allowed quota.
141 """
142 if upload.is_ppa:
143- # XXX cprov 2007-06-13: checks for PPA uploads are not yet
144- # established. We may decide for only one of the checks. Either
145- # in a specific team or having an Ubuntu CoC signer (or similar
146- # flag). This code will be revisited before releasing PPA
147- # publicly.
148- self.checkSignerIsUbuntuCodeOfConductSignee(upload)
149- #self.checkSignerIsBetaTester(upload)
150 self.checkArchiveSizeQuota(upload)
151 else:
152 if self.pocket == PackagePublishingPocket.SECURITY: