Merge lp:~jelmer/launchpad/506256-remove-popen-2 into lp:launchpad
| Status: | Merged | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Approved by: | Jelmer Vernooij on 2010-09-16 | ||||||||
| Approved revision: | no longer in the source branch. | ||||||||
| Merged at revision: | 11579 | ||||||||
| Proposed branch: | lp:~jelmer/launchpad/506256-remove-popen-2 | ||||||||
| Merge into: | lp:launchpad | ||||||||
| Prerequisite: | lp:~jelmer/launchpad/506256-remove-popen | ||||||||
| Diff against target: |
1585 lines (+374/-273) 27 files modified
database/schema/security.cfg (+2/-0) lib/lp/archiveuploader/dscfile.py (+0/-29) lib/lp/archiveuploader/nascentupload.py (+31/-16) lib/lp/archiveuploader/nascentuploadfile.py (+59/-35) lib/lp/archiveuploader/tests/__init__.py (+5/-7) lib/lp/archiveuploader/tests/nascentupload.txt (+4/-5) lib/lp/archiveuploader/tests/test_buildduploads.py (+7/-8) lib/lp/archiveuploader/tests/test_nascentuploadfile.py (+61/-0) lib/lp/archiveuploader/tests/test_ppauploadprocessor.py (+11/-12) lib/lp/archiveuploader/tests/test_recipeuploads.py (+8/-12) lib/lp/archiveuploader/tests/test_uploadprocessor.py (+99/-30) lib/lp/archiveuploader/tests/uploadpolicy.txt (+1/-8) lib/lp/archiveuploader/uploadpolicy.py (+12/-14) lib/lp/archiveuploader/uploadprocessor.py (+16/-19) lib/lp/buildmaster/interfaces/packagebuild.py (+8/-4) lib/lp/buildmaster/model/packagebuild.py (+11/-2) lib/lp/buildmaster/tests/test_packagebuild.py (+1/-1) lib/lp/code/configure.zcml (+1/-5) lib/lp/code/model/sourcepackagerecipebuild.py (+4/-29) lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+6/-0) lib/lp/soyuz/doc/build-failedtoupload-workflow.txt (+2/-3) lib/lp/soyuz/doc/buildd-slavescanner.txt (+0/-3) lib/lp/soyuz/doc/distroseriesqueue-translations.txt (+3/-5) lib/lp/soyuz/doc/soyuz-set-of-uploads.txt (+3/-20) lib/lp/soyuz/model/binarypackagebuild.py (+4/-0) lib/lp/soyuz/scripts/soyuz_process_upload.py (+6/-6) lib/lp/soyuz/tests/test_binarypackagebuild.py (+9/-0) |
||||||||
| To merge this branch: | bzr merge lp:~jelmer/launchpad/506256-remove-popen-2 | ||||||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Nelson (community) | code | 2010-09-14 | Approve on 2010-09-16 |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2010-09-14.
Commit Message
Fix handling of source recipe builds when processing build uploads asynchronously.
Description of the Change
This MP actually has two prerequisites which both have been approved but not yet landed: lp:~jelmer/launchpad/506256-remove-popen and lp:~jelmer/launchpad/archiveuploader-build-handling. Since I can only set one as prerequisite I've set the first, since it's the biggest.
A bit of background: This branch is a followup to earlier work I did to make it possible for the builddmaster to no longer popen("
This branch fixes source package recipe build processing in the separate upload processor.
It does the following things:
* The separate upload policy for source package recipe builds has been merged into the overall buildd upload policy
* related, getUploader() is no longer on the upload policy but on the build class (it is different for binarypackagebuilds and recipe builds)
* Clean up the buildqueue record earlier so we don't keep the builder busy.
test:
./bin/test lp.buildmaster
./bin/test lp.archiveuploader
| Jelmer Vernooij (jelmer) wrote : | # |
| Michael Nelson (michael.nelson) wrote : | # |
Hi Jelmer,
r=me, assuming you check the following:
* to check: the db permissions - can we get rid of delete perms elsewhere),
* to fix: don't see why we need to use removeSecurityProxy in your test instead of a small update to the factory mothed),
* to check: regarding the actual diff - my local db-devel seems to already have some of these changes
Thanks!
> === modified file 'database/
> --- database/
> +++ database/
> @@ -1130,9 +1130,12 @@
> public.packagebuild = SELECT, INSERT, UPDATE
> public.
> public.
> -public.buildqueue = SELECT, INSERT, UPDATE
> -public.job = SELECT, INSERT, UPDATE
> -public.
> +public.
> +public.
> +public.buildqueue = SELECT, INSERT, UPDATE, DELETE
> +public.job = SELECT, INSERT, UPDATE, DELETE
> +public.
Right - so this is so the buildqueue record can be cleaned up earlier by the
uploader. Nice.
Should we be able to remove some DELETE perms elsewhere?
> +public.builder = SELECT
>
> # Thusly the librarian
> public.
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -498,10 +498,13 @@
> if self.binaryful:
> return
>
> - # Set up some convenient shortcut variables.
> -
> - uploader = self.policy.
> - archive = self.policy.archive
> + # The build can have an explicit uploader, which may be different
> + # from the changes file signer. (i.e in case of daily source package
> + # builds)
> + if build is not None:
> + uploader = build.getUpload
> + else:
> + uploader = self.changes.signer
This seems strange? do we not need archive any more? In db-devel it's used
straight afterwards, but I'm assuming you've changed that code in a previous
branch. And checking your full diff shows that is the case (you're using
policy.archive).
>
> # If we have no signer, there's no ACL we can apply.
> if uploader is None:
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -1884,7 +1884,7 @@
> self.assertLogC
> "Unable to find package build job with id 42. Skipping.")
>
> - def testNoFiles(self):
> + def testBinaryPacka
>...
| Jelmer Vernooij (jelmer) wrote : | # |
=== modified file 'database/
--- database/
+++ database/
@@ -1130,6 +1130,8 @@
public.
public.
public.
+public.
+public.
public.buildqueue = SELECT, INSERT, UPDATE
public.job = SELECT, INSERT, UPDATE
public.
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -498,10 +498,13 @@
if self.binaryful:
return
- # Set up some convenient shortcut variables.
-
- uploader = self.policy.
- archive = self.policy.archive
+ # The build can have an explicit uploader, which may be different
+ # from the changes file signer. (i.e in case of daily source package
+ # builds)
+ if build is not None:
+ uploader = build.getUpload
+ else:
+ uploader = self.changes.signer
# If we have no signer, there's no ACL we can apply.
if uploader is None:
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -42,7 +42,7 @@
- self.options.
+ self.options.
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -18,6 +18,7 @@
import tempfile
import traceback
+from storm.locals import Store
from zope.component import (
getGlobalS
getUtility,
@@ -1884,7 +1885,7 @@
- def testNoFiles(self):
+ def testBinaryPacka
# If the upload directory is empty, the upload
# will fail.
@@ -1908,6 +1909,8 @@
# Upload and accept a binary for the primary archive source.
+
+ # Commit so the build cookie has the right ids.
leaf_name = build.getUpload
@@ -1928,7 +1931,7 @@
in log_contents)
- def t...

=== modified file 'database/ schema/ security. cfg' schema/ security. cfg 2010-09-16 00:33:37 +0000 schema/ security. cfg 2010-09-16 09:04:13 +0000 packagebuild = SELECT, INSERT, UPDATE binarypackagebu ild = SELECT, INSERT, UPDATE sourcepackagere cipebuild = SELECT, UPDATE buildpackagejob = SELECT, INSERT, UPDATE sourcepackagere cipebuildjob = SELECT, UPDATE sourcepackagere cipe = SELECT, UPDATE buildpackagejob = SELECT, INSERT, UPDATE, DELETE
--- database/
+++ database/
@@ -1130,9 +1130,12 @@
public.
public.
public.
-public.buildqueue = SELECT, INSERT, UPDATE
-public.job = SELECT, INSERT, UPDATE
-public.
+public.
+public.
+public.buildqueue = SELECT, INSERT, UPDATE, DELETE
+public.job = SELECT, INSERT, UPDATE, DELETE
+public.
+public.builder = SELECT
# Thusly the librarian libraryfilecont ent = SELECT, INSERT
public.
=== modified file 'lib/lp/ archiveuploader /nascentupload. py' archiveuploader /nascentupload. py 2010-09-15 19:38:48 +0000 archiveuploader /nascentupload. py 2010-09-16 09:05:43 +0000
--- lib/lp/
+++ lib/lp/
@@ -498,10 +498,13 @@
if self.binaryful:
return
- # Set up some convenient shortcut variables. getUploader( self.changes, build) er(self. changes)
-
- uploader = self.policy.
- archive = self.policy.archive
+ # The build can have an explicit uploader, which may be different
+ # from the changes file signer. (i.e in case of daily source package
+ # builds)
+ if build is not None:
+ uploader = build.getUpload
+ else:
+ uploader = self.changes.signer
# If we have no signer, there's no ACL we can apply.
if uploader is None:
=== modified file 'lib/lp/ archiveuploader /tests/ test_recipeuplo ads.py' archiveuploader /tests/ test_recipeuplo ads.py 2010-09-16 09:02:57 +0000 archiveuploader /tests/ test_recipeuplo ads.py 2010-09-16 09:05:48 +0000
requester =self.recipe. owner)
--- lib/lp/
+++ lib/lp/
@@ -42,7 +42,7 @@
- self.options.
+ self.options.
=== modified file 'lib/lp/ archiveuploader /tests/ test_uploadproc essor.py' archiveuploader /tests/ test_uploadproc essor.py 2010-09-16 09:02:57 +0000 archiveuploader /tests/ test_uploadproc essor.py 2010-09-16 09:05:56 +0000
self. assertLogContai ns(
" Unable to find package build job with id 42. Skipping.")
--- lib/lp/
+++ lib/lp/
@@ -1884,7 +1884,7 @@
- def testNoFiles(self): geBuild_ fail(self) :
+ def testBinaryPacka
# If the upload directory is empty, the upload
# will fail.
@@ -1908,6 +1908,8 @@
# Upload and accept a binary for the primary archive source.
shutil. rmtree( upload_ dir)
self. layer.txn. commit( ) DirLeaf( build.getBuildC o...
+
+ # Commit so the build cookie has the right ids.
leaf_name = build.getUpload