Merge lp:~michael.nelson/launchpad/506292-binarypackagebuild-rename into lp:launchpad
- 506292-binarypackagebuild-rename
- Merge into devel
Proposed by
Michael Nelson
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Julian Edwards | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~michael.nelson/launchpad/506292-binarypackagebuild-rename | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
3064 lines (+446/-381) 64 files modified
lib/canonical/launchpad/database/__init__.py (+1/-1) lib/canonical/launchpad/interfaces/__init__.py (+1/-1) lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+4/-3) lib/canonical/launchpad/security.py (+9/-7) lib/canonical/launchpad/webapp/configure.zcml (+2/-2) lib/lp/archiveuploader/nascentuploadfile.py (+2/-2) lib/lp/archiveuploader/tests/test_securityuploads.py (+3/-3) lib/lp/buildmaster/doc/buildqueue.txt (+11/-11) lib/lp/buildmaster/model/builder.py (+8/-8) lib/lp/buildmaster/tests/test_builder.py (+8/-8) lib/lp/buildmaster/tests/test_buildqueue.py (+5/-5) lib/lp/buildmaster/tests/test_manager.py (+6/-6) lib/lp/registry/browser/person.py (+2/-2) lib/lp/registry/model/distribution.py (+9/-7) lib/lp/registry/model/distroseries.py (+4/-3) lib/lp/registry/model/sourcepackage.py (+4/-3) lib/lp/soyuz/browser/archive.py (+3/-2) lib/lp/soyuz/browser/build.py (+17/-14) lib/lp/soyuz/browser/builder.py (+2/-2) lib/lp/soyuz/browser/configure.zcml (+5/-5) lib/lp/soyuz/browser/distributionsourcepackagerelease.py (+3/-3) lib/lp/soyuz/browser/publishing.py (+1/-1) lib/lp/soyuz/browser/tests/archive-views.txt (+4/-2) lib/lp/soyuz/browser/tests/builder-views.txt (+3/-2) lib/lp/soyuz/configure.zcml (+14/-13) lib/lp/soyuz/doc/build-estimated-dispatch-time.txt (+3/-2) lib/lp/soyuz/doc/build-failedtoupload-workflow.txt (+3/-2) lib/lp/soyuz/doc/build-notification.txt (+7/-5) lib/lp/soyuz/doc/build.txt (+36/-34) lib/lp/soyuz/doc/buildd-dispatching.txt (+5/-4) lib/lp/soyuz/doc/buildd-scoring.txt (+3/-2) lib/lp/soyuz/doc/buildd-slavescanner.txt (+24/-19) lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt (+3/-3) lib/lp/soyuz/doc/gina-multiple-arch.txt (+4/-4) lib/lp/soyuz/doc/gina.txt (+4/-4) lib/lp/soyuz/doc/queuebuilder.txt (+10/-7) lib/lp/soyuz/doc/sourcepackagerelease.txt (+2/-2) lib/lp/soyuz/doc/soyuz-set-of-uploads.txt (+6/-5) lib/lp/soyuz/interfaces/binarypackagebuild.py (+12/-10) lib/lp/soyuz/interfaces/buildfarmbuildjob.py (+2/-2) lib/lp/soyuz/interfaces/buildpackagejob.py (+2/-2) lib/lp/soyuz/model/archive.py (+18/-15) lib/lp/soyuz/model/binarypackagebuild.py (+47/-41) lib/lp/soyuz/model/binarypackagerelease.py (+2/-1) lib/lp/soyuz/model/buildpackagejob.py (+3/-3) lib/lp/soyuz/model/distributionsourcepackagerelease.py (+10/-8) lib/lp/soyuz/model/distroarchseries.py (+4/-3) lib/lp/soyuz/model/publishedpackage.py (+1/-1) lib/lp/soyuz/model/publishing.py (+40/-31) lib/lp/soyuz/model/queue.py (+1/-1) lib/lp/soyuz/model/sourcepackagerelease.py (+5/-5) lib/lp/soyuz/scripts/buildd.py (+7/-5) lib/lp/soyuz/scripts/gina/handlers.py (+3/-3) lib/lp/soyuz/scripts/packagecopier.py (+1/-1) lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py (+4/-4) lib/lp/soyuz/scripts/tests/test_copypackage.py (+2/-3) lib/lp/soyuz/scripts/tests/test_populatearchive.py (+6/-5) lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt (+4/-2) lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt (+3/-2) lib/lp/soyuz/stories/soyuz/xx-build-record.txt (+4/-2) lib/lp/soyuz/stories/webservice/xx-builds.txt (+7/-6) lib/lp/soyuz/tests/test_archive.py (+2/-2) lib/lp/soyuz/tests/test_build.py (+13/-12) lib/lp/soyuz/tests/test_buildpackagejob.py (+2/-2) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/launchpad/506292-binarypackagebuild-rename | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | code rs | Approve | |
Canonical Launchpad Engineering | Pending | ||
Review via email: mp+23226@code.launchpad.net |
Commit message
Rename soyuz's Build class (and interface/sets) to BinaryPackageBuild.
Description of the change
This branch renames the soyuz Build class (and it's interfaces, sets) to BinaryPackageBuild.
It ensures that the API resource_type is still #build for the moment just to ensure there are no changes to the API.
I'm not expecting a normal review, but bigjools will take a quick look and rs it if he's happy with it.
To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote : | # |
review:
Approve
(code rs)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/database/__init__.py' | |||
2 | --- lib/canonical/launchpad/database/__init__.py 2010-03-05 13:52:32 +0000 | |||
3 | +++ lib/canonical/launchpad/database/__init__.py 2010-04-13 06:59:32 +0000 | |||
4 | @@ -20,7 +20,7 @@ | |||
5 | 20 | from lp.soyuz.model.distroarchseriesbinarypackage import * | 20 | from lp.soyuz.model.distroarchseriesbinarypackage import * |
6 | 21 | from lp.soyuz.model.distroarchseriesbinarypackagerelease import * | 21 | from lp.soyuz.model.distroarchseriesbinarypackagerelease import * |
7 | 22 | from lp.soyuz.model.processor import * | 22 | from lp.soyuz.model.processor import * |
9 | 23 | from lp.soyuz.model.build import * | 23 | from lp.soyuz.model.binarypackagebuild import * |
10 | 24 | from lp.buildmaster.model.builder import * | 24 | from lp.buildmaster.model.builder import * |
11 | 25 | from lp.soyuz.model.publishing import * | 25 | from lp.soyuz.model.publishing import * |
12 | 26 | from lp.soyuz.model.files import * | 26 | from lp.soyuz.model.files import * |
13 | 27 | 27 | ||
14 | === modified file 'lib/canonical/launchpad/interfaces/__init__.py' | |||
15 | --- lib/canonical/launchpad/interfaces/__init__.py 2010-03-05 13:52:32 +0000 | |||
16 | +++ lib/canonical/launchpad/interfaces/__init__.py 2010-04-13 06:59:32 +0000 | |||
17 | @@ -42,7 +42,7 @@ | |||
18 | 42 | from lp.bugs.interfaces.bugtarget import * | 42 | from lp.bugs.interfaces.bugtarget import * |
19 | 43 | from lp.bugs.interfaces.bugtracker import * | 43 | from lp.bugs.interfaces.bugtracker import * |
20 | 44 | from lp.bugs.interfaces.bugwatch import * | 44 | from lp.bugs.interfaces.bugwatch import * |
22 | 45 | from lp.soyuz.interfaces.build import * | 45 | from lp.soyuz.interfaces.binarypackagebuild import * |
23 | 46 | from lp.buildmaster.interfaces.builder import * | 46 | from lp.buildmaster.interfaces.builder import * |
24 | 47 | from lp.soyuz.interfaces.buildrecords import * | 47 | from lp.soyuz.interfaces.buildrecords import * |
25 | 48 | from lp.registry.interfaces.codeofconduct import * | 48 | from lp.registry.interfaces.codeofconduct import * |
26 | 49 | 49 | ||
27 | === modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py' | |||
28 | --- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-04-06 20:17:04 +0000 | |||
29 | +++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-04-13 06:59:32 +0000 | |||
30 | @@ -32,7 +32,7 @@ | |||
31 | 32 | from lp.bugs.interfaces.bugtracker import IBugTracker | 32 | from lp.bugs.interfaces.bugtracker import IBugTracker |
32 | 33 | from lp.bugs.interfaces.bugwatch import IBugWatch | 33 | from lp.bugs.interfaces.bugwatch import IBugWatch |
33 | 34 | from lp.buildmaster.interfaces.buildbase import BuildStatus | 34 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
35 | 35 | from lp.soyuz.interfaces.build import IBuild | 35 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
36 | 36 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 36 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
37 | 37 | from lp.blueprints.interfaces.specification import ISpecification | 37 | from lp.blueprints.interfaces.specification import ISpecification |
38 | 38 | from lp.blueprints.interfaces.specificationbranch import ( | 38 | from lp.blueprints.interfaces.specificationbranch import ( |
39 | @@ -165,7 +165,7 @@ | |||
40 | 165 | 'params']['build_state'].vocabulary = BuildStatus | 165 | 'params']['build_state'].vocabulary = BuildStatus |
41 | 166 | IHasBuildRecords['getBuildRecords'].queryTaggedValue( | 166 | IHasBuildRecords['getBuildRecords'].queryTaggedValue( |
42 | 167 | LAZR_WEBSERVICE_EXPORTED)[ | 167 | LAZR_WEBSERVICE_EXPORTED)[ |
44 | 168 | 'return_type'].value_type.schema = IBuild | 168 | 'return_type'].value_type.schema = IBinaryPackageBuild |
45 | 169 | 169 | ||
46 | 170 | ISourcePackage['distroseries'].schema = IDistroSeries | 170 | ISourcePackage['distroseries'].schema = IDistroSeries |
47 | 171 | ISourcePackage['productseries'].schema = IProductSeries | 171 | ISourcePackage['productseries'].schema = IProductSeries |
48 | @@ -185,7 +185,8 @@ | |||
49 | 185 | 185 | ||
50 | 186 | # publishing.py | 186 | # publishing.py |
51 | 187 | ISourcePackagePublishingHistoryPublic['getBuilds'].queryTaggedValue( | 187 | ISourcePackagePublishingHistoryPublic['getBuilds'].queryTaggedValue( |
53 | 188 | LAZR_WEBSERVICE_EXPORTED)['return_type'].value_type.schema = IBuild | 188 | LAZR_WEBSERVICE_EXPORTED)['return_type'].value_type.schema = ( |
54 | 189 | IBinaryPackageBuild) | ||
55 | 189 | ISourcePackagePublishingHistoryPublic[ | 190 | ISourcePackagePublishingHistoryPublic[ |
56 | 190 | 'getPublishedBinaries'].queryTaggedValue( | 191 | 'getPublishedBinaries'].queryTaggedValue( |
57 | 191 | LAZR_WEBSERVICE_EXPORTED)[ | 192 | LAZR_WEBSERVICE_EXPORTED)[ |
58 | 192 | 193 | ||
59 | === modified file 'lib/canonical/launchpad/security.py' | |||
60 | --- lib/canonical/launchpad/security.py 2010-03-25 08:48:14 +0000 | |||
61 | +++ lib/canonical/launchpad/security.py 2010-04-13 06:59:32 +0000 | |||
62 | @@ -73,7 +73,7 @@ | |||
63 | 73 | from lp.translations.interfaces.potemplate import IPOTemplate | 73 | from lp.translations.interfaces.potemplate import IPOTemplate |
64 | 74 | from lp.soyuz.interfaces.binarypackagerelease import ( | 74 | from lp.soyuz.interfaces.binarypackagerelease import ( |
65 | 75 | IBinaryPackageReleaseDownloadCount) | 75 | IBinaryPackageReleaseDownloadCount) |
67 | 76 | from lp.soyuz.interfaces.build import IBuild | 76 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
68 | 77 | from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob | 77 | from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob |
69 | 78 | from lp.soyuz.interfaces.publishing import ( | 78 | from lp.soyuz.interfaces.publishing import ( |
70 | 79 | IBinaryPackagePublishingHistory, IPublishingEdit, | 79 | IBinaryPackagePublishingHistory, IPublishingEdit, |
71 | @@ -1436,12 +1436,12 @@ | |||
72 | 1436 | 1436 | ||
73 | 1437 | 1437 | ||
74 | 1438 | class AdminBuildRecord(AdminByBuilddAdmin): | 1438 | class AdminBuildRecord(AdminByBuilddAdmin): |
76 | 1439 | usedfor = IBuild | 1439 | usedfor = IBinaryPackageBuild |
77 | 1440 | 1440 | ||
78 | 1441 | 1441 | ||
79 | 1442 | class EditBuildRecord(AdminByBuilddAdmin): | 1442 | class EditBuildRecord(AdminByBuilddAdmin): |
80 | 1443 | permission = 'launchpad.Edit' | 1443 | permission = 'launchpad.Edit' |
82 | 1444 | usedfor = IBuild | 1444 | usedfor = IBinaryPackageBuild |
83 | 1445 | 1445 | ||
84 | 1446 | def checkAuthenticated(self, user): | 1446 | def checkAuthenticated(self, user): |
85 | 1447 | """Check write access for user and different kinds of archives. | 1447 | """Check write access for user and different kinds of archives. |
86 | @@ -1476,8 +1476,9 @@ | |||
87 | 1476 | class ViewBuildRecord(EditBuildRecord): | 1476 | class ViewBuildRecord(EditBuildRecord): |
88 | 1477 | permission = 'launchpad.View' | 1477 | permission = 'launchpad.View' |
89 | 1478 | 1478 | ||
92 | 1479 | # This code MUST match the logic in IBuildSet.getBuildsForBuilder() | 1479 | # This code MUST match the logic in |
93 | 1480 | # otherwise users are likely to get 403 errors, or worse. | 1480 | # IBinaryPackageBuildSet.getBuildsForBuilder() otherwise users are |
94 | 1481 | # likely to get 403 errors, or worse. | ||
95 | 1481 | def checkAuthenticated(self, user): | 1482 | def checkAuthenticated(self, user): |
96 | 1482 | """Private restricts to admins and archive members.""" | 1483 | """Private restricts to admins and archive members.""" |
97 | 1483 | if not self.obj.archive.private: | 1484 | if not self.obj.archive.private: |
98 | @@ -1518,7 +1519,7 @@ | |||
99 | 1518 | """Permission to view an `IBuildFarmJob`. | 1519 | """Permission to view an `IBuildFarmJob`. |
100 | 1519 | 1520 | ||
101 | 1520 | This permission is based entirely on permission to view the | 1521 | This permission is based entirely on permission to view the |
103 | 1521 | associated `IBuild` and/or `IBranch`. | 1522 | associated `IBinaryPackageBuild` and/or `IBranch`. |
104 | 1522 | """ | 1523 | """ |
105 | 1523 | permission = 'launchpad.View' | 1524 | permission = 'launchpad.View' |
106 | 1524 | usedfor = IBuildFarmJob | 1525 | usedfor = IBuildFarmJob |
107 | @@ -2176,7 +2177,8 @@ | |||
108 | 2176 | usedfor = IBinaryPackagePublishingHistory | 2177 | usedfor = IBinaryPackagePublishingHistory |
109 | 2177 | 2178 | ||
110 | 2178 | 2179 | ||
112 | 2179 | class ViewBinaryPackageReleaseDownloadCount(ViewSourcePackagePublishingHistory): | 2180 | class ViewBinaryPackageReleaseDownloadCount( |
113 | 2181 | ViewSourcePackagePublishingHistory): | ||
114 | 2180 | """Restrict viewing of binary package download counts.""" | 2182 | """Restrict viewing of binary package download counts.""" |
115 | 2181 | usedfor = IBinaryPackageReleaseDownloadCount | 2183 | usedfor = IBinaryPackageReleaseDownloadCount |
116 | 2182 | 2184 | ||
117 | 2183 | 2185 | ||
118 | === modified file 'lib/canonical/launchpad/webapp/configure.zcml' | |||
119 | --- lib/canonical/launchpad/webapp/configure.zcml 2010-03-23 19:07:44 +0000 | |||
120 | +++ lib/canonical/launchpad/webapp/configure.zcml 2010-04-13 06:59:32 +0000 | |||
121 | @@ -62,7 +62,7 @@ | |||
122 | 62 | <!-- lazr.batchnavigator hook --> | 62 | <!-- lazr.batchnavigator hook --> |
123 | 63 | <adapter | 63 | <adapter |
124 | 64 | factory='.batching.FiniteSequenceAdapter' /> | 64 | factory='.batching.FiniteSequenceAdapter' /> |
126 | 65 | 65 | ||
127 | 66 | <adapter | 66 | <adapter |
128 | 67 | factory='.batching.FiniteSequenceAdapter' | 67 | factory='.batching.FiniteSequenceAdapter' |
129 | 68 | for='storm.zope.interfaces.ISQLObjectResultSet' /> | 68 | for='storm.zope.interfaces.ISQLObjectResultSet' /> |
130 | @@ -216,7 +216,7 @@ | |||
131 | 216 | /> | 216 | /> |
132 | 217 | 217 | ||
133 | 218 | <adapter | 218 | <adapter |
135 | 219 | for="lp.soyuz.interfaces.build.IBuild" | 219 | for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
136 | 220 | provides="zope.traversing.interfaces.IPathAdapter" | 220 | provides="zope.traversing.interfaces.IPathAdapter" |
137 | 221 | factory="canonical.launchpad.webapp.tales.BuildImageDisplayAPI" | 221 | factory="canonical.launchpad.webapp.tales.BuildImageDisplayAPI" |
138 | 222 | name="image" | 222 | name="image" |
139 | 223 | 223 | ||
140 | === modified file 'lib/lp/archiveuploader/nascentuploadfile.py' | |||
141 | --- lib/lp/archiveuploader/nascentuploadfile.py 2010-03-06 04:57:40 +0000 | |||
142 | +++ lib/lp/archiveuploader/nascentuploadfile.py 2010-04-13 06:59:32 +0000 | |||
143 | @@ -39,7 +39,7 @@ | |||
144 | 39 | IBinaryPackageNameSet) | 39 | IBinaryPackageNameSet) |
145 | 40 | from lp.soyuz.interfaces.binarypackagerelease import ( | 40 | from lp.soyuz.interfaces.binarypackagerelease import ( |
146 | 41 | BinaryPackageFormat) | 41 | BinaryPackageFormat) |
148 | 42 | from lp.soyuz.interfaces.build import IBuildSet | 42 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
149 | 43 | from lp.soyuz.interfaces.component import IComponentSet | 43 | from lp.soyuz.interfaces.component import IComponentSet |
150 | 44 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet | 44 | from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet |
151 | 45 | from lp.soyuz.interfaces.queue import ( | 45 | from lp.soyuz.interfaces.queue import ( |
152 | @@ -817,7 +817,7 @@ | |||
153 | 817 | status=BuildStatus.FULLYBUILT) | 817 | status=BuildStatus.FULLYBUILT) |
154 | 818 | self.logger.debug("Build %s created" % build.id) | 818 | self.logger.debug("Build %s created" % build.id) |
155 | 819 | else: | 819 | else: |
157 | 820 | build = getUtility(IBuildSet).getByBuildID(build_id) | 820 | build = getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
158 | 821 | self.logger.debug("Build %s found" % build.id) | 821 | self.logger.debug("Build %s found" % build.id) |
159 | 822 | # Ensure gathered binary is related to a FULLYBUILT build | 822 | # Ensure gathered binary is related to a FULLYBUILT build |
160 | 823 | # record. It will be check in slave-scanner procedure to | 823 | # record. It will be check in slave-scanner procedure to |
161 | 824 | 824 | ||
162 | === modified file 'lib/lp/archiveuploader/tests/test_securityuploads.py' | |||
163 | --- lib/lp/archiveuploader/tests/test_securityuploads.py 2010-01-07 06:29:36 +0000 | |||
164 | +++ lib/lp/archiveuploader/tests/test_securityuploads.py 2010-04-13 06:59:32 +0000 | |||
165 | @@ -14,7 +14,7 @@ | |||
166 | 14 | TestUploadProcessorBase) | 14 | TestUploadProcessorBase) |
167 | 15 | from lp.archiveuploader.uploadprocessor import UploadProcessor | 15 | from lp.archiveuploader.uploadprocessor import UploadProcessor |
168 | 16 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 16 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
170 | 17 | from lp.soyuz.model.build import Build | 17 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
171 | 18 | from lp.soyuz.model.processor import ProcessorFamily | 18 | from lp.soyuz.model.processor import ProcessorFamily |
172 | 19 | from canonical.launchpad.interfaces import ( | 19 | from canonical.launchpad.interfaces import ( |
173 | 20 | IDistributionSet, PackageUploadStatus) | 20 | IDistributionSet, PackageUploadStatus) |
174 | @@ -73,7 +73,7 @@ | |||
175 | 73 | # Set up the uploadprocessor with appropriate options and logger | 73 | # Set up the uploadprocessor with appropriate options and logger |
176 | 74 | self.uploadprocessor = UploadProcessor( | 74 | self.uploadprocessor = UploadProcessor( |
177 | 75 | self.options, self.layer.txn, self.log) | 75 | self.options, self.layer.txn, self.log) |
179 | 76 | self.builds_before_upload = Build.select().count() | 76 | self.builds_before_upload = BinaryPackageBuild.select().count() |
180 | 77 | self.source_queue = None | 77 | self.source_queue = None |
181 | 78 | self._uploadSource() | 78 | self._uploadSource() |
182 | 79 | self.log.lines = [] | 79 | self.log.lines = [] |
183 | @@ -81,7 +81,7 @@ | |||
184 | 81 | 81 | ||
185 | 82 | def assertBuildsCreated(self, amount): | 82 | def assertBuildsCreated(self, amount): |
186 | 83 | """Assert that a given 'amount' of build records was created.""" | 83 | """Assert that a given 'amount' of build records was created.""" |
188 | 84 | builds_count = Build.select().count() | 84 | builds_count = BinaryPackageBuild.select().count() |
189 | 85 | self.assertEqual( | 85 | self.assertEqual( |
190 | 86 | self.builds_before_upload + amount, builds_count) | 86 | self.builds_before_upload + amount, builds_count) |
191 | 87 | 87 | ||
192 | 88 | 88 | ||
193 | === modified file 'lib/lp/buildmaster/doc/buildqueue.txt' | |||
194 | --- lib/lp/buildmaster/doc/buildqueue.txt 2010-03-07 04:06:22 +0000 | |||
195 | +++ lib/lp/buildmaster/doc/buildqueue.txt 2010-04-13 06:59:32 +0000 | |||
196 | @@ -31,8 +31,8 @@ | |||
197 | 31 | The IBuild record related to this job is provided by the 'build' | 31 | The IBuild record related to this job is provided by the 'build' |
198 | 32 | attribute: | 32 | attribute: |
199 | 33 | 33 | ||
202 | 34 | >>> from lp.soyuz.interfaces.build import IBuildSet | 34 | >>> from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
203 | 35 | >>> build = getUtility(IBuildSet).getByQueueEntry(bq) | 35 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
204 | 36 | >>> build.id | 36 | >>> build.id |
205 | 37 | 8 | 37 | 8 |
206 | 38 | >>> build.buildstate.name | 38 | >>> build.buildstate.name |
207 | @@ -124,7 +124,7 @@ | |||
208 | 124 | True | 124 | True |
209 | 125 | >>> print job.logtail | 125 | >>> print job.logtail |
210 | 126 | Dummy sampledata entry, not processing | 126 | Dummy sampledata entry, not processing |
212 | 127 | >>> build = getUtility(IBuildSet).getByQueueEntry(job) | 127 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
213 | 128 | >>> print build.buildstate.name | 128 | >>> print build.buildstate.name |
214 | 129 | BUILDING | 129 | BUILDING |
215 | 130 | >>> print job.lastscore | 130 | >>> print job.lastscore |
216 | @@ -255,8 +255,8 @@ | |||
217 | 255 | Note that the results are ordered by descending BuildQueue.lastscore | 255 | Note that the results are ordered by descending BuildQueue.lastscore |
218 | 256 | and restricted | 256 | and restricted |
219 | 257 | 257 | ||
222 | 258 | >>> for bq in getUtility(IBuildSet).calculateCandidates(archseries): | 258 | >>> for bq in getUtility(IBinaryPackageBuildSet).calculateCandidates(archseries): |
223 | 259 | ... build = getUtility(IBuildSet).getByQueueEntry(bq) | 259 | ... build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
224 | 260 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) | 260 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) |
225 | 261 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) | 261 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) |
226 | 262 | i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2) | 262 | i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2) |
227 | @@ -287,8 +287,8 @@ | |||
228 | 287 | The fake language pack will be queued behind the other source packages | 287 | The fake language pack will be queued behind the other source packages |
229 | 288 | as intended. | 288 | as intended. |
230 | 289 | 289 | ||
233 | 290 | >>> for bq in getUtility(IBuildSet).calculateCandidates(archseries): | 290 | >>> for bq in getUtility(IBinaryPackageBuildSet).calculateCandidates(archseries): |
234 | 291 | ... build = getUtility(IBuildSet).getByQueueEntry(bq) | 291 | ... build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
235 | 292 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) | 292 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) |
236 | 293 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) | 293 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) |
237 | 294 | i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2) | 294 | i386 build of alsa-utils 1.0.9a-4ubuntu1 in ubuntu hoary RELEASE (1000, 2) |
238 | @@ -299,8 +299,8 @@ | |||
239 | 299 | Restricting the domain to only hoary/hppa: | 299 | Restricting the domain to only hoary/hppa: |
240 | 300 | 300 | ||
241 | 301 | >>> archseries = [hoary['hppa']] | 301 | >>> archseries = [hoary['hppa']] |
244 | 302 | >>> for bq in getUtility(IBuildSet).calculateCandidates(archseries): | 302 | >>> for bq in getUtility(IBinaryPackageBuildSet).calculateCandidates(archseries): |
245 | 303 | ... build = getUtility(IBuildSet).getByQueueEntry(bq) | 303 | ... build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bq) |
246 | 304 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) | 304 | ... print "%s (%s, %d)" % (build.title, bq.lastscore, bq.id) |
247 | 305 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) | 305 | hppa build of pmount 0.1-2 in ubuntu hoary RELEASE (1500, 4) |
248 | 306 | hppa build of alsa-utils 1.0.9a-4 in ubuntu hoary RELEASE (500, 3) | 306 | hppa build of alsa-utils 1.0.9a-4 in ubuntu hoary RELEASE (500, 3) |
249 | @@ -308,12 +308,12 @@ | |||
250 | 308 | This method asserts a valid 'archseries' argument, None or an empty | 308 | This method asserts a valid 'archseries' argument, None or an empty |
251 | 309 | list will result in a AssertionFailure. | 309 | list will result in a AssertionFailure. |
252 | 310 | 310 | ||
254 | 311 | >>> getUtility(IBuildSet).calculateCandidates(None).count() | 311 | >>> getUtility(IBinaryPackageBuildSet).calculateCandidates(None).count() |
255 | 312 | Traceback (most recent call last): | 312 | Traceback (most recent call last): |
256 | 313 | ... | 313 | ... |
257 | 314 | AssertionError: Given 'archseries' cannot be None/empty. | 314 | AssertionError: Given 'archseries' cannot be None/empty. |
258 | 315 | 315 | ||
260 | 316 | >>> getUtility(IBuildSet).calculateCandidates([]).count() | 316 | >>> getUtility(IBinaryPackageBuildSet).calculateCandidates([]).count() |
261 | 317 | Traceback (most recent call last): | 317 | Traceback (most recent call last): |
262 | 318 | ... | 318 | ... |
263 | 319 | AssertionError: Given 'archseries' cannot be None/empty. | 319 | AssertionError: Given 'archseries' cannot be None/empty. |
264 | 320 | 320 | ||
265 | === modified file 'lib/lp/buildmaster/model/builder.py' | |||
266 | --- lib/lp/buildmaster/model/builder.py 2010-04-12 05:52:01 +0000 | |||
267 | +++ lib/lp/buildmaster/model/builder.py 2010-04-13 06:59:32 +0000 | |||
268 | @@ -55,7 +55,7 @@ | |||
269 | 55 | # XXX Michael Nelson 2010-01-13 bug=491330 | 55 | # XXX Michael Nelson 2010-01-13 bug=491330 |
270 | 56 | # These dependencies on soyuz will be removed when getBuildRecords() | 56 | # These dependencies on soyuz will be removed when getBuildRecords() |
271 | 57 | # is moved. | 57 | # is moved. |
273 | 58 | from lp.soyuz.interfaces.build import IBuildSet | 58 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
274 | 59 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 59 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
275 | 60 | from lp.soyuz.model.buildpackagejob import BuildPackageJob | 60 | from lp.soyuz.model.buildpackagejob import BuildPackageJob |
276 | 61 | 61 | ||
277 | @@ -428,7 +428,7 @@ | |||
278 | 428 | def getBuildRecords(self, build_state=None, name=None, arch_tag=None, | 428 | def getBuildRecords(self, build_state=None, name=None, arch_tag=None, |
279 | 429 | user=None): | 429 | user=None): |
280 | 430 | """See IHasBuildRecords.""" | 430 | """See IHasBuildRecords.""" |
282 | 431 | return getUtility(IBuildSet).getBuildsForBuilder( | 431 | return getUtility(IBinaryPackageBuildSet).getBuildsForBuilder( |
283 | 432 | self.id, build_state, name, arch_tag, user) | 432 | self.id, build_state, name, arch_tag, user) |
284 | 433 | 433 | ||
285 | 434 | def slaveStatus(self): | 434 | def slaveStatus(self): |
286 | @@ -695,7 +695,7 @@ | |||
287 | 695 | """See `IBuilderSet`.""" | 695 | """See `IBuilderSet`.""" |
288 | 696 | # Avoiding circular imports. | 696 | # Avoiding circular imports. |
289 | 697 | from lp.soyuz.model.archive import Archive | 697 | from lp.soyuz.model.archive import Archive |
291 | 698 | from lp.soyuz.model.build import Build | 698 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
292 | 699 | from lp.soyuz.model.distroarchseries import ( | 699 | from lp.soyuz.model.distroarchseries import ( |
293 | 700 | DistroArchSeries) | 700 | DistroArchSeries) |
294 | 701 | from lp.soyuz.model.processor import Processor | 701 | from lp.soyuz.model.processor import Processor |
295 | @@ -703,7 +703,7 @@ | |||
296 | 703 | store = Store.of(processor) | 703 | store = Store.of(processor) |
297 | 704 | origin = ( | 704 | origin = ( |
298 | 705 | Archive, | 705 | Archive, |
300 | 706 | Build, | 706 | BinaryPackageBuild, |
301 | 707 | BuildPackageJob, | 707 | BuildPackageJob, |
302 | 708 | BuildQueue, | 708 | BuildQueue, |
303 | 709 | DistroArchSeries, | 709 | DistroArchSeries, |
304 | @@ -712,11 +712,11 @@ | |||
305 | 712 | queue = store.using(*origin).find( | 712 | queue = store.using(*origin).find( |
306 | 713 | BuildQueue, | 713 | BuildQueue, |
307 | 714 | BuildPackageJob.job == BuildQueue.jobID, | 714 | BuildPackageJob.job == BuildQueue.jobID, |
311 | 715 | BuildPackageJob.build == Build.id, | 715 | BuildPackageJob.build == BinaryPackageBuild.id, |
312 | 716 | Build.distroarchseries == DistroArchSeries.id, | 716 | BinaryPackageBuild.distroarchseries == DistroArchSeries.id, |
313 | 717 | Build.archive == Archive.id, | 717 | BinaryPackageBuild.archive == Archive.id, |
314 | 718 | DistroArchSeries.processorfamilyID == Processor.familyID, | 718 | DistroArchSeries.processorfamilyID == Processor.familyID, |
316 | 719 | Build.buildstate == BuildStatus.NEEDSBUILD, | 719 | BinaryPackageBuild.buildstate == BuildStatus.NEEDSBUILD, |
317 | 720 | Archive._enabled == True, | 720 | Archive._enabled == True, |
318 | 721 | Processor.id == processor.id, | 721 | Processor.id == processor.id, |
319 | 722 | Archive.require_virtualized == virtualized, | 722 | Archive.require_virtualized == virtualized, |
320 | 723 | 723 | ||
321 | === modified file 'lib/lp/buildmaster/tests/test_builder.py' | |||
322 | --- lib/lp/buildmaster/tests/test_builder.py 2010-03-06 04:57:40 +0000 | |||
323 | +++ lib/lp/buildmaster/tests/test_builder.py 2010-04-13 06:59:32 +0000 | |||
324 | @@ -18,7 +18,7 @@ | |||
325 | 18 | from lp.buildmaster.model.buildfarmjobbehavior import IdleBuildBehavior | 18 | from lp.buildmaster.model.buildfarmjobbehavior import IdleBuildBehavior |
326 | 19 | from lp.buildmaster.model.buildqueue import BuildQueue | 19 | from lp.buildmaster.model.buildqueue import BuildQueue |
327 | 20 | from lp.soyuz.interfaces.archive import ArchivePurpose | 20 | from lp.soyuz.interfaces.archive import ArchivePurpose |
329 | 21 | from lp.soyuz.interfaces.build import IBuildSet | 21 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
330 | 22 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 22 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
331 | 23 | from lp.soyuz.model.binarypackagebuildbehavior import ( | 23 | from lp.soyuz.model.binarypackagebuildbehavior import ( |
332 | 24 | BinaryPackageBuildBehavior) | 24 | BinaryPackageBuildBehavior) |
333 | @@ -88,7 +88,7 @@ | |||
334 | 88 | # Asking frog to find a candidate should give us the joesppa build. | 88 | # Asking frog to find a candidate should give us the joesppa build. |
335 | 89 | next_job = removeSecurityProxy( | 89 | next_job = removeSecurityProxy( |
336 | 90 | self.frog_builder)._findBuildCandidate() | 90 | self.frog_builder)._findBuildCandidate() |
338 | 91 | build = getUtility(IBuildSet).getByQueueEntry(next_job) | 91 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
339 | 92 | self.assertEqual('joesppa', build.archive.name) | 92 | self.assertEqual('joesppa', build.archive.name) |
340 | 93 | 93 | ||
341 | 94 | # If bob is in a failed state the joesppa build is still | 94 | # If bob is in a failed state the joesppa build is still |
342 | @@ -97,7 +97,7 @@ | |||
343 | 97 | self.bob_builder.manual = False | 97 | self.bob_builder.manual = False |
344 | 98 | next_job = removeSecurityProxy( | 98 | next_job = removeSecurityProxy( |
345 | 99 | self.frog_builder)._findBuildCandidate() | 99 | self.frog_builder)._findBuildCandidate() |
347 | 100 | build = getUtility(IBuildSet).getByQueueEntry(next_job) | 100 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
348 | 101 | self.assertEqual('joesppa', build.archive.name) | 101 | self.assertEqual('joesppa', build.archive.name) |
349 | 102 | 102 | ||
350 | 103 | 103 | ||
351 | @@ -178,7 +178,7 @@ | |||
352 | 178 | # A PPA cannot start a build if it would use 80% or more of the | 178 | # A PPA cannot start a build if it would use 80% or more of the |
353 | 179 | # builders. | 179 | # builders. |
354 | 180 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() | 180 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() |
356 | 181 | build = getUtility(IBuildSet).getByQueueEntry(next_job) | 181 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
357 | 182 | self.failIfEqual('joesppa', build.archive.name) | 182 | self.failIfEqual('joesppa', build.archive.name) |
358 | 183 | 183 | ||
359 | 184 | def test_findBuildCandidate_first_build_finished(self): | 184 | def test_findBuildCandidate_first_build_finished(self): |
360 | @@ -186,7 +186,7 @@ | |||
361 | 186 | # will be the next build candidate. | 186 | # will be the next build candidate. |
362 | 187 | self.joe_builds[0].buildstate = BuildStatus.FAILEDTOBUILD | 187 | self.joe_builds[0].buildstate = BuildStatus.FAILEDTOBUILD |
363 | 188 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() | 188 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() |
365 | 189 | build = getUtility(IBuildSet).getByQueueEntry(next_job) | 189 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
366 | 190 | self.failUnlessEqual('joesppa', build.archive.name) | 190 | self.failUnlessEqual('joesppa', build.archive.name) |
367 | 191 | 191 | ||
368 | 192 | 192 | ||
369 | @@ -198,7 +198,7 @@ | |||
370 | 198 | # If a ppa is private it will be able to have parallel builds | 198 | # If a ppa is private it will be able to have parallel builds |
371 | 199 | # for the one architecture. | 199 | # for the one architecture. |
372 | 200 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() | 200 | next_job = removeSecurityProxy(self.builder4)._findBuildCandidate() |
374 | 201 | build = getUtility(IBuildSet).getByQueueEntry(next_job) | 201 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
375 | 202 | self.failUnlessEqual('joesppa', build.archive.name) | 202 | self.failUnlessEqual('joesppa', build.archive.name) |
376 | 203 | 203 | ||
377 | 204 | 204 | ||
378 | @@ -225,7 +225,7 @@ | |||
379 | 225 | 225 | ||
380 | 226 | next_job = removeSecurityProxy( | 226 | next_job = removeSecurityProxy( |
381 | 227 | self.frog_builder)._findBuildCandidate() | 227 | self.frog_builder)._findBuildCandidate() |
383 | 228 | build = getUtility(IBuildSet).getByQueueEntry(next_job) | 228 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
384 | 229 | self.failUnlessEqual('primary', build.archive.name) | 229 | self.failUnlessEqual('primary', build.archive.name) |
385 | 230 | self.failUnlessEqual('gedit', build.sourcepackagerelease.name) | 230 | self.failUnlessEqual('gedit', build.sourcepackagerelease.name) |
386 | 231 | 231 | ||
387 | @@ -235,7 +235,7 @@ | |||
388 | 235 | build.builder = self.frog_builder | 235 | build.builder = self.frog_builder |
389 | 236 | next_job = removeSecurityProxy( | 236 | next_job = removeSecurityProxy( |
390 | 237 | self.frog_builder)._findBuildCandidate() | 237 | self.frog_builder)._findBuildCandidate() |
392 | 238 | build = getUtility(IBuildSet).getByQueueEntry(next_job) | 238 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(next_job) |
393 | 239 | self.failUnlessEqual('primary', build.archive.name) | 239 | self.failUnlessEqual('primary', build.archive.name) |
394 | 240 | self.failUnlessEqual('firefox', build.sourcepackagerelease.name) | 240 | self.failUnlessEqual('firefox', build.sourcepackagerelease.name) |
395 | 241 | 241 | ||
396 | 242 | 242 | ||
397 | === modified file 'lib/lp/buildmaster/tests/test_buildqueue.py' | |||
398 | --- lib/lp/buildmaster/tests/test_buildqueue.py 2010-03-19 13:58:27 +0000 | |||
399 | +++ lib/lp/buildmaster/tests/test_buildqueue.py 2010-04-13 06:59:32 +0000 | |||
400 | @@ -26,7 +26,7 @@ | |||
401 | 26 | from lp.soyuz.interfaces.archive import ArchivePurpose | 26 | from lp.soyuz.interfaces.archive import ArchivePurpose |
402 | 27 | from lp.soyuz.model.processor import ProcessorFamilySet | 27 | from lp.soyuz.model.processor import ProcessorFamilySet |
403 | 28 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 28 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
405 | 29 | from lp.soyuz.model.build import Build | 29 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
406 | 30 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | 30 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
407 | 31 | from lp.testing import TestCaseWithFactory | 31 | from lp.testing import TestCaseWithFactory |
408 | 32 | from lp.testing.fakemethod import FakeMethod | 32 | from lp.testing.fakemethod import FakeMethod |
409 | @@ -341,7 +341,7 @@ | |||
410 | 341 | 341 | ||
411 | 342 | # First mark all builds in the sample data as already built. | 342 | # First mark all builds in the sample data as already built. |
412 | 343 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 343 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
414 | 344 | sample_data = store.find(Build) | 344 | sample_data = store.find(BinaryPackageBuild) |
415 | 345 | for build in sample_data: | 345 | for build in sample_data: |
416 | 346 | build.buildstate = BuildStatus.FULLYBUILT | 346 | build.buildstate = BuildStatus.FULLYBUILT |
417 | 347 | store.flush() | 347 | store.flush() |
418 | @@ -637,7 +637,7 @@ | |||
419 | 637 | 637 | ||
420 | 638 | # First mark all builds in the sample data as already built. | 638 | # First mark all builds in the sample data as already built. |
421 | 639 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 639 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
423 | 640 | sample_data = store.find(Build) | 640 | sample_data = store.find(BinaryPackageBuild) |
424 | 641 | for build in sample_data: | 641 | for build in sample_data: |
425 | 642 | build.buildstate = BuildStatus.FULLYBUILT | 642 | build.buildstate = BuildStatus.FULLYBUILT |
426 | 643 | store.flush() | 643 | store.flush() |
427 | @@ -843,7 +843,7 @@ | |||
428 | 843 | 843 | ||
429 | 844 | # First mark all builds in the sample data as already built. | 844 | # First mark all builds in the sample data as already built. |
430 | 845 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 845 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
432 | 846 | sample_data = store.find(Build) | 846 | sample_data = store.find(BinaryPackageBuild) |
433 | 847 | for build in sample_data: | 847 | for build in sample_data: |
434 | 848 | build.buildstate = BuildStatus.FULLYBUILT | 848 | build.buildstate = BuildStatus.FULLYBUILT |
435 | 849 | store.flush() | 849 | store.flush() |
436 | @@ -922,7 +922,7 @@ | |||
437 | 922 | 922 | ||
438 | 923 | # First mark all builds in the sample data as already built. | 923 | # First mark all builds in the sample data as already built. |
439 | 924 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 924 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
441 | 925 | sample_data = store.find(Build) | 925 | sample_data = store.find(BinaryPackageBuild) |
442 | 926 | for build in sample_data: | 926 | for build in sample_data: |
443 | 927 | build.buildstate = BuildStatus.FULLYBUILT | 927 | build.buildstate = BuildStatus.FULLYBUILT |
444 | 928 | store.flush() | 928 | store.flush() |
445 | 929 | 929 | ||
446 | === modified file 'lib/lp/buildmaster/tests/test_manager.py' | |||
447 | --- lib/lp/buildmaster/tests/test_manager.py 2010-04-12 05:52:01 +0000 | |||
448 | +++ lib/lp/buildmaster/tests/test_manager.py 2010-04-13 06:59:32 +0000 | |||
449 | @@ -7,7 +7,7 @@ | |||
450 | 7 | import transaction | 7 | import transaction |
451 | 8 | import unittest | 8 | import unittest |
452 | 9 | 9 | ||
454 | 10 | from twisted.internet import defer, task, reactor | 10 | from twisted.internet import defer |
455 | 11 | from twisted.internet.error import ( | 11 | from twisted.internet.error import ( |
456 | 12 | ConnectionClosed, ProcessTerminated, TimeoutError) | 12 | ConnectionClosed, ProcessTerminated, TimeoutError) |
457 | 13 | from twisted.python.failure import Failure | 13 | from twisted.python.failure import Failure |
458 | @@ -30,7 +30,7 @@ | |||
459 | 30 | ResetDispatchResult, buildd_success_result_map) | 30 | ResetDispatchResult, buildd_success_result_map) |
460 | 31 | from lp.buildmaster.tests.harness import BuilddManagerTestSetup | 31 | from lp.buildmaster.tests.harness import BuilddManagerTestSetup |
461 | 32 | from lp.registry.interfaces.distribution import IDistributionSet | 32 | from lp.registry.interfaces.distribution import IDistributionSet |
463 | 33 | from lp.soyuz.interfaces.build import IBuildSet | 33 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
464 | 34 | from lp.soyuz.tests.soyuzbuilddhelpers import BuildingSlave | 34 | from lp.soyuz.tests.soyuzbuilddhelpers import BuildingSlave |
465 | 35 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | 35 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
466 | 36 | 36 | ||
467 | @@ -509,7 +509,7 @@ | |||
468 | 509 | self.assertEqual(job.builder, builder) | 509 | self.assertEqual(job.builder, builder) |
469 | 510 | self.assertTrue(job.date_started is not None) | 510 | self.assertTrue(job.date_started is not None) |
470 | 511 | self.assertEqual(job.job.status, JobStatus.RUNNING) | 511 | self.assertEqual(job.job.status, JobStatus.RUNNING) |
472 | 512 | build = getUtility(IBuildSet).getByQueueEntry(job) | 512 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
473 | 513 | self.assertEqual(build.buildstate, BuildStatus.BUILDING) | 513 | self.assertEqual(build.buildstate, BuildStatus.BUILDING) |
474 | 514 | self.assertEqual(job.logtail, logtail) | 514 | self.assertEqual(job.logtail, logtail) |
475 | 515 | 515 | ||
476 | @@ -633,7 +633,7 @@ | |||
477 | 633 | job = getUtility(IBuildQueueSet).get(job.id) | 633 | job = getUtility(IBuildQueueSet).get(job.id) |
478 | 634 | self.assertTrue(job.builder is None) | 634 | self.assertTrue(job.builder is None) |
479 | 635 | self.assertTrue(job.date_started is None) | 635 | self.assertTrue(job.date_started is None) |
481 | 636 | build = getUtility(IBuildSet).getByQueueEntry(job) | 636 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
482 | 637 | self.assertEqual(build.buildstate, BuildStatus.NEEDSBUILD) | 637 | self.assertEqual(build.buildstate, BuildStatus.NEEDSBUILD) |
483 | 638 | 638 | ||
484 | 639 | def testScanRescuesJobFromBrokenBuilder(self): | 639 | def testScanRescuesJobFromBrokenBuilder(self): |
485 | @@ -717,7 +717,7 @@ | |||
486 | 717 | builder.builderok = True | 717 | builder.builderok = True |
487 | 718 | 718 | ||
488 | 719 | job = builder.currentjob | 719 | job = builder.currentjob |
490 | 720 | build = getUtility(IBuildSet).getByQueueEntry(job) | 720 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
491 | 721 | self.assertEqual( | 721 | self.assertEqual( |
492 | 722 | 'i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE', | 722 | 'i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE', |
493 | 723 | build.title) | 723 | build.title) |
494 | @@ -734,7 +734,7 @@ | |||
495 | 734 | def assertJobIsClean(self, job_id): | 734 | def assertJobIsClean(self, job_id): |
496 | 735 | """Re-fetch the `IBuildQueue` record and check if it's clean.""" | 735 | """Re-fetch the `IBuildQueue` record and check if it's clean.""" |
497 | 736 | job = getUtility(IBuildQueueSet).get(job_id) | 736 | job = getUtility(IBuildQueueSet).get(job_id) |
499 | 737 | build = getUtility(IBuildSet).getByQueueEntry(job) | 737 | build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
500 | 738 | self.assertEqual('NEEDSBUILD', build.buildstate.name) | 738 | self.assertEqual('NEEDSBUILD', build.buildstate.name) |
501 | 739 | self.assertEqual(None, job.builder) | 739 | self.assertEqual(None, job.builder) |
502 | 740 | self.assertEqual(None, job.date_started) | 740 | self.assertEqual(None, job.date_started) |
503 | 741 | 741 | ||
504 | === modified file 'lib/lp/registry/browser/person.py' | |||
505 | --- lib/lp/registry/browser/person.py 2010-04-06 20:17:04 +0000 | |||
506 | +++ lib/lp/registry/browser/person.py 2010-04-13 06:59:32 +0000 | |||
507 | @@ -173,7 +173,7 @@ | |||
508 | 173 | IBranchNamespaceSet, InvalidNamespace) | 173 | IBranchNamespaceSet, InvalidNamespace) |
509 | 174 | from lp.bugs.interfaces.bugtask import IBugTaskSet | 174 | from lp.bugs.interfaces.bugtask import IBugTaskSet |
510 | 175 | from lp.buildmaster.interfaces.buildbase import BuildStatus | 175 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
512 | 176 | from lp.soyuz.interfaces.build import IBuildSet | 176 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
513 | 177 | from canonical.launchpad.interfaces.launchpad import ( | 177 | from canonical.launchpad.interfaces.launchpad import ( |
514 | 178 | ILaunchpadCelebrities, INotificationRecipientSet, UnknownRecipientError) | 178 | ILaunchpadCelebrities, INotificationRecipientSet, UnknownRecipientError) |
515 | 179 | from canonical.launchpad.interfaces.message import ( | 179 | from canonical.launchpad.interfaces.message import ( |
516 | @@ -5189,7 +5189,7 @@ | |||
517 | 5189 | the source package release. | 5189 | the source package release. |
518 | 5190 | """ | 5190 | """ |
519 | 5191 | # Calculate all the failed builds with one query. | 5191 | # Calculate all the failed builds with one query. |
521 | 5192 | build_set = getUtility(IBuildSet) | 5192 | build_set = getUtility(IBinaryPackageBuildSet) |
522 | 5193 | package_release_ids = [ | 5193 | package_release_ids = [ |
523 | 5194 | package_release.id for package_release in package_releases] | 5194 | package_release.id for package_release in package_releases] |
524 | 5195 | all_builds = build_set.getBuildsBySourcePackageRelease( | 5195 | all_builds = build_set.getBuildsBySourcePackageRelease( |
525 | 5196 | 5196 | ||
526 | === modified file 'lib/lp/registry/model/distribution.py' | |||
527 | --- lib/lp/registry/model/distribution.py 2010-04-10 09:24:41 +0000 | |||
528 | +++ lib/lp/registry/model/distribution.py 2010-04-13 06:59:32 +0000 | |||
529 | @@ -39,7 +39,7 @@ | |||
530 | 39 | from lp.bugs.model.bugtarget import ( | 39 | from lp.bugs.model.bugtarget import ( |
531 | 40 | BugTargetBase, HasBugHeatMixin, OfficialBugTagTargetMixin) | 40 | BugTargetBase, HasBugHeatMixin, OfficialBugTagTargetMixin) |
532 | 41 | from lp.bugs.model.bugtask import BugTask | 41 | from lp.bugs.model.bugtask import BugTask |
534 | 42 | from lp.soyuz.model.build import Build | 42 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
535 | 43 | from lp.registry.model.distributionmirror import DistributionMirror | 43 | from lp.registry.model.distributionmirror import DistributionMirror |
536 | 44 | from lp.registry.model.distributionsourcepackage import ( | 44 | from lp.registry.model.distributionsourcepackage import ( |
537 | 45 | DistributionSourcePackage) | 45 | DistributionSourcePackage) |
538 | @@ -81,7 +81,7 @@ | |||
539 | 81 | from lp.bugs.interfaces.bugtarget import IHasBugHeat | 81 | from lp.bugs.interfaces.bugtarget import IHasBugHeat |
540 | 82 | from lp.bugs.interfaces.bugtask import ( | 82 | from lp.bugs.interfaces.bugtask import ( |
541 | 83 | BugTaskStatus, UNRESOLVED_BUGTASK_STATUSES) | 83 | BugTaskStatus, UNRESOLVED_BUGTASK_STATUSES) |
543 | 84 | from lp.soyuz.interfaces.build import IBuildSet | 84 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
544 | 85 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 85 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
545 | 86 | from lp.registry.interfaces.distribution import ( | 86 | from lp.registry.interfaces.distribution import ( |
546 | 87 | IBaseDistribution, IDerivativeDistribution, IDistribution, | 87 | IBaseDistribution, IDerivativeDistribution, IDistribution, |
547 | @@ -799,8 +799,9 @@ | |||
548 | 799 | arch_ids = DistroArchSeriesSet().getIdsForArchitectures( | 799 | arch_ids = DistroArchSeriesSet().getIdsForArchitectures( |
549 | 800 | self.architectures, arch_tag) | 800 | self.architectures, arch_tag) |
550 | 801 | 801 | ||
553 | 802 | # Use the facility provided by IBuildSet to retrieve the records. | 802 | # Use the facility provided by IBinaryPackageBuildSet to |
554 | 803 | return getUtility(IBuildSet).getBuildsByArchIds( | 803 | # retrieve the records. |
555 | 804 | return getUtility(IBinaryPackageBuildSet).getBuildsByArchIds( | ||
556 | 804 | arch_ids, build_state, name, pocket) | 805 | arch_ids, build_state, name, pocket) |
557 | 805 | 806 | ||
558 | 806 | def getSourcePackageCaches(self, archive=None): | 807 | def getSourcePackageCaches(self, archive=None): |
559 | @@ -1058,9 +1059,10 @@ | |||
560 | 1058 | DistroSeries.status != SeriesStatus.OBSOLETE, | 1059 | DistroSeries.status != SeriesStatus.OBSOLETE, |
561 | 1059 | BinaryPackageRelease.binarypackagename == BinaryPackageName.id, | 1060 | BinaryPackageRelease.binarypackagename == BinaryPackageName.id, |
562 | 1060 | DistroArchSeries.distroseries == DistroSeries.id, | 1061 | DistroArchSeries.distroseries == DistroSeries.id, |
566 | 1061 | Build.distroarchseries == DistroArchSeries.id, | 1062 | BinaryPackageBuild.distroarchseries == DistroArchSeries.id, |
567 | 1062 | BinaryPackageRelease.build == Build.id, | 1063 | BinaryPackageRelease.build == BinaryPackageBuild.id, |
568 | 1063 | Build.sourcepackagerelease == SourcePackageRelease.id, | 1064 | (BinaryPackageBuild.sourcepackagerelease == |
569 | 1065 | SourcePackageRelease.id), | ||
570 | 1064 | SourcePackageRelease.sourcepackagename == SourcePackageName.id, | 1066 | SourcePackageRelease.sourcepackagename == SourcePackageName.id, |
571 | 1065 | DistributionSourcePackageCache.sourcepackagename == | 1067 | DistributionSourcePackageCache.sourcepackagename == |
572 | 1066 | SourcePackageName.id, | 1068 | SourcePackageName.id, |
573 | 1067 | 1069 | ||
574 | === modified file 'lib/lp/registry/model/distroseries.py' | |||
575 | --- lib/lp/registry/model/distroseries.py 2010-04-08 18:40:18 +0000 | |||
576 | +++ lib/lp/registry/model/distroseries.py 2010-04-13 06:59:32 +0000 | |||
577 | @@ -90,7 +90,7 @@ | |||
578 | 90 | from canonical.launchpad.helpers import shortlist | 90 | from canonical.launchpad.helpers import shortlist |
579 | 91 | from lp.soyuz.interfaces.archive import ( | 91 | from lp.soyuz.interfaces.archive import ( |
580 | 92 | ALLOW_RELEASE_BUILDS, ArchivePurpose, IArchiveSet, MAIN_ARCHIVE_PURPOSES) | 92 | ALLOW_RELEASE_BUILDS, ArchivePurpose, IArchiveSet, MAIN_ARCHIVE_PURPOSES) |
582 | 93 | from lp.soyuz.interfaces.build import IBuildSet | 93 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
583 | 94 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 94 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
584 | 95 | from lp.soyuz.interfaces.binarypackagename import ( | 95 | from lp.soyuz.interfaces.binarypackagename import ( |
585 | 96 | IBinaryPackageName) | 96 | IBinaryPackageName) |
586 | @@ -1110,8 +1110,9 @@ | |||
587 | 1110 | arch_ids = DistroArchSeriesSet().getIdsForArchitectures( | 1110 | arch_ids = DistroArchSeriesSet().getIdsForArchitectures( |
588 | 1111 | self.architectures, arch_tag) | 1111 | self.architectures, arch_tag) |
589 | 1112 | 1112 | ||
592 | 1113 | # Use the facility provided by IBuildSet to retrieve the records. | 1113 | # Use the facility provided by IBinaryPackageBuildSet to |
593 | 1114 | return getUtility(IBuildSet).getBuildsByArchIds( | 1114 | # retrieve the records. |
594 | 1115 | return getUtility(IBinaryPackageBuildSet).getBuildsByArchIds( | ||
595 | 1115 | arch_ids, build_state, name, pocket) | 1116 | arch_ids, build_state, name, pocket) |
596 | 1116 | 1117 | ||
597 | 1117 | def createUploadedSourcePackageRelease( | 1118 | def createUploadedSourcePackageRelease( |
598 | 1118 | 1119 | ||
599 | === modified file 'lib/lp/registry/model/sourcepackage.py' | |||
600 | --- lib/lp/registry/model/sourcepackage.py 2010-03-19 11:13:00 +0000 | |||
601 | +++ lib/lp/registry/model/sourcepackage.py 2010-04-13 06:59:32 +0000 | |||
602 | @@ -29,7 +29,8 @@ | |||
603 | 29 | from lp.bugs.model.bugtarget import BugTargetBase, HasBugHeatMixin | 29 | from lp.bugs.model.bugtarget import BugTargetBase, HasBugHeatMixin |
604 | 30 | from lp.bugs.model.bugtask import BugTask | 30 | from lp.bugs.model.bugtask import BugTask |
605 | 31 | from lp.soyuz.interfaces.archive import IArchiveSet, ArchivePurpose | 31 | from lp.soyuz.interfaces.archive import IArchiveSet, ArchivePurpose |
607 | 32 | from lp.soyuz.model.build import Build, BuildSet | 32 | from lp.soyuz.model.binarypackagebuild import ( |
608 | 33 | BinaryPackageBuild, BinaryPackageBuildSet) | ||
609 | 33 | from lp.soyuz.model.distributionsourcepackagerelease import ( | 34 | from lp.soyuz.model.distributionsourcepackagerelease import ( |
610 | 34 | DistributionSourcePackageRelease) | 35 | DistributionSourcePackageRelease) |
611 | 35 | from lp.soyuz.model.distroseriessourcepackagerelease import ( | 36 | from lp.soyuz.model.distroseriessourcepackagerelease import ( |
612 | @@ -530,7 +531,7 @@ | |||
613 | 530 | # We re-use the optional-parameter handling provided by BuildSet | 531 | # We re-use the optional-parameter handling provided by BuildSet |
614 | 531 | # here, but pass None for the name argument as we've already | 532 | # here, but pass None for the name argument as we've already |
615 | 532 | # matched on exact source package name. | 533 | # matched on exact source package name. |
617 | 533 | BuildSet().handleOptionalParamsForBuildQueries( | 534 | BinaryPackageBuildSet().handleOptionalParamsForBuildQueries( |
618 | 534 | condition_clauses, clauseTables, build_state, name=None, | 535 | condition_clauses, clauseTables, build_state, name=None, |
619 | 535 | pocket=pocket, arch_tag=arch_tag) | 536 | pocket=pocket, arch_tag=arch_tag) |
620 | 536 | 537 | ||
621 | @@ -561,7 +562,7 @@ | |||
622 | 561 | 562 | ||
623 | 562 | # End of duplication (see XXX cprov 2006-09-25 above). | 563 | # End of duplication (see XXX cprov 2006-09-25 above). |
624 | 563 | 564 | ||
626 | 564 | return Build.select(' AND '.join(condition_clauses), | 565 | return BinaryPackageBuild.select(' AND '.join(condition_clauses), |
627 | 565 | clauseTables=clauseTables, orderBy=orderBy) | 566 | clauseTables=clauseTables, orderBy=orderBy) |
628 | 566 | 567 | ||
629 | 567 | @property | 568 | @property |
630 | 568 | 569 | ||
631 | === modified file 'lib/lp/soyuz/browser/archive.py' | |||
632 | --- lib/lp/soyuz/browser/archive.py 2010-03-12 06:23:04 +0000 | |||
633 | +++ lib/lp/soyuz/browser/archive.py 2010-04-13 06:59:32 +0000 | |||
634 | @@ -64,7 +64,8 @@ | |||
635 | 64 | ArchivePermissionType, IArchivePermissionSet) | 64 | ArchivePermissionType, IArchivePermissionSet) |
636 | 65 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet | 65 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet |
637 | 66 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet | 66 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet |
639 | 67 | from lp.soyuz.interfaces.build import BuildSetStatus, IBuildSet | 67 | from lp.soyuz.interfaces.binarypackagebuild import ( |
640 | 68 | BuildSetStatus, IBinaryPackageBuildSet) | ||
641 | 68 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 69 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
642 | 69 | from lp.soyuz.interfaces.component import IComponentSet | 70 | from lp.soyuz.interfaces.component import IComponentSet |
643 | 70 | from lp.registry.interfaces.series import SeriesStatus | 71 | from lp.registry.interfaces.series import SeriesStatus |
644 | @@ -192,7 +193,7 @@ | |||
645 | 192 | except ValueError: | 193 | except ValueError: |
646 | 193 | return None | 194 | return None |
647 | 194 | try: | 195 | try: |
649 | 195 | return getUtility(IBuildSet).getByBuildID(build_id) | 196 | return getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
650 | 196 | except NotFoundError: | 197 | except NotFoundError: |
651 | 197 | return None | 198 | return None |
652 | 198 | 199 | ||
653 | 199 | 200 | ||
654 | === modified file 'lib/lp/soyuz/browser/build.py' | |||
655 | --- lib/lp/soyuz/browser/build.py 2010-03-24 07:17:20 +0000 | |||
656 | +++ lib/lp/soyuz/browser/build.py 2010-04-13 06:59:32 +0000 | |||
657 | @@ -34,14 +34,15 @@ | |||
658 | 34 | from canonical.lazr.utils import safe_hasattr | 34 | from canonical.lazr.utils import safe_hasattr |
659 | 35 | from lp.buildmaster.interfaces.buildbase import BuildStatus | 35 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
660 | 36 | from lp.services.job.interfaces.job import JobStatus | 36 | from lp.services.job.interfaces.job import JobStatus |
662 | 37 | from lp.soyuz.interfaces.build import IBuild, IBuildRescoreForm, IBuildSet | 37 | from lp.soyuz.interfaces.binarypackagebuild import ( |
663 | 38 | IBinaryPackageBuild, IBuildRescoreForm, IBinaryPackageBuildSet) | ||
664 | 38 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 39 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
665 | 39 | from canonical.launchpad.interfaces.launchpad import UnexpectedFormData | 40 | from canonical.launchpad.interfaces.launchpad import UnexpectedFormData |
666 | 40 | from lp.soyuz.interfaces.queue import PackageUploadStatus | 41 | from lp.soyuz.interfaces.queue import PackageUploadStatus |
667 | 41 | 42 | ||
668 | 42 | 43 | ||
669 | 43 | class BuildUrl: | 44 | class BuildUrl: |
671 | 44 | """Dynamic URL declaration for IBuild. | 45 | """Dynamic URL declaration for IBinaryPackageBuild. |
672 | 45 | 46 | ||
673 | 46 | When dealing with distribution builds we want to present them | 47 | When dealing with distribution builds we want to present them |
674 | 47 | under IDistributionSourcePackageRelease url: | 48 | under IDistributionSourcePackageRelease url: |
675 | @@ -74,19 +75,20 @@ | |||
676 | 74 | 75 | ||
677 | 75 | 76 | ||
678 | 76 | class BuildNavigation(GetitemNavigation, FileNavigationMixin): | 77 | class BuildNavigation(GetitemNavigation, FileNavigationMixin): |
680 | 77 | usedfor = IBuild | 78 | usedfor = IBinaryPackageBuild |
681 | 78 | 79 | ||
682 | 79 | 80 | ||
683 | 80 | class BuildFacets(StandardLaunchpadFacets): | 81 | class BuildFacets(StandardLaunchpadFacets): |
685 | 81 | """The links that will appear in the facet menu for an IBuild.""" | 82 | """The links that will appear in the facet menu for an |
686 | 83 | IBinaryPackageBuild.""" | ||
687 | 82 | enable_only = ['overview'] | 84 | enable_only = ['overview'] |
688 | 83 | 85 | ||
690 | 84 | usedfor = IBuild | 86 | usedfor = IBinaryPackageBuild |
691 | 85 | 87 | ||
692 | 86 | 88 | ||
693 | 87 | class BuildContextMenu(ContextMenu): | 89 | class BuildContextMenu(ContextMenu): |
694 | 88 | """Overview menu for build records """ | 90 | """Overview menu for build records """ |
696 | 89 | usedfor = IBuild | 91 | usedfor = IBinaryPackageBuild |
697 | 90 | 92 | ||
698 | 91 | links = ['ppa', 'records', 'retry', 'rescore'] | 93 | links = ['ppa', 'records', 'retry', 'rescore'] |
699 | 92 | 94 | ||
700 | @@ -123,7 +125,7 @@ | |||
701 | 123 | 125 | ||
702 | 124 | 126 | ||
703 | 125 | class BuildBreadcrumb(Breadcrumb): | 127 | class BuildBreadcrumb(Breadcrumb): |
705 | 126 | """Builds a breadcrumb for an `IBuild`.""" | 128 | """Builds a breadcrumb for an `IBinaryPackageBuild`.""" |
706 | 127 | 129 | ||
707 | 128 | @property | 130 | @property |
708 | 129 | def text(self): | 131 | def text(self): |
709 | @@ -140,8 +142,8 @@ | |||
710 | 140 | 142 | ||
711 | 141 | 143 | ||
712 | 142 | class BuildView(LaunchpadView): | 144 | class BuildView(LaunchpadView): |
715 | 143 | """Auxiliary view class for IBuild""" | 145 | """Auxiliary view class for IBinaryPackageBuild""" |
716 | 144 | __used_for__ = IBuild | 146 | __used_for__ = IBinaryPackageBuild |
717 | 145 | 147 | ||
718 | 146 | @property | 148 | @property |
719 | 147 | def label(self): | 149 | def label(self): |
720 | @@ -230,9 +232,9 @@ | |||
721 | 230 | 232 | ||
722 | 231 | 233 | ||
723 | 232 | class BuildRetryView(BuildView): | 234 | class BuildRetryView(BuildView): |
725 | 233 | """View class for retrying `IBuild`s""" | 235 | """View class for retrying `IBinaryPackageBuild`s""" |
726 | 234 | 236 | ||
728 | 235 | __used_for__ = IBuild | 237 | __used_for__ = IBinaryPackageBuild |
729 | 236 | 238 | ||
730 | 237 | @property | 239 | @property |
731 | 238 | def label(self): | 240 | def label(self): |
732 | @@ -293,8 +295,8 @@ | |||
733 | 293 | 295 | ||
734 | 294 | 296 | ||
735 | 295 | class CompleteBuild: | 297 | class CompleteBuild: |
738 | 296 | """Super object to store related IBuild & IBuildQueue.""" | 298 | """Super object to store related IBinaryPackageBuild & IBuildQueue.""" |
739 | 297 | delegates(IBuild) | 299 | delegates(IBinaryPackageBuild) |
740 | 298 | def __init__(self, build, buildqueue_record): | 300 | def __init__(self, build, buildqueue_record): |
741 | 299 | self.context = build | 301 | self.context = build |
742 | 300 | self._buildqueue_record = buildqueue_record | 302 | self._buildqueue_record = buildqueue_record |
743 | @@ -320,7 +322,8 @@ | |||
744 | 320 | 322 | ||
745 | 321 | prefetched_data = dict() | 323 | prefetched_data = dict() |
746 | 322 | build_ids = [build.id for build in builds] | 324 | build_ids = [build.id for build in builds] |
748 | 323 | results = getUtility(IBuildSet).getQueueEntriesForBuildIDs(build_ids) | 325 | results = getUtility(IBinaryPackageBuildSet).getQueueEntriesForBuildIDs( |
749 | 326 | build_ids) | ||
750 | 324 | for (buildqueue, _builder, build_job) in results: | 327 | for (buildqueue, _builder, build_job) in results: |
751 | 325 | # Get the build's id, 'buildqueue', 'sourcepackagerelease' and | 328 | # Get the build's id, 'buildqueue', 'sourcepackagerelease' and |
752 | 326 | # 'buildlog' (from the result set) respectively. | 329 | # 'buildlog' (from the result set) respectively. |
753 | 327 | 330 | ||
754 | === modified file 'lib/lp/soyuz/browser/builder.py' | |||
755 | --- lib/lp/soyuz/browser/builder.py 2010-03-16 05:08:47 +0000 | |||
756 | +++ lib/lp/soyuz/browser/builder.py 2010-04-13 06:59:32 +0000 | |||
757 | @@ -29,7 +29,7 @@ | |||
758 | 29 | from canonical.lazr.utils import smartquote | 29 | from canonical.lazr.utils import smartquote |
759 | 30 | from canonical.launchpad import _ | 30 | from canonical.launchpad import _ |
760 | 31 | from lp.soyuz.browser.build import BuildRecordsView | 31 | from lp.soyuz.browser.build import BuildRecordsView |
762 | 32 | from lp.soyuz.interfaces.build import IBuildSet | 32 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
763 | 33 | from lp.buildmaster.interfaces.builder import IBuilderSet, IBuilder | 33 | from lp.buildmaster.interfaces.builder import IBuilderSet, IBuilder |
764 | 34 | from canonical.launchpad.interfaces.launchpad import NotFoundError | 34 | from canonical.launchpad.interfaces.launchpad import NotFoundError |
765 | 35 | from canonical.launchpad.webapp import ( | 35 | from canonical.launchpad.webapp import ( |
766 | @@ -52,7 +52,7 @@ | |||
767 | 52 | except ValueError: | 52 | except ValueError: |
768 | 53 | return None | 53 | return None |
769 | 54 | try: | 54 | try: |
771 | 55 | build = getUtility(IBuildSet).getByBuildID(build_id) | 55 | build = getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
772 | 56 | except NotFoundError: | 56 | except NotFoundError: |
773 | 57 | return None | 57 | return None |
774 | 58 | else: | 58 | else: |
775 | 59 | 59 | ||
776 | === modified file 'lib/lp/soyuz/browser/configure.zcml' | |||
777 | --- lib/lp/soyuz/browser/configure.zcml 2010-03-22 07:10:45 +0000 | |||
778 | +++ lib/lp/soyuz/browser/configure.zcml 2010-04-13 06:59:32 +0000 | |||
779 | @@ -335,17 +335,17 @@ | |||
780 | 335 | attribute_to_parent="archive" | 335 | attribute_to_parent="archive" |
781 | 336 | urldata="lp.soyuz.browser.archivepermission.ArchivePermissionURL"/> | 336 | urldata="lp.soyuz.browser.archivepermission.ArchivePermissionURL"/> |
782 | 337 | <browser:defaultView | 337 | <browser:defaultView |
784 | 338 | for="lp.soyuz.interfaces.build.IBuild" | 338 | for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
785 | 339 | name="+index"/> | 339 | name="+index"/> |
786 | 340 | <browser:url | 340 | <browser:url |
788 | 341 | for="lp.soyuz.interfaces.build.IBuild" | 341 | for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
789 | 342 | urldata="lp.soyuz.browser.build.BuildUrl"/> | 342 | urldata="lp.soyuz.browser.build.BuildUrl"/> |
790 | 343 | <browser:navigation | 343 | <browser:navigation |
791 | 344 | module="lp.soyuz.browser.build" | 344 | module="lp.soyuz.browser.build" |
792 | 345 | classes=" | 345 | classes=" |
793 | 346 | BuildNavigation"/> | 346 | BuildNavigation"/> |
794 | 347 | <browser:pages | 347 | <browser:pages |
796 | 348 | for="lp.soyuz.interfaces.build.IBuild" | 348 | for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
797 | 349 | class="lp.soyuz.browser.build.BuildView" | 349 | class="lp.soyuz.browser.build.BuildView" |
798 | 350 | permission="launchpad.View"> | 350 | permission="launchpad.View"> |
799 | 351 | <browser:page | 351 | <browser:page |
800 | @@ -354,7 +354,7 @@ | |||
801 | 354 | template="../templates/build-index.pt"/> | 354 | template="../templates/build-index.pt"/> |
802 | 355 | </browser:pages> | 355 | </browser:pages> |
803 | 356 | <browser:pages | 356 | <browser:pages |
805 | 357 | for="lp.soyuz.interfaces.build.IBuild" | 357 | for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
806 | 358 | class="lp.soyuz.browser.build.BuildRetryView" | 358 | class="lp.soyuz.browser.build.BuildRetryView" |
807 | 359 | permission="launchpad.Edit"> | 359 | permission="launchpad.Edit"> |
808 | 360 | <browser:page | 360 | <browser:page |
809 | @@ -363,7 +363,7 @@ | |||
810 | 363 | template="../templates/build-retry.pt"/> | 363 | template="../templates/build-retry.pt"/> |
811 | 364 | </browser:pages> | 364 | </browser:pages> |
812 | 365 | <browser:pages | 365 | <browser:pages |
814 | 366 | for="lp.soyuz.interfaces.build.IBuild" | 366 | for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
815 | 367 | class="lp.soyuz.browser.build.BuildRescoringView" | 367 | class="lp.soyuz.browser.build.BuildRescoringView" |
816 | 368 | permission="launchpad.Admin"> | 368 | permission="launchpad.Admin"> |
817 | 369 | <browser:page | 369 | <browser:page |
818 | 370 | 370 | ||
819 | === modified file 'lib/lp/soyuz/browser/distributionsourcepackagerelease.py' | |||
820 | --- lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-03-08 13:07:07 +0000 | |||
821 | +++ lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-04-13 06:59:32 +0000 | |||
822 | @@ -21,7 +21,7 @@ | |||
823 | 21 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | 21 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
824 | 22 | from canonical.launchpad.webapp.interfaces import NotFoundError | 22 | from canonical.launchpad.webapp.interfaces import NotFoundError |
825 | 23 | from lp.archivepublisher.debversion import Version | 23 | from lp.archivepublisher.debversion import Version |
827 | 24 | from lp.soyuz.interfaces.build import IBuildSet | 24 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
828 | 25 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( | 25 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( |
829 | 26 | IDistributionSourcePackageRelease) | 26 | IDistributionSourcePackageRelease) |
830 | 27 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 27 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
831 | @@ -47,7 +47,7 @@ | |||
832 | 47 | except ValueError: | 47 | except ValueError: |
833 | 48 | return None | 48 | return None |
834 | 49 | try: | 49 | try: |
836 | 50 | return getUtility(IBuildSet).getByBuildID(build_id) | 50 | return getUtility(IBinaryPackageBuildSet).getByBuildID(build_id) |
837 | 51 | except NotFoundError: | 51 | except NotFoundError: |
838 | 52 | return None | 52 | return None |
839 | 53 | 53 | ||
840 | @@ -119,7 +119,7 @@ | |||
841 | 119 | :return: a `list` of dictionaries containing 'distroseries' and its | 119 | :return: a `list` of dictionaries containing 'distroseries' and its |
842 | 120 | grouped 'builds' ordered by descending distroseries versions. | 120 | grouped 'builds' ordered by descending distroseries versions. |
843 | 121 | """ | 121 | """ |
845 | 122 | # Build a local list of `IBuilds` ordered by ascending | 122 | # Build a local list of `IBinaryPackageBuilds` ordered by ascending |
846 | 123 | # 'architecture_tag'. | 123 | # 'architecture_tag'. |
847 | 124 | cached_builds = sorted( | 124 | cached_builds = sorted( |
848 | 125 | self.context.builds, key=operator.attrgetter('arch_tag')) | 125 | self.context.builds, key=operator.attrgetter('arch_tag')) |
849 | 126 | 126 | ||
850 | === modified file 'lib/lp/soyuz/browser/publishing.py' | |||
851 | --- lib/lp/soyuz/browser/publishing.py 2009-06-25 04:06:00 +0000 | |||
852 | +++ lib/lp/soyuz/browser/publishing.py 2010-04-13 06:59:32 +0000 | |||
853 | @@ -18,7 +18,7 @@ | |||
854 | 18 | 18 | ||
855 | 19 | from canonical.cachedproperty import cachedproperty | 19 | from canonical.cachedproperty import cachedproperty |
856 | 20 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias | 20 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias |
858 | 21 | from lp.soyuz.interfaces.build import BuildSetStatus | 21 | from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus |
859 | 22 | from lp.soyuz.interfaces.packagediff import IPackageDiff | 22 | from lp.soyuz.interfaces.packagediff import IPackageDiff |
860 | 23 | from lp.soyuz.interfaces.publishing import ( | 23 | from lp.soyuz.interfaces.publishing import ( |
861 | 24 | PackagePublishingStatus, IBinaryPackagePublishingHistory, | 24 | PackagePublishingStatus, IBinaryPackagePublishingHistory, |
862 | 25 | 25 | ||
863 | === modified file 'lib/lp/soyuz/browser/tests/archive-views.txt' | |||
864 | --- lib/lp/soyuz/browser/tests/archive-views.txt 2010-03-06 04:57:40 +0000 | |||
865 | +++ lib/lp/soyuz/browser/tests/archive-views.txt 2010-04-13 06:59:32 +0000 | |||
866 | @@ -356,13 +356,15 @@ | |||
867 | 356 | Let's set some builds appropriately to see the results. | 356 | Let's set some builds appropriately to see the results. |
868 | 357 | 357 | ||
869 | 358 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus | 358 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
871 | 359 | >>> from lp.soyuz.interfaces.build import IBuildSet | 359 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
872 | 360 | ... IBinaryPackageBuildSet) | ||
873 | 360 | >>> warty_hppa = getUtility(IDistributionSet)['ubuntu']['warty']['hppa'] | 361 | >>> warty_hppa = getUtility(IDistributionSet)['ubuntu']['warty']['hppa'] |
874 | 361 | >>> source = view.filtered_sources[0] | 362 | >>> source = view.filtered_sources[0] |
875 | 362 | >>> ignore = source.sourcepackagerelease.createBuild( | 363 | >>> ignore = source.sourcepackagerelease.createBuild( |
876 | 363 | ... distroarchseries=warty_hppa, archive=view.context, | 364 | ... distroarchseries=warty_hppa, archive=view.context, |
877 | 364 | ... pocket=source.pocket) | 365 | ... pocket=source.pocket) |
879 | 365 | >>> builds = getUtility(IBuildSet).getBuildsForArchive(view.context) | 366 | >>> builds = getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
880 | 367 | ... view.context) | ||
881 | 366 | >>> for build in builds: | 368 | >>> for build in builds: |
882 | 367 | ... print build.title | 369 | ... print build.title |
883 | 368 | hppa build of cdrkit 1.0 in ubuntu warty RELEASE | 370 | hppa build of cdrkit 1.0 in ubuntu warty RELEASE |
884 | 369 | 371 | ||
885 | === modified file 'lib/lp/soyuz/browser/tests/builder-views.txt' | |||
886 | --- lib/lp/soyuz/browser/tests/builder-views.txt 2010-03-10 12:50:18 +0000 | |||
887 | +++ lib/lp/soyuz/browser/tests/builder-views.txt 2010-04-13 06:59:32 +0000 | |||
888 | @@ -2,7 +2,8 @@ | |||
889 | 2 | 2 | ||
890 | 3 | >>> from zope.component import getMultiAdapter, getUtility | 3 | >>> from zope.component import getMultiAdapter, getUtility |
891 | 4 | >>> from lp.buildmaster.interfaces.builder import IBuilderSet | 4 | >>> from lp.buildmaster.interfaces.builder import IBuilderSet |
893 | 5 | >>> from lp.soyuz.interfaces.build import IBuildSet | 5 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
894 | 6 | ... IBinaryPackageBuildSet) | ||
895 | 6 | >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest | 7 | >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest |
896 | 7 | 8 | ||
897 | 8 | >>> builder = getUtility(IBuilderSet).get(1) | 9 | >>> builder = getUtility(IBuilderSet).get(1) |
898 | @@ -176,7 +177,7 @@ | |||
899 | 176 | >>> print frog.builderok | 177 | >>> print frog.builderok |
900 | 177 | True | 178 | True |
901 | 178 | 179 | ||
903 | 179 | >>> build_set = getUtility(IBuildSet) | 180 | >>> build_set = getUtility(IBinaryPackageBuildSet) |
904 | 180 | >>> build = build_set.getByQueueEntry(frog.currentjob) | 181 | >>> build = build_set.getByQueueEntry(frog.currentjob) |
905 | 181 | >>> print build.title | 182 | >>> print build.title |
906 | 182 | i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE | 183 | i386 build of privacy-test 666 in ubuntutest breezy-autotest RELEASE |
907 | 183 | 184 | ||
908 | === modified file 'lib/lp/soyuz/configure.zcml' | |||
909 | --- lib/lp/soyuz/configure.zcml 2010-03-24 17:07:08 +0000 | |||
910 | +++ lib/lp/soyuz/configure.zcml 2010-04-13 06:59:32 +0000 | |||
911 | @@ -406,7 +406,7 @@ | |||
912 | 406 | <require | 406 | <require |
913 | 407 | permission="launchpad.Commercial" | 407 | permission="launchpad.Commercial" |
914 | 408 | set_attributes="authorized_size buildd_secret arm_builds_allowed | 408 | set_attributes="authorized_size buildd_secret arm_builds_allowed |
916 | 409 | external_dependencies private | 409 | external_dependencies private |
917 | 410 | require_virtualized relative_build_score "/> | 410 | require_virtualized relative_build_score "/> |
918 | 411 | <require | 411 | <require |
919 | 412 | permission="launchpad.Admin" | 412 | permission="launchpad.Admin" |
920 | @@ -487,19 +487,19 @@ | |||
921 | 487 | deletePackagesetUploader"/> | 487 | deletePackagesetUploader"/> |
922 | 488 | </securedutility> | 488 | </securedutility> |
923 | 489 | 489 | ||
925 | 490 | <!-- Build --> | 490 | <!-- BinaryPackageBuild --> |
926 | 491 | 491 | ||
927 | 492 | <class | 492 | <class |
929 | 493 | class="canonical.launchpad.database.Build"> | 493 | class="lp.soyuz.model.binarypackagebuild.BinaryPackageBuild"> |
930 | 494 | <require | 494 | <require |
931 | 495 | permission="launchpad.View" | 495 | permission="launchpad.View" |
933 | 496 | interface="lp.soyuz.interfaces.build.IBuildView"/> | 496 | interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildView"/> |
934 | 497 | <require | 497 | <require |
935 | 498 | permission="launchpad.Edit" | 498 | permission="launchpad.Edit" |
937 | 499 | interface="lp.soyuz.interfaces.build.IBuildEdit"/> | 499 | interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildEdit"/> |
938 | 500 | <require | 500 | <require |
939 | 501 | permission="launchpad.Admin" | 501 | permission="launchpad.Admin" |
941 | 502 | interface="lp.soyuz.interfaces.build.IBuildAdmin"/> | 502 | interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildAdmin"/> |
942 | 503 | 503 | ||
943 | 504 | <!-- XXX cprov 2005-10-27 | 504 | <!-- XXX cprov 2005-10-27 |
944 | 505 | 505 | ||
945 | @@ -507,21 +507,22 @@ | |||
946 | 507 | 507 | ||
947 | 508 | <require | 508 | <require |
948 | 509 | permission="launchpad.Edit" | 509 | permission="launchpad.Edit" |
950 | 510 | set_attributes="buildlog datebuilt buildduration builder buildstate dependencies upload_log"/> | 510 | set_attributes="buildlog datebuilt buildduration builder |
951 | 511 | buildstate dependencies upload_log"/> | ||
952 | 511 | </class> | 512 | </class> |
953 | 512 | <adapter | 513 | <adapter |
954 | 513 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 514 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
956 | 514 | for="lp.soyuz.interfaces.build.IBuild" | 515 | for="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuild" |
957 | 515 | factory="lp.soyuz.browser.build.BuildBreadcrumb" | 516 | factory="lp.soyuz.browser.build.BuildBreadcrumb" |
958 | 516 | permission="zope.Public"/> | 517 | permission="zope.Public"/> |
959 | 517 | 518 | ||
961 | 518 | <!-- BuildSet --> | 519 | <!-- BinaryPackageBuildSet --> |
962 | 519 | 520 | ||
963 | 520 | <securedutility | 521 | <securedutility |
966 | 521 | class="canonical.launchpad.database.BuildSet" | 522 | class="lp.soyuz.model.binarypackagebuild.BinaryPackageBuildSet" |
967 | 522 | provides="lp.soyuz.interfaces.build.IBuildSet"> | 523 | provides="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildSet"> |
968 | 523 | <allow | 524 | <allow |
970 | 524 | interface="lp.soyuz.interfaces.build.IBuildSet"/> | 525 | interface="lp.soyuz.interfaces.binarypackagebuild.IBinaryPackageBuildSet"/> |
971 | 525 | </securedutility> | 526 | </securedutility> |
972 | 526 | 527 | ||
973 | 527 | <!-- DistroArchSeriesBinaryPackage --> | 528 | <!-- DistroArchSeriesBinaryPackage --> |
974 | @@ -848,7 +849,7 @@ | |||
975 | 848 | <allow | 849 | <allow |
976 | 849 | interface="lp.soyuz.interfaces.buildpackagejob.IBuildPackageJob"/> | 850 | interface="lp.soyuz.interfaces.buildpackagejob.IBuildPackageJob"/> |
977 | 850 | </class> | 851 | </class> |
979 | 851 | <!-- | 852 | <!-- |
980 | 852 | The registration below is used to discover all build farm job classes | 853 | The registration below is used to discover all build farm job classes |
981 | 853 | that implement the `IBuildFarmJob` interface. Please see bug #503839 | 854 | that implement the `IBuildFarmJob` interface. Please see bug #503839 |
982 | 854 | for more detail. | 855 | for more detail. |
983 | 855 | 856 | ||
984 | === modified file 'lib/lp/soyuz/doc/build-estimated-dispatch-time.txt' | |||
985 | --- lib/lp/soyuz/doc/build-estimated-dispatch-time.txt 2010-03-17 05:58:22 +0000 | |||
986 | +++ lib/lp/soyuz/doc/build-estimated-dispatch-time.txt 2010-04-13 06:59:32 +0000 | |||
987 | @@ -58,8 +58,9 @@ | |||
988 | 58 | >>> import pytz | 58 | >>> import pytz |
989 | 59 | >>> bob_the_builder = builder_set.get(1) | 59 | >>> bob_the_builder = builder_set.get(1) |
990 | 60 | >>> cur_bqueue = bob_the_builder.currentjob | 60 | >>> cur_bqueue = bob_the_builder.currentjob |
993 | 61 | >>> from lp.soyuz.interfaces.build import IBuildSet | 61 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
994 | 62 | >>> cur_build = getUtility(IBuildSet).getByQueueEntry(cur_bqueue) | 62 | ... IBinaryPackageBuildSet) |
995 | 63 | >>> cur_build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(cur_bqueue) | ||
996 | 63 | 64 | ||
997 | 64 | Make sure the job at hand is currently being built. | 65 | Make sure the job at hand is currently being built. |
998 | 65 | 66 | ||
999 | 66 | 67 | ||
1000 | === modified file 'lib/lp/soyuz/doc/build-failedtoupload-workflow.txt' | |||
1001 | --- lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2010-03-26 19:22:58 +0000 | |||
1002 | +++ lib/lp/soyuz/doc/build-failedtoupload-workflow.txt 2010-04-13 06:59:32 +0000 | |||
1003 | @@ -16,9 +16,10 @@ | |||
1004 | 16 | buildmaster/slave-scanner code, an build notification will be issued. | 16 | buildmaster/slave-scanner code, an build notification will be issued. |
1005 | 17 | See more information in build-notification.txt file. | 17 | See more information in build-notification.txt file. |
1006 | 18 | 18 | ||
1008 | 19 | >>> from lp.soyuz.interfaces.build import IBuildSet | 19 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1009 | 20 | ... IBinaryPackageBuildSet) | ||
1010 | 20 | >>> from lp.testing.mail_helpers import pop_notifications | 21 | >>> from lp.testing.mail_helpers import pop_notifications |
1012 | 21 | >>> buildset = getUtility(IBuildSet) | 22 | >>> buildset = getUtility(IBinaryPackageBuildSet) |
1013 | 22 | 23 | ||
1014 | 23 | Let's use a sampledata build record in FAILEDTOUPLOAD: | 24 | Let's use a sampledata build record in FAILEDTOUPLOAD: |
1015 | 24 | 25 | ||
1016 | 25 | 26 | ||
1017 | === modified file 'lib/lp/soyuz/doc/build-notification.txt' | |||
1018 | --- lib/lp/soyuz/doc/build-notification.txt 2010-03-26 17:31:48 +0000 | |||
1019 | +++ lib/lp/soyuz/doc/build-notification.txt 2010-04-13 06:59:32 +0000 | |||
1020 | @@ -2,9 +2,10 @@ | |||
1021 | 2 | Build Notification System | 2 | Build Notification System |
1022 | 3 | ========================= | 3 | ========================= |
1023 | 4 | 4 | ||
1027 | 5 | IBuild instance implements the 'notify' method which sends a status | 5 | IBinaryPackageBuild instance implements the 'notify' method which sends |
1028 | 6 | report about the current record to the ISourcePackageRelease.creator | 6 | a status report about the current record to the |
1029 | 7 | and the package uploader's preferred email address. | 7 | ISourcePackageRelease.creator and the package uploader's preferred email |
1030 | 8 | address. | ||
1031 | 8 | 9 | ||
1032 | 9 | We rely on get_contact_email_addresses() to DTRT, either use the | 10 | We rely on get_contact_email_addresses() to DTRT, either use the |
1033 | 10 | Team.contactaddress of the Launchpad Buildd Celebrity or the | 11 | Team.contactaddress of the Launchpad Buildd Celebrity or the |
1034 | @@ -15,9 +16,10 @@ | |||
1035 | 15 | All build states are supported by the current implementation, however | 16 | All build states are supported by the current implementation, however |
1036 | 16 | only failures should be reported this time. | 17 | only failures should be reported this time. |
1037 | 17 | 18 | ||
1039 | 18 | >>> from lp.soyuz.interfaces.build import IBuildSet | 19 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1040 | 20 | ... IBinaryPackageBuildSet) | ||
1041 | 19 | >>> from lp.testing.mail_helpers import pop_notifications | 21 | >>> from lp.testing.mail_helpers import pop_notifications |
1043 | 20 | >>> buildset = getUtility(IBuildSet) | 22 | >>> buildset = getUtility(IBinaryPackageBuildSet) |
1044 | 21 | 23 | ||
1045 | 22 | To avoid consequences of modified sampledata, specially if we add | 24 | To avoid consequences of modified sampledata, specially if we add |
1046 | 23 | more builds for test we are going to pick a specific build record | 25 | more builds for test we are going to pick a specific build record |
1047 | 24 | 26 | ||
1048 | === modified file 'lib/lp/soyuz/doc/build.txt' | |||
1049 | --- lib/lp/soyuz/doc/build.txt 2010-03-26 19:22:58 +0000 | |||
1050 | +++ lib/lp/soyuz/doc/build.txt 2010-04-13 06:59:32 +0000 | |||
1051 | @@ -137,8 +137,9 @@ | |||
1052 | 137 | If the build does not have any uploads, None is returned: | 137 | If the build does not have any uploads, None is returned: |
1053 | 138 | 138 | ||
1054 | 139 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus | 139 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
1057 | 140 | >>> from lp.soyuz.interfaces.build import IBuildSet | 140 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1058 | 141 | >>> at_build = getUtility(IBuildSet).getByBuildID(15) | 141 | ... IBinaryPackageBuildSet) |
1059 | 142 | >>> at_build = getUtility(IBinaryPackageBuildSet).getByBuildID(15) | ||
1060 | 142 | >>> print at_build.package_upload | 143 | >>> print at_build.package_upload |
1061 | 143 | None | 144 | None |
1062 | 144 | 145 | ||
1063 | @@ -147,7 +148,7 @@ | |||
1064 | 147 | >>> firefox_build.can_be_retried | 148 | >>> firefox_build.can_be_retried |
1065 | 148 | False | 149 | False |
1066 | 149 | 150 | ||
1068 | 150 | >>> frozen_build = getUtility(IBuildSet).getByBuildID(9) | 151 | >>> frozen_build = getUtility(IBinaryPackageBuildSet).getByBuildID(9) |
1069 | 151 | >>> frozen_build.title | 152 | >>> frozen_build.title |
1070 | 152 | u'i386 build of pmount 0.1-1 in ubuntu warty RELEASE' | 153 | u'i386 build of pmount 0.1-1 in ubuntu warty RELEASE' |
1071 | 153 | >>> frozen_build.buildstate.title | 154 | >>> frozen_build.buildstate.title |
1072 | @@ -155,12 +156,12 @@ | |||
1073 | 155 | >>> frozen_build.can_be_retried | 156 | >>> frozen_build.can_be_retried |
1074 | 156 | False | 157 | False |
1075 | 157 | 158 | ||
1078 | 158 | See section 'AssertionErrors in IBuild' for further documentation about | 159 | See section 'AssertionErrors in IBinaryPackageBuild' for further |
1079 | 159 | consequences of an denied 'retry' action. | 160 | documentation about consequences of an denied 'retry' action. |
1080 | 160 | 161 | ||
1081 | 161 | Let's retrieve a build record that can be retried. | 162 | Let's retrieve a build record that can be retried. |
1082 | 162 | 163 | ||
1084 | 163 | >>> active_build = getUtility(IBuildSet).getByBuildID(9) | 164 | >>> active_build = getUtility(IBinaryPackageBuildSet).getByBuildID(9) |
1085 | 164 | 165 | ||
1086 | 165 | >>> print active_build.title | 166 | >>> print active_build.title |
1087 | 166 | i386 build of pmount 0.1-1 in ubuntu warty RELEASE | 167 | i386 build of pmount 0.1-1 in ubuntu warty RELEASE |
1088 | @@ -235,7 +236,7 @@ | |||
1089 | 235 | 236 | ||
1090 | 236 | In order to call storeUploadLog() again for the same build, we have to | 237 | In order to call storeUploadLog() again for the same build, we have to |
1091 | 237 | remove the previously stored 'upload_log'. See the check below in | 238 | remove the previously stored 'upload_log'. See the check below in |
1093 | 238 | 'AssertionErrors in IBuild' for more detail. | 239 | 'AssertionErrors in IBinaryPackageBuild' for more detail. |
1094 | 239 | 240 | ||
1095 | 240 | >>> login('foo.bar@canonical.com') | 241 | >>> login('foo.bar@canonical.com') |
1096 | 241 | >>> active_build.upload_log = None | 242 | >>> active_build.upload_log = None |
1097 | @@ -373,7 +374,7 @@ | |||
1098 | 373 | Invoke createBinaryPackageRelease with all required arguments. | 374 | Invoke createBinaryPackageRelease with all required arguments. |
1099 | 374 | 375 | ||
1100 | 375 | # Load a build from the samepledata for creating binaries. | 376 | # Load a build from the samepledata for creating binaries. |
1102 | 376 | >>> pmount_build = getUtility(IBuildSet).getByBuildID(19) | 377 | >>> pmount_build = getUtility(IBinaryPackageBuildSet).getByBuildID(19) |
1103 | 377 | 378 | ||
1104 | 378 | >>> bin = pmount_build.createBinaryPackageRelease( | 379 | >>> bin = pmount_build.createBinaryPackageRelease( |
1105 | 379 | ... binarypackagename, version, summary, description, | 380 | ... binarypackagename, version, summary, description, |
1106 | @@ -453,7 +454,7 @@ | |||
1107 | 453 | The BuildSet class gives us some useful ways to consider the | 454 | The BuildSet class gives us some useful ways to consider the |
1108 | 454 | collection of builds. | 455 | collection of builds. |
1109 | 455 | 456 | ||
1111 | 456 | >>> bs = getUtility(IBuildSet) | 457 | >>> bs = getUtility(IBinaryPackageBuildSet) |
1112 | 457 | 458 | ||
1113 | 458 | We can find builds given a source package release and architecture tag. | 459 | We can find builds given a source package release and architecture tag. |
1114 | 459 | 460 | ||
1115 | @@ -461,7 +462,7 @@ | |||
1116 | 461 | >>> i386_builds.count() | 462 | >>> i386_builds.count() |
1117 | 462 | 4 | 463 | 4 |
1118 | 463 | 464 | ||
1120 | 464 | IHasBuildRecords uses a base method provided by IBuildSet, | 465 | IHasBuildRecords uses a base method provided by IBinaryPackageBuildSet, |
1121 | 465 | getBuildsByArchIds(): | 466 | getBuildsByArchIds(): |
1122 | 466 | 467 | ||
1123 | 467 | It receives list of architectures IDs: | 468 | It receives list of architectures IDs: |
1124 | @@ -519,8 +520,8 @@ | |||
1125 | 519 | ... bs.getBuildsByArchIds(arch_ids, name='commercialpackage')] | 520 | ... bs.getBuildsByArchIds(arch_ids, name='commercialpackage')] |
1126 | 520 | [('PARTNER', u'i386 build of commercialpackage 1.0-1 in ubuntu breezy-autotest RELEASE')] | 521 | [('PARTNER', u'i386 build of commercialpackage 1.0-1 in ubuntu breezy-autotest RELEASE')] |
1127 | 521 | 522 | ||
1130 | 522 | `IBuildSet` also provides getStatusSummaryForBuilds which summarizes the | 523 | `IBinaryPackageBuildSet` also provides getStatusSummaryForBuilds which |
1131 | 523 | build status of a set of builds: | 524 | summarizes the build status of a set of builds: |
1132 | 524 | 525 | ||
1133 | 525 | First we'll define a helper to print the build summary: | 526 | First we'll define a helper to print the build summary: |
1134 | 526 | 527 | ||
1135 | @@ -543,11 +544,12 @@ | |||
1136 | 543 | data from the database for a given set of builds: | 544 | data from the database for a given set of builds: |
1137 | 544 | 545 | ||
1138 | 545 | >>> from storm.expr import In | 546 | >>> from storm.expr import In |
1140 | 546 | >>> from lp.soyuz.model.build import Build | 547 | >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1141 | 547 | >>> from canonical.launchpad.webapp.interfaces import ( | 548 | >>> from canonical.launchpad.webapp.interfaces import ( |
1142 | 548 | ... IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR) | 549 | ... IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR) |
1143 | 549 | >>> store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 550 | >>> store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
1145 | 550 | >>> results = list(store.find(Build, In(Build.id, (2,6,7,8)))) | 551 | >>> results = list(store.find( |
1146 | 552 | ... BinaryPackageBuild, In(BinaryPackageBuild.id, (2,6,7,8)))) | ||
1147 | 551 | >>> rset = removeSecurityProxy(bs)._prefetchBuildData(results) | 553 | >>> rset = removeSecurityProxy(bs)._prefetchBuildData(results) |
1148 | 552 | >>> def filename_or_none(item): | 554 | >>> def filename_or_none(item): |
1149 | 553 | ... if item is not None: | 555 | ... if item is not None: |
1150 | @@ -768,7 +770,7 @@ | |||
1151 | 768 | if user is not passed then the query runs anonymously which means private | 770 | if user is not passed then the query runs anonymously which means private |
1152 | 769 | builds are excluded from anything returned. | 771 | builds are excluded from anything returned. |
1153 | 770 | 772 | ||
1155 | 771 | Log in as admin to avoid security on IBuild for the moment. | 773 | Log in as admin to avoid security on IBinaryPackageBuild for the moment. |
1156 | 772 | 774 | ||
1157 | 773 | >>> login('foo.bar@canonical.com') | 775 | >>> login('foo.bar@canonical.com') |
1158 | 774 | 776 | ||
1159 | @@ -889,16 +891,16 @@ | |||
1160 | 889 | 4 | 891 | 4 |
1161 | 890 | 892 | ||
1162 | 891 | 893 | ||
1164 | 892 | == AssertionErrors in IBuild == | 894 | == AssertionErrors in IBinaryPackageBuild == |
1165 | 893 | 895 | ||
1166 | 894 | Build records inserted by gina don't provide calculated_buildstart | 896 | Build records inserted by gina don't provide calculated_buildstart |
1167 | 895 | value, since they miss fields used in its calculation. | 897 | value, since they miss fields used in its calculation. |
1168 | 896 | 898 | ||
1170 | 897 | >>> gina_build = getUtility(IBuildSet).getByBuildID(10) | 899 | >>> gina_build = getUtility(IBinaryPackageBuildSet).getByBuildID(10) |
1171 | 898 | >>> gina_build.title | 900 | >>> gina_build.title |
1172 | 899 | u'i386 build of cnews cr.g7-37 in ubuntu warty RELEASE' | 901 | u'i386 build of cnews cr.g7-37 in ubuntu warty RELEASE' |
1173 | 900 | 902 | ||
1175 | 901 | even if IBuild.was_built return true: | 903 | even if IBinaryPackageBuild.was_built return true: |
1176 | 902 | 904 | ||
1177 | 903 | >>> gina_build.was_built | 905 | >>> gina_build.was_built |
1178 | 904 | True | 906 | True |
1179 | @@ -916,10 +918,10 @@ | |||
1180 | 916 | its result in case of success, i.e., we should not be able to retry a | 918 | its result in case of success, i.e., we should not be able to retry a |
1181 | 917 | build for a released pocket. | 919 | build for a released pocket. |
1182 | 918 | 920 | ||
1185 | 919 | All those conditions are controlled by IBuild.can_be_retried() property | 921 | All those conditions are controlled by |
1186 | 920 | (see above). | 922 | IBinaryPackageBuild.can_be_retried() property (see above). |
1187 | 921 | 923 | ||
1189 | 922 | >>> failed_build = getUtility(IBuildSet).getByBuildID(6) | 924 | >>> failed_build = getUtility(IBinaryPackageBuildSet).getByBuildID(6) |
1190 | 923 | 925 | ||
1191 | 924 | >>> failed_build.title | 926 | >>> failed_build.title |
1192 | 925 | u'i386 build of foobar 1.0 in ubuntu warty RELEASE' | 927 | u'i386 build of foobar 1.0 in ubuntu warty RELEASE' |
1193 | @@ -963,7 +965,7 @@ | |||
1194 | 963 | storeUploadLog() refuses to override any previously stored | 965 | storeUploadLog() refuses to override any previously stored |
1195 | 964 | 'upload_log'. | 966 | 'upload_log'. |
1196 | 965 | 967 | ||
1198 | 966 | >>> failedtoupload_build = getUtility(IBuildSet).getByBuildID(22) | 968 | >>> failedtoupload_build = getUtility(IBinaryPackageBuildSet).getByBuildID(22) |
1199 | 967 | >>> print failedtoupload_build.title | 969 | >>> print failedtoupload_build.title |
1200 | 968 | i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE | 970 | i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE |
1201 | 969 | 971 | ||
1202 | @@ -993,17 +995,17 @@ | |||
1203 | 993 | 995 | ||
1204 | 994 | == Updating build-dependencies line == | 996 | == Updating build-dependencies line == |
1205 | 995 | 997 | ||
1208 | 996 | The IBuild.dependencies field is only filled when a build job is | 998 | The IBinaryPackageBuild.dependencies field is only filled when a build |
1209 | 997 | collected as MANUALDEPWAIT, its content is informed by the | 999 | job is collected as MANUALDEPWAIT, its content is informed by the |
1210 | 998 | buildd-slave in the apt-dependencies format. | 1000 | buildd-slave in the apt-dependencies format. |
1211 | 999 | 1001 | ||
1213 | 1000 | >>> depwait_build = getUtility(IBuildSet).getByBuildID(12) | 1002 | >>> depwait_build = getUtility(IBinaryPackageBuildSet).getByBuildID(12) |
1214 | 1001 | >>> print depwait_build.dependencies | 1003 | >>> print depwait_build.dependencies |
1215 | 1002 | cpp (>= 4:4.0.1-3), gcc-4.0 (>= 4.0.1-2) | 1004 | cpp (>= 4:4.0.1-3), gcc-4.0 (>= 4.0.1-2) |
1216 | 1003 | 1005 | ||
1220 | 1004 | IBuild.updateDependencies is designed to process this field and | 1006 | IBinaryPackageBuild.updateDependencies is designed to process this field |
1221 | 1005 | eliminate dependencies that can be satisfied. It is used as part of the | 1007 | and eliminate dependencies that can be satisfied. It is used as part of |
1222 | 1006 | auto-depwait processing where all builds marked as MANUALDEPWAIT are | 1008 | the auto-depwait processing where all builds marked as MANUALDEPWAIT are |
1223 | 1007 | re-processed and the ones with empty dependencies are re-queued. | 1009 | re-processed and the ones with empty dependencies are re-queued. |
1224 | 1008 | 1010 | ||
1225 | 1009 | If nothing has changed, which is the case of the current | 1011 | If nothing has changed, which is the case of the current |
1226 | @@ -1107,7 +1109,7 @@ | |||
1227 | 1107 | It depends on the callsite to decide whether or not to 'retry' a | 1109 | It depends on the callsite to decide whether or not to 'retry' a |
1228 | 1108 | build after calling updateDependencies, to encapsulate such decision | 1110 | build after calling updateDependencies, to encapsulate such decision |
1229 | 1109 | for performing the mentioned auto-depwait procedure we have a utility | 1111 | for performing the mentioned auto-depwait procedure we have a utility |
1231 | 1110 | in IBuildSet called retryDepWaiting(). | 1112 | in IBinaryPackageBuildSet called retryDepWaiting(). |
1232 | 1111 | 1113 | ||
1233 | 1112 | >>> print depwait_build.buildstate.name | 1114 | >>> print depwait_build.buildstate.name |
1234 | 1113 | MANUALDEPWAIT | 1115 | MANUALDEPWAIT |
1235 | @@ -1125,7 +1127,7 @@ | |||
1236 | 1125 | Then we can run the utility method for the target distroarchseries and | 1127 | Then we can run the utility method for the target distroarchseries and |
1237 | 1126 | expect depwait_build to be 'retried' and scored. | 1128 | expect depwait_build to be 'retried' and scored. |
1238 | 1127 | 1129 | ||
1240 | 1128 | >>> getUtility(IBuildSet).retryDepWaiting(hoaryi386) | 1130 | >>> getUtility(IBinaryPackageBuildSet).retryDepWaiting(hoaryi386) |
1241 | 1129 | 1131 | ||
1242 | 1130 | >>> print depwait_build.buildstate.name | 1132 | >>> print depwait_build.buildstate.name |
1243 | 1131 | NEEDSBUILD | 1133 | NEEDSBUILD |
1244 | @@ -1173,8 +1175,8 @@ | |||
1245 | 1173 | 1175 | ||
1246 | 1174 | == Build record security == | 1176 | == Build record security == |
1247 | 1175 | 1177 | ||
1250 | 1176 | IBuild's content class is wrapped in a Zope security wrapper that prevents | 1178 | IBinaryPackageBuild's content class is wrapped in a Zope security |
1251 | 1177 | access to private builds for unauthorised users. | 1179 | wrapper that prevents access to private builds for unauthorised users. |
1252 | 1178 | 1180 | ||
1253 | 1179 | Accessing the cprov builds when logged in as admin will see the records: | 1181 | Accessing the cprov builds when logged in as admin will see the records: |
1254 | 1180 | 1182 | ||
1255 | @@ -1373,7 +1375,7 @@ | |||
1256 | 1373 | datetime.timedelta(0, 3600) | 1375 | datetime.timedelta(0, 3600) |
1257 | 1374 | 1376 | ||
1258 | 1375 | 1377 | ||
1260 | 1376 | == IBuildSet.getBuildsBySourcePackageRelease() == | 1378 | == IBinaryPackageBuildSet.getBuildsBySourcePackageRelease() == |
1261 | 1377 | 1379 | ||
1262 | 1378 | getBuildsBySourcePackageRelease() will return all the Build records for | 1380 | getBuildsBySourcePackageRelease() will return all the Build records for |
1263 | 1379 | all the SourcePackageRelease IDs passed. | 1381 | all the SourcePackageRelease IDs passed. |
1264 | @@ -1481,7 +1483,7 @@ | |||
1265 | 1481 | A call to getBuildsForBuilder returns only those builds that were | 1483 | A call to getBuildsForBuilder returns only those builds that were |
1266 | 1482 | built by the specified builder, ordered by datebuilt DESC: | 1484 | built by the specified builder, ordered by datebuilt DESC: |
1267 | 1483 | 1485 | ||
1269 | 1484 | >>> frog_builds = getUtility(IBuildSet).getBuildsForBuilder( | 1486 | >>> frog_builds = getUtility(IBinaryPackageBuildSet).getBuildsForBuilder( |
1270 | 1485 | ... frog_builder.id) | 1487 | ... frog_builder.id) |
1271 | 1486 | >>> print_build_details(frog_builds) | 1488 | >>> print_build_details(frog_builds) |
1272 | 1487 | ubuntu-team: i386 build of laterbuildsrc 666 in ubuntutest | 1489 | ubuntu-team: i386 build of laterbuildsrc 666 in ubuntutest |
1273 | 1488 | 1490 | ||
1274 | === modified file 'lib/lp/soyuz/doc/buildd-dispatching.txt' | |||
1275 | --- lib/lp/soyuz/doc/buildd-dispatching.txt 2010-04-08 15:29:39 +0000 | |||
1276 | +++ lib/lp/soyuz/doc/buildd-dispatching.txt 2010-04-13 06:59:32 +0000 | |||
1277 | @@ -131,8 +131,9 @@ | |||
1278 | 131 | 131 | ||
1279 | 132 | >>> job.id | 132 | >>> job.id |
1280 | 133 | 2 | 133 | 2 |
1283 | 134 | >>> from lp.soyuz.interfaces.build import IBuildSet | 134 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1284 | 135 | >>> build = getUtility(IBuildSet).getByQueueEntry(job) | 135 | ... IBinaryPackageBuildSet) |
1285 | 136 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) | ||
1286 | 136 | >>> build.buildstate.name | 137 | >>> build.buildstate.name |
1287 | 137 | 'NEEDSBUILD' | 138 | 'NEEDSBUILD' |
1288 | 138 | >>> job.builder is None | 139 | >>> job.builder is None |
1289 | @@ -172,7 +173,7 @@ | |||
1290 | 172 | >>> job.builder.id == bob_builder.id | 173 | >>> job.builder.id == bob_builder.id |
1291 | 173 | True | 174 | True |
1292 | 174 | 175 | ||
1294 | 175 | >>> build = getUtility(IBuildSet).getByQueueEntry(job) | 176 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(job) |
1295 | 176 | >>> build.buildstate.name | 177 | >>> build.buildstate.name |
1296 | 177 | 'BUILDING' | 178 | 'BUILDING' |
1297 | 178 | 179 | ||
1298 | @@ -209,7 +210,7 @@ | |||
1299 | 209 | 210 | ||
1300 | 210 | The build job's archive requires virtualized builds. | 211 | The build job's archive requires virtualized builds. |
1301 | 211 | 212 | ||
1303 | 212 | >>> build = getUtility(IBuildSet).getByQueueEntry(ppa_job) | 213 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(ppa_job) |
1304 | 213 | >>> build.archive.require_virtualized | 214 | >>> build.archive.require_virtualized |
1305 | 214 | True | 215 | True |
1306 | 215 | 216 | ||
1307 | 216 | 217 | ||
1308 | === modified file 'lib/lp/soyuz/doc/buildd-scoring.txt' | |||
1309 | --- lib/lp/soyuz/doc/buildd-scoring.txt 2010-02-17 13:01:41 +0000 | |||
1310 | +++ lib/lp/soyuz/doc/buildd-scoring.txt 2010-04-13 06:59:32 +0000 | |||
1311 | @@ -260,8 +260,9 @@ | |||
1312 | 260 | ... name='test-rebuild') | 260 | ... name='test-rebuild') |
1313 | 261 | 261 | ||
1314 | 262 | >>> bqc = setUpBuildQueueEntry(archive=copy) | 262 | >>> bqc = setUpBuildQueueEntry(archive=copy) |
1317 | 263 | >>> from lp.soyuz.interfaces.build import IBuildSet | 263 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1318 | 264 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqc) | 264 | ... IBinaryPackageBuildSet) |
1319 | 265 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqc) | ||
1320 | 265 | >>> bqc.score() | 266 | >>> bqc.score() |
1321 | 266 | >>> bqc.lastscore | 267 | >>> bqc.lastscore |
1322 | 267 | -10 | 268 | -10 |
1323 | 268 | 269 | ||
1324 | === modified file 'lib/lp/soyuz/doc/buildd-slavescanner.txt' | |||
1325 | --- lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-04-12 05:52:01 +0000 | |||
1326 | +++ lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-04-13 06:59:32 +0000 | |||
1327 | @@ -75,14 +75,15 @@ | |||
1328 | 75 | following states: FAILEDTOBUILD and CHROOTWAIT | 75 | following states: FAILEDTOBUILD and CHROOTWAIT |
1329 | 76 | 76 | ||
1330 | 77 | >>> from lp.buildmaster.interfaces.builder import IBuilderSet | 77 | >>> from lp.buildmaster.interfaces.builder import IBuilderSet |
1332 | 78 | >>> from lp.soyuz.interfaces.build import IBuildSet | 78 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1333 | 79 | ... IBinaryPackageBuildSet) | ||
1334 | 79 | >>> import datetime, pytz | 80 | >>> import datetime, pytz |
1335 | 80 | 81 | ||
1336 | 81 | >>> UTC = pytz.timezone('UTC') | 82 | >>> UTC = pytz.timezone('UTC') |
1337 | 82 | 83 | ||
1338 | 83 | We want to get a Build and make BuildQueue items for it: | 84 | We want to get a Build and make BuildQueue items for it: |
1339 | 84 | 85 | ||
1341 | 85 | >>> a_build = getUtility(IBuildSet).getByBuildID(8) | 86 | >>> a_build = getUtility(IBinaryPackageBuildSet).getByBuildID(8) |
1342 | 86 | 87 | ||
1343 | 87 | To make testing easier we provide a convenience function to put a BuildQueue | 88 | To make testing easier we provide a convenience function to put a BuildQueue |
1344 | 88 | object into a preset fixed state: | 89 | object into a preset fixed state: |
1345 | @@ -134,7 +135,7 @@ | |||
1346 | 134 | 135 | ||
1347 | 135 | Do the test execution: | 136 | Do the test execution: |
1348 | 136 | 137 | ||
1350 | 137 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem3) | 138 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem3) |
1351 | 138 | >>> a_builder.updateBuild(bqItem3) | 139 | >>> a_builder.updateBuild(bqItem3) |
1352 | 139 | >>> build.builder is not None | 140 | >>> build.builder is not None |
1353 | 140 | True | 141 | True |
1354 | @@ -164,7 +165,7 @@ | |||
1355 | 164 | 165 | ||
1356 | 165 | Do the test execution: | 166 | Do the test execution: |
1357 | 166 | 167 | ||
1359 | 167 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem4) | 168 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem4) |
1360 | 168 | >>> a_builder.updateBuild(bqItem4) | 169 | >>> a_builder.updateBuild(bqItem4) |
1361 | 169 | CRITICAL:slave-scanner:***** bob is MANUALDEPWAIT ***** | 170 | CRITICAL:slave-scanner:***** bob is MANUALDEPWAIT ***** |
1362 | 170 | >>> build.builder is not None | 171 | >>> build.builder is not None |
1363 | @@ -193,7 +194,7 @@ | |||
1364 | 193 | 194 | ||
1365 | 194 | >>> bqItem5.builder.setSlaveForTesting( | 195 | >>> bqItem5.builder.setSlaveForTesting( |
1366 | 195 | ... WaitingSlave('BuildStatus.CHROOTFAIL')) | 196 | ... WaitingSlave('BuildStatus.CHROOTFAIL')) |
1368 | 196 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem5) | 197 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem5) |
1369 | 197 | >>> a_builder.updateBuild(bqItem5) | 198 | >>> a_builder.updateBuild(bqItem5) |
1370 | 198 | CRITICAL:slave-scanner:***** bob is CHROOTWAIT ***** | 199 | CRITICAL:slave-scanner:***** bob is CHROOTWAIT ***** |
1371 | 199 | >>> build.builder is not None | 200 | >>> build.builder is not None |
1372 | @@ -232,7 +233,7 @@ | |||
1373 | 232 | True | 233 | True |
1374 | 233 | >>> check_mail_sent(last_stub_mail_count) | 234 | >>> check_mail_sent(last_stub_mail_count) |
1375 | 234 | False | 235 | False |
1377 | 235 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem6) | 236 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem6) |
1378 | 236 | >>> print build.buildstate.title | 237 | >>> print build.buildstate.title |
1379 | 237 | Pending build | 238 | Pending build |
1380 | 238 | >>> job = bqItem6.specific_job.job | 239 | >>> job = bqItem6.specific_job.job |
1381 | @@ -341,7 +342,7 @@ | |||
1382 | 341 | (precisely on binary upload time), the build will be considered | 342 | (precisely on binary upload time), the build will be considered |
1383 | 342 | FAILEDTOUPLOAD: | 343 | FAILEDTOUPLOAD: |
1384 | 343 | 344 | ||
1386 | 344 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem10) | 345 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem10) |
1387 | 345 | >>> a_builder.updateBuild(bqItem10) | 346 | >>> a_builder.updateBuild(bqItem10) |
1388 | 346 | WARNING:slave-scanner:Build ... upload failed. | 347 | WARNING:slave-scanner:Build ... upload failed. |
1389 | 347 | >>> build.builder is not None | 348 | >>> build.builder is not None |
1390 | @@ -407,9 +408,9 @@ | |||
1391 | 407 | this case cleanly. We need to set the pocket to updates for this test as its | 408 | this case cleanly. We need to set the pocket to updates for this test as its |
1392 | 408 | uploading to warty. | 409 | uploading to warty. |
1393 | 409 | 410 | ||
1395 | 410 | >>> bqItem10 = getUtility(IBuildSet).getByBuildID( | 411 | >>> bqItem10 = getUtility(IBinaryPackageBuildSet).getByBuildID( |
1396 | 411 | ... 6).queueBuild() | 412 | ... 6).queueBuild() |
1398 | 412 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem10) | 413 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem10) |
1399 | 413 | 414 | ||
1400 | 414 | XXX: The pocket attribute is not intended to be changed in regular code, but | 415 | XXX: The pocket attribute is not intended to be changed in regular code, but |
1401 | 415 | for this test we want to change it on the fly. An alternative would be to add | 416 | for this test we want to change it on the fly. An alternative would be to add |
1402 | @@ -482,7 +483,7 @@ | |||
1403 | 482 | 0 | 483 | 0 |
1404 | 483 | >>> check_mail_sent(last_stub_mail_count) | 484 | >>> check_mail_sent(last_stub_mail_count) |
1405 | 484 | False | 485 | False |
1407 | 485 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem11) | 486 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem11) |
1408 | 486 | >>> print build.buildstate.title | 487 | >>> print build.buildstate.title |
1409 | 487 | Pending build | 488 | Pending build |
1410 | 488 | >>> job = bqItem11.specific_job.job | 489 | >>> job = bqItem11.specific_job.job |
1411 | @@ -498,7 +499,7 @@ | |||
1412 | 498 | investigate why this build end up built. (should never happen in real | 499 | investigate why this build end up built. (should never happen in real |
1413 | 499 | cases, and even so should be refused when we try to upload it.) | 500 | cases, and even so should be refused when we try to upload it.) |
1414 | 500 | 501 | ||
1416 | 501 | >>> bqItem12 = getUtility(IBuildSet).getByBuildID( | 502 | >>> bqItem12 = getUtility(IBinaryPackageBuildSet).getByBuildID( |
1417 | 502 | ... 2).queueBuild() | 503 | ... 2).queueBuild() |
1418 | 503 | >>> setupBuildQueue(bqItem12, a_builder) | 504 | >>> setupBuildQueue(bqItem12, a_builder) |
1419 | 504 | >>> last_stub_mail_count = len(stub.test_emails) | 505 | >>> last_stub_mail_count = len(stub.test_emails) |
1420 | @@ -519,7 +520,7 @@ | |||
1421 | 519 | The buildlog is collected and compressed locally using gzip algorithm, | 520 | The buildlog is collected and compressed locally using gzip algorithm, |
1422 | 520 | let's see how this method works: | 521 | let's see how this method works: |
1423 | 521 | 522 | ||
1425 | 522 | >>> bqItem10 = getUtility(IBuildSet).getByBuildID( | 523 | >>> bqItem10 = getUtility(IBinaryPackageBuildSet).getByBuildID( |
1426 | 523 | ... 6).queueBuild() | 524 | ... 6).queueBuild() |
1427 | 524 | >>> setupBuildQueue(bqItem10, a_builder) | 525 | >>> setupBuildQueue(bqItem10, a_builder) |
1428 | 525 | >>> bqItem10.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK')) | 526 | >>> bqItem10.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK')) |
1429 | @@ -696,7 +697,8 @@ | |||
1430 | 696 | tests. | 697 | tests. |
1431 | 697 | 698 | ||
1432 | 698 | >>> current_job = a_builder.currentjob | 699 | >>> current_job = a_builder.currentjob |
1434 | 699 | >>> resurrect_build = getUtility(IBuildSet).getByQueueEntry(current_job) | 700 | >>> resurrect_build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1435 | 701 | ... current_job) | ||
1436 | 700 | >>> resurrect_build.buildstate = BuildStatus.NEEDSBUILD | 702 | >>> resurrect_build.buildstate = BuildStatus.NEEDSBUILD |
1437 | 701 | >>> syncUpdate(resurrect_build) | 703 | >>> syncUpdate(resurrect_build) |
1438 | 702 | >>> current_job.builder = None | 704 | >>> current_job.builder = None |
1439 | @@ -708,7 +710,8 @@ | |||
1440 | 708 | corresponding build record as SUPERSEDED. | 710 | corresponding build record as SUPERSEDED. |
1441 | 709 | 711 | ||
1442 | 710 | >>> old_candidate = removeSecurityProxy(a_builder)._findBuildCandidate() | 712 | >>> old_candidate = removeSecurityProxy(a_builder)._findBuildCandidate() |
1444 | 711 | >>> build = getUtility(IBuildSet).getByQueueEntry(old_candidate) | 713 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1445 | 714 | ... old_candidate) | ||
1446 | 712 | >>> print build.buildstate.name | 715 | >>> print build.buildstate.name |
1447 | 713 | NEEDSBUILD | 716 | NEEDSBUILD |
1448 | 714 | 717 | ||
1449 | @@ -772,7 +775,7 @@ | |||
1450 | 772 | aside to convert these to unit-tests. | 775 | aside to convert these to unit-tests. |
1451 | 773 | 776 | ||
1452 | 774 | >>> naked_build = removeSecurityProxy( | 777 | >>> naked_build = removeSecurityProxy( |
1454 | 775 | ... getUtility(IBuildSet).getByQueueEntry(new_candidate)) | 778 | ... getUtility(IBinaryPackageBuildSet).getByQueueEntry(new_candidate)) |
1455 | 776 | >>> original_archive = naked_build.archive | 779 | >>> original_archive = naked_build.archive |
1456 | 777 | >>> secure_pub = naked_build.current_source_publication | 780 | >>> secure_pub = naked_build.current_source_publication |
1457 | 778 | >>> commit() | 781 | >>> commit() |
1458 | @@ -819,7 +822,8 @@ | |||
1459 | 819 | >>> commit() | 822 | >>> commit() |
1460 | 820 | >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser) | 823 | >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser) |
1461 | 821 | 824 | ||
1463 | 822 | >>> build = getUtility(IBuildSet).getByQueueEntry(current_job) | 825 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1464 | 826 | ... current_job) | ||
1465 | 823 | >>> print build.buildstate.name | 827 | >>> print build.buildstate.name |
1466 | 824 | NEEDSBUILD | 828 | NEEDSBUILD |
1467 | 825 | 829 | ||
1468 | @@ -1053,7 +1057,8 @@ | |||
1469 | 1053 | >>> commit() | 1057 | >>> commit() |
1470 | 1054 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') | 1058 | >>> LaunchpadZopelessLayer.switchDbUser('launchpad') |
1471 | 1055 | >>> login('foo.bar@canonical.com') | 1059 | >>> login('foo.bar@canonical.com') |
1473 | 1056 | >>> build = getUtility(IBuildSet).getByQueueEntry(candidate) | 1060 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1474 | 1061 | ... candidate) | ||
1475 | 1057 | >>> for build_file in build.sourcepackagerelease.files: | 1062 | >>> for build_file in build.sourcepackagerelease.files: |
1476 | 1058 | ... removeSecurityProxy(build_file).libraryfile.restricted = True | 1063 | ... removeSecurityProxy(build_file).libraryfile.restricted = True |
1477 | 1059 | >>> private_ppa = factory.makeArchive( | 1064 | >>> private_ppa = factory.makeArchive( |
1478 | @@ -1087,7 +1092,7 @@ | |||
1479 | 1087 | archive and not the one from the PPA, which on the absence of ancestry | 1092 | archive and not the one from the PPA, which on the absence of ancestry |
1480 | 1088 | defaults to 'universe'. | 1093 | defaults to 'universe'. |
1481 | 1089 | 1094 | ||
1483 | 1090 | >>> build = getUtility(IBuildSet).getByQueueEntry(candidate) | 1095 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(candidate) |
1484 | 1091 | >>> print build.current_component.name | 1096 | >>> print build.current_component.name |
1485 | 1092 | main | 1097 | main |
1486 | 1093 | 1098 | ||
1487 | @@ -1312,7 +1317,7 @@ | |||
1488 | 1312 | >>> a_builder.currentjob.destroySelf() | 1317 | >>> a_builder.currentjob.destroySelf() |
1489 | 1313 | 1318 | ||
1490 | 1314 | >>> bqItem3 = a_build.queueBuild() | 1319 | >>> bqItem3 = a_build.queueBuild() |
1492 | 1315 | >>> build = getUtility(IBuildSet).getByQueueEntry(bqItem3) | 1320 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem3) |
1493 | 1316 | >>> removeSecurityProxy(build).pocket = ( | 1321 | >>> removeSecurityProxy(build).pocket = ( |
1494 | 1317 | ... PackagePublishingPocket.UPDATES) | 1322 | ... PackagePublishingPocket.UPDATES) |
1495 | 1318 | >>> last_stub_mail_count = len(stub.test_emails) | 1323 | >>> last_stub_mail_count = len(stub.test_emails) |
1496 | 1319 | 1324 | ||
1497 | === modified file 'lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt' | |||
1498 | --- lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt 2009-11-15 19:52:54 +0000 | |||
1499 | +++ lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt 2010-04-13 06:59:32 +0000 | |||
1500 | @@ -28,7 +28,7 @@ | |||
1501 | 28 | 28 | ||
1502 | 29 | >>> from lp.soyuz.model.publishing import ( | 29 | >>> from lp.soyuz.model.publishing import ( |
1503 | 30 | ... BinaryPackagePublishingHistory) | 30 | ... BinaryPackagePublishingHistory) |
1505 | 31 | >>> from lp.soyuz.model.build import Build | 31 | >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1506 | 32 | >>> from lp.soyuz.model.component import Component | 32 | >>> from lp.soyuz.model.component import Component |
1507 | 33 | >>> from lp.soyuz.model.section import Section | 33 | >>> from lp.soyuz.model.section import Section |
1508 | 34 | >>> from canonical.database.constants import UTC_NOW | 34 | >>> from canonical.database.constants import UTC_NOW |
1509 | @@ -45,7 +45,7 @@ | |||
1510 | 45 | 45 | ||
1511 | 46 | XXX: noodles 2008-11-05 bug=294585: The dependency on a database id | 46 | XXX: noodles 2008-11-05 bug=294585: The dependency on a database id |
1512 | 47 | needs to be removed. | 47 | needs to be removed. |
1514 | 48 | >>> bpr = Build.get(8).createBinaryPackageRelease( | 48 | >>> bpr = BinaryPackageBuild.get(8).createBinaryPackageRelease( |
1515 | 49 | ... binarypackagename=firefox_name.id, | 49 | ... binarypackagename=firefox_name.id, |
1516 | 50 | ... version="120.6-0", | 50 | ... version="120.6-0", |
1517 | 51 | ... summary="Firefox loves lollies", | 51 | ... summary="Firefox loves lollies", |
1518 | @@ -86,7 +86,7 @@ | |||
1519 | 86 | 86 | ||
1520 | 87 | XXX: noodles 2008-11-06 bug=294585: The dependency on a database id | 87 | XXX: noodles 2008-11-06 bug=294585: The dependency on a database id |
1521 | 88 | needs to be removed. | 88 | needs to be removed. |
1523 | 89 | >>> bpr = Build.get(9).createBinaryPackageRelease( | 89 | >>> bpr = BinaryPackageBuild.get(9).createBinaryPackageRelease( |
1524 | 90 | ... binarypackagename=pmount_name.id, | 90 | ... binarypackagename=pmount_name.id, |
1525 | 91 | ... version="cr98.34", | 91 | ... version="cr98.34", |
1526 | 92 | ... summary="Pmount bakes cakes", | 92 | ... summary="Pmount bakes cakes", |
1527 | 93 | 93 | ||
1528 | === modified file 'lib/lp/soyuz/doc/gina-multiple-arch.txt' | |||
1529 | --- lib/lp/soyuz/doc/gina-multiple-arch.txt 2009-11-15 19:52:54 +0000 | |||
1530 | +++ lib/lp/soyuz/doc/gina-multiple-arch.txt 2010-04-13 06:59:32 +0000 | |||
1531 | @@ -9,7 +9,7 @@ | |||
1532 | 9 | ... BinaryPackagePublishingHistory, | 9 | ... BinaryPackagePublishingHistory, |
1533 | 10 | ... EmailAddress, | 10 | ... EmailAddress, |
1534 | 11 | ... BinaryPackageRelease, | 11 | ... BinaryPackageRelease, |
1536 | 12 | ... Build) | 12 | ... BinaryPackageBuild) |
1537 | 13 | >>> from lp.registry.model.person import Person, WikiName | 13 | >>> from lp.registry.model.person import Person, WikiName |
1538 | 14 | >>> from lp.registry.model.teammembership import TeamParticipation | 14 | >>> from lp.registry.model.teammembership import TeamParticipation |
1539 | 15 | >>> SSPPH = SourcePackagePublishingHistory | 15 | >>> SSPPH = SourcePackagePublishingHistory |
1540 | @@ -22,7 +22,7 @@ | |||
1541 | 22 | >>> orig_email_count = EmailAddress.select().count() | 22 | >>> orig_email_count = EmailAddress.select().count() |
1542 | 23 | >>> orig_wiki_count = WikiName.select().count() | 23 | >>> orig_wiki_count = WikiName.select().count() |
1543 | 24 | >>> orig_bpr_count = BinaryPackageRelease.select().count() | 24 | >>> orig_bpr_count = BinaryPackageRelease.select().count() |
1545 | 25 | >>> orig_build_count = Build.select().count() | 25 | >>> orig_build_count = BinaryPackageBuild.select().count() |
1546 | 26 | >>> orig_sbpph_count = SBPPH.select().count() | 26 | >>> orig_sbpph_count = SBPPH.select().count() |
1547 | 27 | 27 | ||
1548 | 28 | Create a distribution series and an arch series for dapper: | 28 | Create a distribution series and an arch series for dapper: |
1549 | @@ -142,7 +142,7 @@ | |||
1550 | 142 | 142 | ||
1551 | 143 | >>> print Person.select().count() - orig_person_count | 143 | >>> print Person.select().count() - orig_person_count |
1552 | 144 | 2 | 144 | 2 |
1554 | 145 | >>> print TeamParticipation.select().count() - orig_tp_count | 145 | >>> print TeamParticipation.select().count() - orig_tp_count |
1555 | 146 | 2 | 146 | 2 |
1556 | 147 | >>> print EmailAddress.select().count() - orig_email_count | 147 | >>> print EmailAddress.select().count() - orig_email_count |
1557 | 148 | 2 | 148 | 2 |
1558 | @@ -153,7 +153,7 @@ | |||
1559 | 153 | 153 | ||
1560 | 154 | >>> BinaryPackageRelease.select().count() - orig_bpr_count | 154 | >>> BinaryPackageRelease.select().count() - orig_bpr_count |
1561 | 155 | 4 | 155 | 4 |
1563 | 156 | >>> Build.select().count() - orig_build_count | 156 | >>> BinaryPackageBuild.select().count() - orig_build_count |
1564 | 157 | 2 | 157 | 2 |
1565 | 158 | >>> SBPPH.select().count() - orig_sbpph_count | 158 | >>> SBPPH.select().count() - orig_sbpph_count |
1566 | 159 | 4 | 159 | 4 |
1567 | 160 | 160 | ||
1568 | === modified file 'lib/lp/soyuz/doc/gina.txt' | |||
1569 | --- lib/lp/soyuz/doc/gina.txt 2010-04-05 18:18:20 +0000 | |||
1570 | +++ lib/lp/soyuz/doc/gina.txt 2010-04-13 06:59:32 +0000 | |||
1571 | @@ -13,7 +13,7 @@ | |||
1572 | 13 | ... BinaryPackagePublishingHistory, | 13 | ... BinaryPackagePublishingHistory, |
1573 | 14 | ... EmailAddress, | 14 | ... EmailAddress, |
1574 | 15 | ... BinaryPackageRelease, | 15 | ... BinaryPackageRelease, |
1576 | 16 | ... Build) | 16 | ... BinaryPackageBuild) |
1577 | 17 | >>> from lp.registry.model.person import Person, WikiName | 17 | >>> from lp.registry.model.person import Person, WikiName |
1578 | 18 | >>> from lp.registry.model.teammembership import TeamParticipation | 18 | >>> from lp.registry.model.teammembership import TeamParticipation |
1579 | 19 | >>> from lp.registry.interfaces.pocket import ( | 19 | >>> from lp.registry.interfaces.pocket import ( |
1580 | @@ -28,7 +28,7 @@ | |||
1581 | 28 | >>> orig_email_count = EmailAddress.select().count() | 28 | >>> orig_email_count = EmailAddress.select().count() |
1582 | 29 | >>> orig_wiki_count = WikiName.select().count() | 29 | >>> orig_wiki_count = WikiName.select().count() |
1583 | 30 | >>> orig_bpr_count = BinaryPackageRelease.select().count() | 30 | >>> orig_bpr_count = BinaryPackageRelease.select().count() |
1585 | 31 | >>> orig_build_count = Build.select().count() | 31 | >>> orig_build_count = BinaryPackageBuild.select().count() |
1586 | 32 | >>> orig_sbpph_count = SBPPH.select().count() | 32 | >>> orig_sbpph_count = SBPPH.select().count() |
1587 | 33 | >>> orig_sspph_main_count = SSPPH.selectBy( | 33 | >>> orig_sspph_main_count = SSPPH.selectBy( |
1588 | 34 | ... componentID=1, pocket=PackagePublishingPocket.RELEASE).count() | 34 | ... componentID=1, pocket=PackagePublishingPocket.RELEASE).count() |
1589 | @@ -338,7 +338,7 @@ | |||
1590 | 338 | 338 | ||
1591 | 339 | >>> BinaryPackageRelease.select().count() - orig_bpr_count | 339 | >>> BinaryPackageRelease.select().count() - orig_bpr_count |
1592 | 340 | 40 | 340 | 40 |
1594 | 341 | >>> Build.select().count() - orig_build_count | 341 | >>> BinaryPackageBuild.select().count() - orig_build_count |
1595 | 342 | 13 | 342 | 13 |
1596 | 343 | >>> SBPPH.select().count() - orig_sbpph_count | 343 | >>> SBPPH.select().count() - orig_sbpph_count |
1597 | 344 | 46 | 344 | 46 |
1598 | @@ -526,7 +526,7 @@ | |||
1599 | 526 | 13 | 526 | 13 |
1600 | 527 | >>> BinaryPackageRelease.select().count() - orig_bpr_count | 527 | >>> BinaryPackageRelease.select().count() - orig_bpr_count |
1601 | 528 | 40 | 528 | 40 |
1603 | 529 | >>> Build.select().count() - orig_build_count | 529 | >>> BinaryPackageBuild.select().count() - orig_build_count |
1604 | 530 | 13 | 530 | 13 |
1605 | 531 | 531 | ||
1606 | 532 | But the overrides do generate extra publishing entries: | 532 | But the overrides do generate extra publishing entries: |
1607 | 533 | 533 | ||
1608 | === modified file 'lib/lp/soyuz/doc/queuebuilder.txt' | |||
1609 | --- lib/lp/soyuz/doc/queuebuilder.txt 2010-03-24 07:17:20 +0000 | |||
1610 | +++ lib/lp/soyuz/doc/queuebuilder.txt 2010-04-13 06:59:32 +0000 | |||
1611 | @@ -22,7 +22,7 @@ | |||
1612 | 22 | >>> from lp.registry.model.distroseries import DistroSeries | 22 | >>> from lp.registry.model.distroseries import DistroSeries |
1613 | 23 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket | 23 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket |
1614 | 24 | >>> from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 24 | >>> from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
1616 | 25 | >>> from lp.soyuz.model.build import Build | 25 | >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1617 | 26 | >>> from lp.soyuz.model.distroarchseries import ( | 26 | >>> from lp.soyuz.model.distroarchseries import ( |
1618 | 27 | ... DistroArchSeries, PocketChroot) | 27 | ... DistroArchSeries, PocketChroot) |
1619 | 28 | 28 | ||
1620 | @@ -119,7 +119,7 @@ | |||
1621 | 119 | 119 | ||
1622 | 120 | Store current status of the database: | 120 | Store current status of the database: |
1623 | 121 | 121 | ||
1625 | 122 | >>> old_build_ids = [build.id for build in Build.select()] | 122 | >>> old_build_ids = [build.id for build in BinaryPackageBuild.select()] |
1626 | 123 | >>> old_job_ids = [build_queue.id for build_queue in BuildQueue.select()] | 123 | >>> old_job_ids = [build_queue.id for build_queue in BuildQueue.select()] |
1627 | 124 | 124 | ||
1628 | 125 | 125 | ||
1629 | @@ -233,7 +233,8 @@ | |||
1630 | 233 | ... hoary, PackagePublishingPocket.RELEASE, warty.main_archive) | 233 | ... hoary, PackagePublishingPocket.RELEASE, warty.main_archive) |
1631 | 234 | 234 | ||
1632 | 235 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus | 235 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
1634 | 236 | >>> from lp.soyuz.interfaces.build import IBuildSet | 236 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
1635 | 237 | ... IBinaryPackageBuildSet) | ||
1636 | 237 | >>> failed_build = pub_failed.sourcepackagerelease.createBuild( | 238 | >>> failed_build = pub_failed.sourcepackagerelease.createBuild( |
1637 | 238 | ... warty['i386'], PackagePublishingPocket.RELEASE, | 239 | ... warty['i386'], PackagePublishingPocket.RELEASE, |
1638 | 239 | ... warty.main_archive, status=BuildStatus.FAILEDTOBUILD) | 240 | ... warty.main_archive, status=BuildStatus.FAILEDTOBUILD) |
1639 | @@ -306,7 +307,7 @@ | |||
1640 | 306 | 307 | ||
1641 | 307 | Check that we only created new Build entries for the new hoary releases: | 308 | Check that we only created new Build entries for the new hoary releases: |
1642 | 308 | 309 | ||
1644 | 309 | >>> new_builds = [build for build in Build.select() | 310 | >>> new_builds = [build for build in BinaryPackageBuild.select() |
1645 | 310 | ... if build.id not in old_build_ids] | 311 | ... if build.id not in old_build_ids] |
1646 | 311 | >>> for build in sorted(new_builds, key=operator.attrgetter('id')): | 312 | >>> for build in sorted(new_builds, key=operator.attrgetter('id')): |
1647 | 312 | ... print build.title | 313 | ... print build.title |
1648 | @@ -324,7 +325,7 @@ | |||
1649 | 324 | 325 | ||
1650 | 325 | And have a look at our architecture-independent-source's build: | 326 | And have a look at our architecture-independent-source's build: |
1651 | 326 | 327 | ||
1653 | 327 | >>> arch_indep_build = Build.selectOneBy( | 328 | >>> arch_indep_build = BinaryPackageBuild.selectOneBy( |
1654 | 328 | ... sourcepackagerelease=pub_all.sourcepackagerelease) | 329 | ... sourcepackagerelease=pub_all.sourcepackagerelease) |
1655 | 329 | 330 | ||
1656 | 330 | >>> print arch_indep_build.title | 331 | >>> print arch_indep_build.title |
1657 | @@ -347,7 +348,8 @@ | |||
1658 | 347 | happen in parallel with build creation. | 348 | happen in parallel with build creation. |
1659 | 348 | 349 | ||
1660 | 349 | >>> build_queue = active_jobs[0] | 350 | >>> build_queue = active_jobs[0] |
1662 | 350 | >>> build = getUtility(IBuildSet).getByQueueEntry(build_queue) | 351 | >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1663 | 352 | ... build_queue) | ||
1664 | 351 | >>> print build.title | 353 | >>> print build.title |
1665 | 352 | i386 build of test-buildd 667 in ubuntu hoary RELEASE | 354 | i386 build of test-buildd 667 in ubuntu hoary RELEASE |
1666 | 353 | >>> build_queue.lastscore | 355 | >>> build_queue.lastscore |
1667 | @@ -364,7 +366,8 @@ | |||
1668 | 364 | Missing BuildQueue records, resulting from given-back builds, are | 366 | Missing BuildQueue records, resulting from given-back builds, are |
1669 | 365 | created in the last stage of the queue-builder script. | 367 | created in the last stage of the queue-builder script. |
1670 | 366 | 368 | ||
1672 | 367 | >>> given_back_build = getUtility(IBuildSet).getByQueueEntry(build_queue) | 369 | >>> given_back_build = getUtility(IBinaryPackageBuildSet).getByQueueEntry( |
1673 | 370 | ... build_queue) | ||
1674 | 368 | >>> build_queue.destroySelf() | 371 | >>> build_queue.destroySelf() |
1675 | 369 | >>> flush_database_updates() | 372 | >>> flush_database_updates() |
1676 | 370 | 373 | ||
1677 | 371 | 374 | ||
1678 | === modified file 'lib/lp/soyuz/doc/sourcepackagerelease.txt' | |||
1679 | --- lib/lp/soyuz/doc/sourcepackagerelease.txt 2010-03-20 23:16:42 +0000 | |||
1680 | +++ lib/lp/soyuz/doc/sourcepackagerelease.txt 2010-04-13 06:59:32 +0000 | |||
1681 | @@ -61,9 +61,9 @@ | |||
1682 | 61 | property only returns the non-PPA builds. | 61 | property only returns the non-PPA builds. |
1683 | 62 | 62 | ||
1684 | 63 | >>> from canonical.launchpad.interfaces import IPersonSet | 63 | >>> from canonical.launchpad.interfaces import IPersonSet |
1686 | 64 | >>> from lp.soyuz.model.build import Build | 64 | >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1687 | 65 | >>> cprov_ppa = getUtility(IPersonSet).getByName('cprov').archive | 65 | >>> cprov_ppa = getUtility(IPersonSet).getByName('cprov').archive |
1689 | 66 | >>> ff_ppa_build = Build.selectBy( | 66 | >>> ff_ppa_build = BinaryPackageBuild.selectBy( |
1690 | 67 | ... archive=cprov_ppa, sourcepackagerelease=spr) | 67 | ... archive=cprov_ppa, sourcepackagerelease=spr) |
1691 | 68 | >>> ff_ppa_build.count() | 68 | >>> ff_ppa_build.count() |
1692 | 69 | 1 | 69 | 1 |
1693 | 70 | 70 | ||
1694 | === modified file 'lib/lp/soyuz/doc/soyuz-set-of-uploads.txt' | |||
1695 | --- lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2010-03-06 04:57:40 +0000 | |||
1696 | +++ lib/lp/soyuz/doc/soyuz-set-of-uploads.txt 2010-04-13 06:59:32 +0000 | |||
1697 | @@ -39,7 +39,7 @@ | |||
1698 | 39 | 4. A changes file that enumerates all the files in the upload, with | 39 | 4. A changes file that enumerates all the files in the upload, with |
1699 | 40 | correct md5 sum and file sizes. | 40 | correct md5 sum and file sizes. |
1700 | 41 | 5. Actual files uploaded that match the ones described in the changes file. | 41 | 5. Actual files uploaded that match the ones described in the changes file. |
1702 | 42 | 42 | ||
1703 | 43 | If (1) is not available, the upload silently fails. | 43 | If (1) is not available, the upload silently fails. |
1704 | 44 | If (2) is not available, the upload silently fails. | 44 | If (2) is not available, the upload silently fails. |
1705 | 45 | If (3) or (4) is not available, the upload is rejected immediately with | 45 | If (3) or (4) is not available, the upload is rejected immediately with |
1706 | @@ -623,12 +623,12 @@ | |||
1707 | 623 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus | 623 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
1708 | 624 | >>> from lp.registry.model.sourcepackagename import SourcePackageName | 624 | >>> from lp.registry.model.sourcepackagename import SourcePackageName |
1709 | 625 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket | 625 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket |
1711 | 626 | >>> from lp.soyuz.model.build import Build | 626 | >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1712 | 627 | >>> from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease | 627 | >>> from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease |
1713 | 628 | >>> spn = SourcePackageName.selectOneBy(name="baz") | 628 | >>> spn = SourcePackageName.selectOneBy(name="baz") |
1714 | 629 | >>> spr = SourcePackageRelease.selectOneBy(sourcepackagenameID=spn.id) | 629 | >>> spr = SourcePackageRelease.selectOneBy(sourcepackagenameID=spn.id) |
1715 | 630 | >>> spr_id = spr.id | 630 | >>> spr_id = spr.id |
1717 | 631 | >>> builds = Build.selectBy(sourcepackagereleaseID=spr_id) | 631 | >>> builds = BinaryPackageBuild.selectBy(sourcepackagereleaseID=spr_id) |
1718 | 632 | >>> len(list(builds)) | 632 | >>> len(list(builds)) |
1719 | 633 | 0 | 633 | 0 |
1720 | 634 | 634 | ||
1721 | @@ -642,7 +642,7 @@ | |||
1722 | 642 | 642 | ||
1723 | 643 | Check build created | 643 | Check build created |
1724 | 644 | 644 | ||
1726 | 645 | >>> len(list(Build.selectBy(sourcepackagereleaseID=spr_id))) | 645 | >>> len(list(BinaryPackageBuild.selectBy(sourcepackagereleaseID=spr_id))) |
1727 | 646 | 1 | 646 | 1 |
1728 | 647 | 647 | ||
1729 | 648 | Upload the i386 binary: | 648 | Upload the i386 binary: |
1730 | @@ -656,7 +656,8 @@ | |||
1731 | 656 | >>> from canonical.database.sqlbase import clear_current_connection_cache | 656 | >>> from canonical.database.sqlbase import clear_current_connection_cache |
1732 | 657 | >>> clear_current_connection_cache() | 657 | >>> clear_current_connection_cache() |
1733 | 658 | 658 | ||
1735 | 659 | >>> builds = list(Build.selectBy(sourcepackagereleaseID=spr_id)) | 659 | >>> builds = list(BinaryPackageBuild.selectBy( |
1736 | 660 | ... sourcepackagereleaseID=spr_id)) | ||
1737 | 660 | >>> len(builds) | 661 | >>> len(builds) |
1738 | 661 | 1 | 662 | 1 |
1739 | 662 | >>> builds[0].buildstate == BuildStatus.FULLYBUILT | 663 | >>> builds[0].buildstate == BuildStatus.FULLYBUILT |
1740 | 663 | 664 | ||
1741 | === renamed file 'lib/lp/soyuz/interfaces/build.py' => 'lib/lp/soyuz/interfaces/binarypackagebuild.py' | |||
1742 | --- lib/lp/soyuz/interfaces/build.py 2010-04-03 03:29:23 +0000 | |||
1743 | +++ lib/lp/soyuz/interfaces/binarypackagebuild.py 2010-04-13 06:59:32 +0000 | |||
1744 | @@ -3,16 +3,16 @@ | |||
1745 | 3 | 3 | ||
1746 | 4 | # pylint: disable-msg=E0211,E0213 | 4 | # pylint: disable-msg=E0211,E0213 |
1747 | 5 | 5 | ||
1749 | 6 | """Build interfaces.""" | 6 | """BinaryPackageBuild interfaces.""" |
1750 | 7 | 7 | ||
1751 | 8 | __metaclass__ = type | 8 | __metaclass__ = type |
1752 | 9 | 9 | ||
1753 | 10 | __all__ = [ | 10 | __all__ = [ |
1754 | 11 | 'BuildSetStatus', | 11 | 'BuildSetStatus', |
1755 | 12 | 'CannotBeRescored', | 12 | 'CannotBeRescored', |
1757 | 13 | 'IBuild', | 13 | 'IBinaryPackageBuild', |
1758 | 14 | 'IBuildRescoreForm', | 14 | 'IBuildRescoreForm', |
1760 | 15 | 'IBuildSet', | 15 | 'IBinaryPackageBuildSet', |
1761 | 16 | ] | 16 | ] |
1762 | 17 | 17 | ||
1763 | 18 | from zope.interface import Interface, Attribute | 18 | from zope.interface import Interface, Attribute |
1764 | @@ -38,7 +38,7 @@ | |||
1765 | 38 | _message_prefix = "Cannot rescore build" | 38 | _message_prefix = "Cannot rescore build" |
1766 | 39 | 39 | ||
1767 | 40 | 40 | ||
1769 | 41 | class IBuildView(IBuildBase): | 41 | class IBinaryPackageBuildView(IBuildBase): |
1770 | 42 | """A Build interface for items requiring launchpad.View.""" | 42 | """A Build interface for items requiring launchpad.View.""" |
1771 | 43 | id = Int(title=_('ID'), required=True, readonly=True) | 43 | id = Int(title=_('ID'), required=True, readonly=True) |
1772 | 44 | 44 | ||
1773 | @@ -151,7 +151,7 @@ | |||
1774 | 151 | """ | 151 | """ |
1775 | 152 | 152 | ||
1776 | 153 | 153 | ||
1778 | 154 | class IBuildEdit(Interface): | 154 | class IBinaryPackageBuildEdit(Interface): |
1779 | 155 | """A Build interface for items requiring launchpad.Edit.""" | 155 | """A Build interface for items requiring launchpad.Edit.""" |
1780 | 156 | 156 | ||
1781 | 157 | @export_write_operation() | 157 | @export_write_operation() |
1782 | @@ -163,7 +163,7 @@ | |||
1783 | 163 | """ | 163 | """ |
1784 | 164 | 164 | ||
1785 | 165 | 165 | ||
1787 | 166 | class IBuildAdmin(Interface): | 166 | class IBinaryPackageBuildAdmin(Interface): |
1788 | 167 | """A Build interface for items requiring launchpad.Admin.""" | 167 | """A Build interface for items requiring launchpad.Admin.""" |
1789 | 168 | 168 | ||
1790 | 169 | @operation_parameters(score=Int(title=_("Score"), required=True)) | 169 | @operation_parameters(score=Int(title=_("Score"), required=True)) |
1791 | @@ -172,9 +172,11 @@ | |||
1792 | 172 | """Change the build's score.""" | 172 | """Change the build's score.""" |
1793 | 173 | 173 | ||
1794 | 174 | 174 | ||
1796 | 175 | class IBuild(IBuildView, IBuildEdit, IBuildAdmin): | 175 | class IBinaryPackageBuild( |
1797 | 176 | IBinaryPackageBuildView, IBinaryPackageBuildEdit, | ||
1798 | 177 | IBinaryPackageBuildAdmin): | ||
1799 | 176 | """A Build interface""" | 178 | """A Build interface""" |
1801 | 177 | export_as_webservice_entry() | 179 | export_as_webservice_entry(singular_name='build', plural_name='builds') |
1802 | 178 | 180 | ||
1803 | 179 | 181 | ||
1804 | 180 | class BuildSetStatus(EnumeratedType): | 182 | class BuildSetStatus(EnumeratedType): |
1805 | @@ -208,8 +210,8 @@ | |||
1806 | 208 | description="There are some builds currently building.") | 210 | description="There are some builds currently building.") |
1807 | 209 | 211 | ||
1808 | 210 | 212 | ||
1811 | 211 | class IBuildSet(Interface): | 213 | class IBinaryPackageBuildSet(Interface): |
1812 | 212 | """Interface for BuildSet""" | 214 | """Interface for BinaryPackageBuildSet""" |
1813 | 213 | 215 | ||
1814 | 214 | def getBuildBySRAndArchtag(sourcepackagereleaseID, archtag): | 216 | def getBuildBySRAndArchtag(sourcepackagereleaseID, archtag): |
1815 | 215 | """Return a build for a SourcePackageRelease and an ArchTag""" | 217 | """Return a build for a SourcePackageRelease and an ArchTag""" |
1816 | 216 | 218 | ||
1817 | === modified file 'lib/lp/soyuz/interfaces/buildfarmbuildjob.py' | |||
1818 | --- lib/lp/soyuz/interfaces/buildfarmbuildjob.py 2010-03-16 05:08:47 +0000 | |||
1819 | +++ lib/lp/soyuz/interfaces/buildfarmbuildjob.py 2010-04-13 06:59:32 +0000 | |||
1820 | @@ -11,11 +11,11 @@ | |||
1821 | 11 | from canonical.launchpad import _ | 11 | from canonical.launchpad import _ |
1822 | 12 | from lazr.restful.fields import Reference | 12 | from lazr.restful.fields import Reference |
1823 | 13 | from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob | 13 | from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob |
1825 | 14 | from lp.soyuz.interfaces.build import IBuild | 14 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
1826 | 15 | 15 | ||
1827 | 16 | 16 | ||
1828 | 17 | class IBuildFarmBuildJob(IBuildFarmJob): | 17 | class IBuildFarmBuildJob(IBuildFarmJob): |
1829 | 18 | """An `IBuildFarmJob` with an `IBuild` reference.""" | 18 | """An `IBuildFarmJob` with an `IBuild` reference.""" |
1830 | 19 | build = Reference( | 19 | build = Reference( |
1832 | 20 | IBuild, title=_("Build"), required=True, readonly=True, | 20 | IBinaryPackageBuild, title=_("Build"), required=True, readonly=True, |
1833 | 21 | description=_("Build record associated with this job.")) | 21 | description=_("Build record associated with this job.")) |
1834 | 22 | 22 | ||
1835 | === modified file 'lib/lp/soyuz/interfaces/buildpackagejob.py' | |||
1836 | --- lib/lp/soyuz/interfaces/buildpackagejob.py 2010-03-16 05:08:47 +0000 | |||
1837 | +++ lib/lp/soyuz/interfaces/buildpackagejob.py 2010-04-13 06:59:32 +0000 | |||
1838 | @@ -16,7 +16,7 @@ | |||
1839 | 16 | from canonical.launchpad import _ | 16 | from canonical.launchpad import _ |
1840 | 17 | from lazr.restful.fields import Reference | 17 | from lazr.restful.fields import Reference |
1841 | 18 | from lp.services.job.interfaces.job import IJob | 18 | from lp.services.job.interfaces.job import IJob |
1843 | 19 | from lp.soyuz.interfaces.build import IBuild | 19 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuild |
1844 | 20 | from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob | 20 | from lp.soyuz.interfaces.buildfarmbuildjob import IBuildFarmBuildJob |
1845 | 21 | 21 | ||
1846 | 22 | 22 | ||
1847 | @@ -30,6 +30,6 @@ | |||
1848 | 30 | description=_("Data common to all job types.")) | 30 | description=_("Data common to all job types.")) |
1849 | 31 | 31 | ||
1850 | 32 | build = Reference( | 32 | build = Reference( |
1852 | 33 | IBuild, title=_("Build"), | 33 | IBinaryPackageBuild, title=_("Build"), |
1853 | 34 | required=True, readonly=True, | 34 | required=True, readonly=True, |
1854 | 35 | description=_("Build record associated with this job.")) | 35 | description=_("Build record associated with this job.")) |
1855 | 36 | 36 | ||
1856 | === modified file 'lib/lp/soyuz/model/archive.py' | |||
1857 | --- lib/lp/soyuz/model/archive.py 2010-04-08 02:35:06 +0000 | |||
1858 | +++ lib/lp/soyuz/model/archive.py 2010-04-13 06:59:32 +0000 | |||
1859 | @@ -42,7 +42,7 @@ | |||
1860 | 42 | from lp.soyuz.model.archivesubscriber import ArchiveSubscriber | 42 | from lp.soyuz.model.archivesubscriber import ArchiveSubscriber |
1861 | 43 | from lp.soyuz.model.binarypackagerelease import ( | 43 | from lp.soyuz.model.binarypackagerelease import ( |
1862 | 44 | BinaryPackageReleaseDownloadCount) | 44 | BinaryPackageReleaseDownloadCount) |
1864 | 45 | from lp.soyuz.model.build import Build | 45 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1865 | 46 | from lp.soyuz.model.distributionsourcepackagecache import ( | 46 | from lp.soyuz.model.distributionsourcepackagecache import ( |
1866 | 47 | DistributionSourcePackageCache) | 47 | DistributionSourcePackageCache) |
1867 | 48 | from lp.soyuz.model.distroseriespackagecache import DistroSeriesPackageCache | 48 | from lp.soyuz.model.distroseriespackagecache import DistroSeriesPackageCache |
1868 | @@ -71,7 +71,7 @@ | |||
1869 | 71 | from lp.soyuz.interfaces.archivesubscriber import ( | 71 | from lp.soyuz.interfaces.archivesubscriber import ( |
1870 | 72 | ArchiveSubscriberStatus, IArchiveSubscriberSet, ArchiveSubscriptionError) | 72 | ArchiveSubscriberStatus, IArchiveSubscriberSet, ArchiveSubscriptionError) |
1871 | 73 | from lp.soyuz.interfaces.binarypackagerelease import BinaryPackageFileType | 73 | from lp.soyuz.interfaces.binarypackagerelease import BinaryPackageFileType |
1873 | 74 | from lp.soyuz.interfaces.build import IBuildSet | 74 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
1874 | 75 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 75 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
1875 | 76 | from lp.soyuz.interfaces.component import IComponent, IComponentSet | 76 | from lp.soyuz.interfaces.component import IComponent, IComponentSet |
1876 | 77 | from lp.registry.interfaces.distroseries import IDistroSeriesSet | 77 | from lp.registry.interfaces.distroseries import IDistroSeriesSet |
1877 | @@ -211,7 +211,7 @@ | |||
1878 | 211 | for (family, archive_arch) in restricted_families: | 211 | for (family, archive_arch) in restricted_families: |
1879 | 212 | if family == arm: | 212 | if family == arm: |
1880 | 213 | return (archive_arch is not None) | 213 | return (archive_arch is not None) |
1882 | 214 | # ARM doesn't exist or isn't restricted. Either way, there is no | 214 | # ARM doesn't exist or isn't restricted. Either way, there is no |
1883 | 215 | # need for an explicit association. | 215 | # need for an explicit association. |
1884 | 216 | return False | 216 | return False |
1885 | 217 | 217 | ||
1886 | @@ -358,7 +358,7 @@ | |||
1887 | 358 | """See IHasBuildRecords""" | 358 | """See IHasBuildRecords""" |
1888 | 359 | # Ignore "user", since anyone already accessing this archive | 359 | # Ignore "user", since anyone already accessing this archive |
1889 | 360 | # will implicitly have permission to see it. | 360 | # will implicitly have permission to see it. |
1891 | 361 | return getUtility(IBuildSet).getBuildsForArchive( | 361 | return getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
1892 | 362 | self, build_state, name, pocket, arch_tag) | 362 | self, build_state, name, pocket, arch_tag) |
1893 | 363 | 363 | ||
1894 | 364 | def getPublishedSources(self, name=None, version=None, status=None, | 364 | def getPublishedSources(self, name=None, version=None, status=None, |
1895 | @@ -873,17 +873,19 @@ | |||
1896 | 873 | store = Store.of(self) | 873 | store = Store.of(self) |
1897 | 874 | extra_exprs = [] | 874 | extra_exprs = [] |
1898 | 875 | if not include_needsbuild: | 875 | if not include_needsbuild: |
1900 | 876 | extra_exprs.append(Build.buildstate != BuildStatus.NEEDSBUILD) | 876 | extra_exprs.append( |
1901 | 877 | BinaryPackageBuild.buildstate != BuildStatus.NEEDSBUILD) | ||
1902 | 877 | 878 | ||
1903 | 878 | find_spec = ( | 879 | find_spec = ( |
1906 | 879 | Build.buildstate, | 880 | BinaryPackageBuild.buildstate, |
1907 | 880 | Count(Build.id) | 881 | Count(BinaryPackageBuild.id) |
1908 | 881 | ) | 882 | ) |
1910 | 882 | result = store.using(Build).find( | 883 | result = store.using(BinaryPackageBuild).find( |
1911 | 883 | find_spec, | 884 | find_spec, |
1913 | 884 | Build.archive == self, | 885 | BinaryPackageBuild.archive == self, |
1914 | 885 | *extra_exprs | 886 | *extra_exprs |
1916 | 886 | ).group_by(Build.buildstate).order_by(Build.buildstate) | 887 | ).group_by(BinaryPackageBuild.buildstate).order_by( |
1917 | 888 | BinaryPackageBuild.buildstate) | ||
1918 | 887 | 889 | ||
1919 | 888 | # Create a map for each count summary to a number of buildstates: | 890 | # Create a map for each count summary to a number of buildstates: |
1920 | 889 | count_map = { | 891 | count_map = { |
1921 | @@ -1137,8 +1139,8 @@ | |||
1922 | 1137 | BinaryPackageRelease, | 1139 | BinaryPackageRelease, |
1923 | 1138 | BinaryPackageRelease.binarypackagename == name, | 1140 | BinaryPackageRelease.binarypackagename == name, |
1924 | 1139 | BinaryPackageRelease.version == version, | 1141 | BinaryPackageRelease.version == version, |
1927 | 1140 | Build.id == BinaryPackageRelease.buildID, | 1142 | BinaryPackageBuild.id == BinaryPackageRelease.buildID, |
1928 | 1141 | DistroArchSeries.id == Build.distroarchseriesID, | 1143 | DistroArchSeries.id == BinaryPackageBuild.distroarchseriesID, |
1929 | 1142 | DistroArchSeries.architecturetag == archtag, | 1144 | DistroArchSeries.architecturetag == archtag, |
1930 | 1143 | BinaryPackagePublishingHistory.archive == self, | 1145 | BinaryPackagePublishingHistory.archive == self, |
1931 | 1144 | BinaryPackagePublishingHistory.binarypackagereleaseID == | 1146 | BinaryPackagePublishingHistory.binarypackagereleaseID == |
1932 | @@ -1335,12 +1337,13 @@ | |||
1933 | 1335 | 1337 | ||
1934 | 1336 | extra_exprs = [] | 1338 | extra_exprs = [] |
1935 | 1337 | if build_status is not None: | 1339 | if build_status is not None: |
1937 | 1338 | extra_exprs.append(Build.buildstate == build_status) | 1340 | extra_exprs.append(BinaryPackageBuild.buildstate == build_status) |
1938 | 1339 | 1341 | ||
1939 | 1340 | result_set = store.find( | 1342 | result_set = store.find( |
1940 | 1341 | SourcePackageRelease, | 1343 | SourcePackageRelease, |
1943 | 1342 | Build.sourcepackagereleaseID == SourcePackageRelease.id, | 1344 | (BinaryPackageBuild.sourcepackagereleaseID == |
1944 | 1343 | Build.archive == self, | 1345 | SourcePackageRelease.id), |
1945 | 1346 | BinaryPackageBuild.archive == self, | ||
1946 | 1344 | *extra_exprs) | 1347 | *extra_exprs) |
1947 | 1345 | 1348 | ||
1948 | 1346 | result_set.config(distinct=True).order_by(SourcePackageRelease.id) | 1349 | result_set.config(distinct=True).order_by(SourcePackageRelease.id) |
1949 | 1347 | 1350 | ||
1950 | === renamed file 'lib/lp/soyuz/model/build.py' => 'lib/lp/soyuz/model/binarypackagebuild.py' | |||
1951 | --- lib/lp/soyuz/model/build.py 2010-03-07 04:06:22 +0000 | |||
1952 | +++ lib/lp/soyuz/model/binarypackagebuild.py 2010-04-13 06:59:32 +0000 | |||
1953 | @@ -4,7 +4,7 @@ | |||
1954 | 4 | # pylint: disable-msg=E0611,W0212 | 4 | # pylint: disable-msg=E0611,W0212 |
1955 | 5 | 5 | ||
1956 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
1958 | 7 | __all__ = ['Build', 'BuildSet'] | 7 | __all__ = ['BinaryPackageBuild', 'BinaryPackageBuildSet'] |
1959 | 8 | 8 | ||
1960 | 9 | import apt_pkg | 9 | import apt_pkg |
1961 | 10 | import datetime | 10 | import datetime |
1962 | @@ -49,8 +49,9 @@ | |||
1963 | 49 | from lp.services.job.model.job import Job | 49 | from lp.services.job.model.job import Job |
1964 | 50 | from lp.soyuz.adapters.archivedependencies import get_components_for_building | 50 | from lp.soyuz.adapters.archivedependencies import get_components_for_building |
1965 | 51 | from lp.soyuz.interfaces.archive import ArchivePurpose | 51 | from lp.soyuz.interfaces.archive import ArchivePurpose |
1968 | 52 | from lp.soyuz.interfaces.build import ( | 52 | from lp.soyuz.interfaces.binarypackagebuild import ( |
1969 | 53 | BuildSetStatus, CannotBeRescored, IBuild, IBuildSet) | 53 | BuildSetStatus, CannotBeRescored, IBinaryPackageBuild, |
1970 | 54 | IBinaryPackageBuildSet) | ||
1971 | 54 | from lp.buildmaster.interfaces.buildbase import IBuildBase | 55 | from lp.buildmaster.interfaces.buildbase import IBuildBase |
1972 | 55 | from lp.soyuz.interfaces.publishing import active_publishing_status | 56 | from lp.soyuz.interfaces.publishing import active_publishing_status |
1973 | 56 | from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease | 57 | from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease |
1974 | @@ -62,8 +63,8 @@ | |||
1975 | 62 | PackageUpload, PackageUploadBuild) | 63 | PackageUpload, PackageUploadBuild) |
1976 | 63 | 64 | ||
1977 | 64 | 65 | ||
1980 | 65 | class Build(BuildBase, SQLBase): | 66 | class BinaryPackageBuild(BuildBase, SQLBase): |
1981 | 66 | implements(IBuildBase, IBuild) | 67 | implements(IBuildBase, IBinaryPackageBuild) |
1982 | 67 | _table = 'Build' | 68 | _table = 'Build' |
1983 | 68 | _defaultOrder = 'id' | 69 | _defaultOrder = 'id' |
1984 | 69 | 70 | ||
1985 | @@ -470,7 +471,7 @@ | |||
1986 | 470 | # Look for all sourcepackagerelease instances that match the name | 471 | # Look for all sourcepackagerelease instances that match the name |
1987 | 471 | # and get the (successfully built) build records for this | 472 | # and get the (successfully built) build records for this |
1988 | 472 | # package. | 473 | # package. |
1990 | 473 | completed_builds = Build.select(""" | 474 | completed_builds = BinaryPackageBuild.select(""" |
1991 | 474 | Build.sourcepackagerelease = SourcePackageRelease.id AND | 475 | Build.sourcepackagerelease = SourcePackageRelease.id AND |
1992 | 475 | Build.id != %s AND | 476 | Build.id != %s AND |
1993 | 476 | Build.buildduration IS NOT NULL AND | 477 | Build.buildduration IS NOT NULL AND |
1994 | @@ -693,11 +694,11 @@ | |||
1995 | 693 | raise NotFoundError(filename) | 694 | raise NotFoundError(filename) |
1996 | 694 | 695 | ||
1997 | 695 | 696 | ||
2000 | 696 | class BuildSet: | 697 | class BinaryPackageBuildSet: |
2001 | 697 | implements(IBuildSet) | 698 | implements(IBinaryPackageBuildSet) |
2002 | 698 | 699 | ||
2003 | 699 | def getBuildBySRAndArchtag(self, sourcepackagereleaseID, archtag): | 700 | def getBuildBySRAndArchtag(self, sourcepackagereleaseID, archtag): |
2005 | 700 | """See `IBuildSet`""" | 701 | """See `IBinaryPackageBuildSet`""" |
2006 | 701 | clauseTables = ['DistroArchSeries'] | 702 | clauseTables = ['DistroArchSeries'] |
2007 | 702 | query = ('Build.sourcepackagerelease = %s ' | 703 | query = ('Build.sourcepackagerelease = %s ' |
2008 | 703 | 'AND Build.distroarchseries = DistroArchSeries.id ' | 704 | 'AND Build.distroarchseries = DistroArchSeries.id ' |
2009 | @@ -705,25 +706,25 @@ | |||
2010 | 705 | % sqlvalues(sourcepackagereleaseID, archtag) | 706 | % sqlvalues(sourcepackagereleaseID, archtag) |
2011 | 706 | ) | 707 | ) |
2012 | 707 | 708 | ||
2014 | 708 | return Build.select(query, clauseTables=clauseTables) | 709 | return BinaryPackageBuild.select(query, clauseTables=clauseTables) |
2015 | 709 | 710 | ||
2016 | 710 | def getByBuildID(self, id): | 711 | def getByBuildID(self, id): |
2018 | 711 | """See `IBuildSet`.""" | 712 | """See `IBinaryPackageBuildSet`.""" |
2019 | 712 | try: | 713 | try: |
2021 | 713 | return Build.get(id) | 714 | return BinaryPackageBuild.get(id) |
2022 | 714 | except SQLObjectNotFound, e: | 715 | except SQLObjectNotFound, e: |
2023 | 715 | raise NotFoundError(str(e)) | 716 | raise NotFoundError(str(e)) |
2024 | 716 | 717 | ||
2025 | 717 | def getPendingBuildsForArchSet(self, archseries): | 718 | def getPendingBuildsForArchSet(self, archseries): |
2027 | 718 | """See `IBuildSet`.""" | 719 | """See `IBinaryPackageBuildSet`.""" |
2028 | 719 | if not archseries: | 720 | if not archseries: |
2029 | 720 | return None | 721 | return None |
2030 | 721 | 722 | ||
2031 | 722 | archseries_ids = [d.id for d in archseries] | 723 | archseries_ids = [d.id for d in archseries] |
2032 | 723 | 724 | ||
2036 | 724 | return Build.select( | 725 | return BinaryPackageBuild.select( |
2037 | 725 | AND(Build.q.buildstate==BuildStatus.NEEDSBUILD, | 726 | AND(BinaryPackageBuild.q.buildstate==BuildStatus.NEEDSBUILD, |
2038 | 726 | IN(Build.q.distroarchseriesID, archseries_ids)) | 727 | IN(BinaryPackageBuild.q.distroarchseriesID, archseries_ids)) |
2039 | 727 | ) | 728 | ) |
2040 | 728 | 729 | ||
2041 | 729 | def handleOptionalParamsForBuildQueries( | 730 | def handleOptionalParamsForBuildQueries( |
2042 | @@ -775,7 +776,7 @@ | |||
2043 | 775 | 776 | ||
2044 | 776 | def getBuildsForBuilder(self, builder_id, status=None, name=None, | 777 | def getBuildsForBuilder(self, builder_id, status=None, name=None, |
2045 | 777 | arch_tag=None, user=None): | 778 | arch_tag=None, user=None): |
2047 | 778 | """See `IBuildSet`.""" | 779 | """See `IBinaryPackageBuildSet`.""" |
2048 | 779 | queries = [] | 780 | queries = [] |
2049 | 780 | clauseTables = [] | 781 | clauseTables = [] |
2050 | 781 | 782 | ||
2051 | @@ -801,12 +802,13 @@ | |||
2052 | 801 | 802 | ||
2053 | 802 | queries.append("builder=%s" % builder_id) | 803 | queries.append("builder=%s" % builder_id) |
2054 | 803 | 804 | ||
2057 | 804 | return Build.select(" AND ".join(queries), clauseTables=clauseTables, | 805 | return BinaryPackageBuild.select( |
2058 | 805 | orderBy=["-Build.datebuilt", "id"]) | 806 | " AND ".join(queries), clauseTables=clauseTables, |
2059 | 807 | orderBy=["-Build.datebuilt", "id"]) | ||
2060 | 806 | 808 | ||
2061 | 807 | def getBuildsForArchive(self, archive, status=None, name=None, | 809 | def getBuildsForArchive(self, archive, status=None, name=None, |
2062 | 808 | pocket=None, arch_tag=None): | 810 | pocket=None, arch_tag=None): |
2064 | 809 | """See `IBuildSet`.""" | 811 | """See `IBinaryPackageBuildSet`.""" |
2065 | 810 | queries = [] | 812 | queries = [] |
2066 | 811 | clauseTables = [] | 813 | clauseTables = [] |
2067 | 812 | 814 | ||
2068 | @@ -828,17 +830,18 @@ | |||
2069 | 828 | clause = " AND ".join(queries) | 830 | clause = " AND ".join(queries) |
2070 | 829 | 831 | ||
2071 | 830 | return self._decorate_with_prejoins( | 832 | return self._decorate_with_prejoins( |
2073 | 831 | Build.select(clause, clauseTables=clauseTables, orderBy=orderBy)) | 833 | BinaryPackageBuild.select( |
2074 | 834 | clause, clauseTables=clauseTables, orderBy=orderBy)) | ||
2075 | 832 | 835 | ||
2076 | 833 | def getBuildsByArchIds(self, arch_ids, status=None, name=None, | 836 | def getBuildsByArchIds(self, arch_ids, status=None, name=None, |
2077 | 834 | pocket=None): | 837 | pocket=None): |
2079 | 835 | """See `IBuildSet`.""" | 838 | """See `IBinaryPackageBuildSet`.""" |
2080 | 836 | # If not distroarchseries was found return empty list | 839 | # If not distroarchseries was found return empty list |
2081 | 837 | if not arch_ids: | 840 | if not arch_ids: |
2082 | 838 | # XXX cprov 2006-09-08: returning and empty SelectResult to make | 841 | # XXX cprov 2006-09-08: returning and empty SelectResult to make |
2083 | 839 | # the callsites happy as bjorn suggested. However it would be | 842 | # the callsites happy as bjorn suggested. However it would be |
2084 | 840 | # much clearer if we have something like SQLBase.empty() for this | 843 | # much clearer if we have something like SQLBase.empty() for this |
2086 | 841 | return Build.select("2=1") | 844 | return BinaryPackageBuild.select("2=1") |
2087 | 842 | 845 | ||
2088 | 843 | clauseTables = [] | 846 | clauseTables = [] |
2089 | 844 | 847 | ||
2090 | @@ -894,7 +897,7 @@ | |||
2091 | 894 | sqlvalues(ArchivePurpose.PRIMARY, ArchivePurpose.PARTNER))) | 897 | sqlvalues(ArchivePurpose.PRIMARY, ArchivePurpose.PARTNER))) |
2092 | 895 | 898 | ||
2093 | 896 | return self._decorate_with_prejoins( | 899 | return self._decorate_with_prejoins( |
2095 | 897 | Build.select(' AND '.join(condition_clauses), | 900 | BinaryPackageBuild.select(' AND '.join(condition_clauses), |
2096 | 898 | clauseTables=clauseTables, orderBy=orderBy)) | 901 | clauseTables=clauseTables, orderBy=orderBy)) |
2097 | 899 | 902 | ||
2098 | 900 | def _decorate_with_prejoins(self, result_set): | 903 | def _decorate_with_prejoins(self, result_set): |
2099 | @@ -906,12 +909,12 @@ | |||
2100 | 906 | return decorated_results | 909 | return decorated_results |
2101 | 907 | 910 | ||
2102 | 908 | def retryDepWaiting(self, distroarchseries): | 911 | def retryDepWaiting(self, distroarchseries): |
2104 | 909 | """See `IBuildSet`. """ | 912 | """See `IBinaryPackageBuildSet`. """ |
2105 | 910 | # XXX cprov 20071122: use the root logger once bug 164203 is fixed. | 913 | # XXX cprov 20071122: use the root logger once bug 164203 is fixed. |
2106 | 911 | logger = logging.getLogger('retry-depwait') | 914 | logger = logging.getLogger('retry-depwait') |
2107 | 912 | 915 | ||
2108 | 913 | # Get the MANUALDEPWAIT records for all archives. | 916 | # Get the MANUALDEPWAIT records for all archives. |
2110 | 914 | candidates = Build.selectBy( | 917 | candidates = BinaryPackageBuild.selectBy( |
2111 | 915 | buildstate=BuildStatus.MANUALDEPWAIT, | 918 | buildstate=BuildStatus.MANUALDEPWAIT, |
2112 | 916 | distroarchseries=distroarchseries) | 919 | distroarchseries=distroarchseries) |
2113 | 917 | 920 | ||
2114 | @@ -937,7 +940,7 @@ | |||
2115 | 937 | 940 | ||
2116 | 938 | def getBuildsBySourcePackageRelease(self, sourcepackagerelease_ids, | 941 | def getBuildsBySourcePackageRelease(self, sourcepackagerelease_ids, |
2117 | 939 | buildstate=None): | 942 | buildstate=None): |
2119 | 940 | """See `IBuildSet`.""" | 943 | """See `IBinaryPackageBuildSet`.""" |
2120 | 941 | if (sourcepackagerelease_ids is None or | 944 | if (sourcepackagerelease_ids is None or |
2121 | 942 | len(sourcepackagerelease_ids) == 0): | 945 | len(sourcepackagerelease_ids) == 0): |
2122 | 943 | return [] | 946 | return [] |
2123 | @@ -951,12 +954,12 @@ | |||
2124 | 951 | if buildstate is not None: | 954 | if buildstate is not None: |
2125 | 952 | query += "AND buildstate = %s" % sqlvalues(buildstate) | 955 | query += "AND buildstate = %s" % sqlvalues(buildstate) |
2126 | 953 | 956 | ||
2128 | 954 | return Build.select( | 957 | return BinaryPackageBuild.select( |
2129 | 955 | query, orderBy=["-datecreated", "id"], | 958 | query, orderBy=["-datecreated", "id"], |
2130 | 956 | clauseTables=["Archive"]) | 959 | clauseTables=["Archive"]) |
2131 | 957 | 960 | ||
2132 | 958 | def getStatusSummaryForBuilds(self, builds): | 961 | def getStatusSummaryForBuilds(self, builds): |
2134 | 959 | """See `IBuildSet`.""" | 962 | """See `IBinaryPackageBuildSet`.""" |
2135 | 960 | # Create a small helper function to collect the builds for a given | 963 | # Create a small helper function to collect the builds for a given |
2136 | 961 | # list of build states: | 964 | # list of build states: |
2137 | 962 | def collect_builds(*states): | 965 | def collect_builds(*states): |
2138 | @@ -1024,26 +1027,27 @@ | |||
2139 | 1024 | build_ids = [build.id for build in results] | 1027 | build_ids = [build.id for build in results] |
2140 | 1025 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 1028 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2141 | 1026 | origin = ( | 1029 | origin = ( |
2143 | 1027 | Build, | 1030 | BinaryPackageBuild, |
2144 | 1028 | LeftJoin( | 1031 | LeftJoin( |
2145 | 1029 | SourcePackageRelease, | 1032 | SourcePackageRelease, |
2147 | 1030 | SourcePackageRelease.id == Build.sourcepackagereleaseID), | 1033 | (SourcePackageRelease.id == |
2148 | 1034 | BinaryPackageBuild.sourcepackagereleaseID)), | ||
2149 | 1031 | LeftJoin( | 1035 | LeftJoin( |
2150 | 1032 | SourcePackageName, | 1036 | SourcePackageName, |
2151 | 1033 | SourcePackageName.id | 1037 | SourcePackageName.id |
2152 | 1034 | == SourcePackageRelease.sourcepackagenameID), | 1038 | == SourcePackageRelease.sourcepackagenameID), |
2153 | 1035 | LeftJoin(LibraryFileAlias, | 1039 | LeftJoin(LibraryFileAlias, |
2155 | 1036 | LibraryFileAlias.id == Build.buildlogID), | 1040 | LibraryFileAlias.id == BinaryPackageBuild.buildlogID), |
2156 | 1037 | LeftJoin(LibraryFileContent, | 1041 | LeftJoin(LibraryFileContent, |
2157 | 1038 | LibraryFileContent.id == LibraryFileAlias.contentID), | 1042 | LibraryFileContent.id == LibraryFileAlias.contentID), |
2158 | 1039 | LeftJoin( | 1043 | LeftJoin( |
2159 | 1040 | Builder, | 1044 | Builder, |
2161 | 1041 | Builder.id == Build.builderID), | 1045 | Builder.id == BinaryPackageBuild.builderID), |
2162 | 1042 | ) | 1046 | ) |
2163 | 1043 | result_set = store.using(*origin).find( | 1047 | result_set = store.using(*origin).find( |
2164 | 1044 | (SourcePackageRelease, LibraryFileAlias, SourcePackageName, | 1048 | (SourcePackageRelease, LibraryFileAlias, SourcePackageName, |
2165 | 1045 | LibraryFileContent, Builder), | 1049 | LibraryFileContent, Builder), |
2167 | 1046 | In(Build.id, build_ids)) | 1050 | In(BinaryPackageBuild.id, build_ids)) |
2168 | 1047 | 1051 | ||
2169 | 1048 | # Force query execution so that the ancillary data gets fetched | 1052 | # Force query execution so that the ancillary data gets fetched |
2170 | 1049 | # and added to StupidCache. | 1053 | # and added to StupidCache. |
2171 | @@ -1053,36 +1057,38 @@ | |||
2172 | 1053 | return list(result_set) | 1057 | return list(result_set) |
2173 | 1054 | 1058 | ||
2174 | 1055 | def getByQueueEntry(self, queue_entry): | 1059 | def getByQueueEntry(self, queue_entry): |
2176 | 1056 | """See `IBuildSet`.""" | 1060 | """See `IBinaryPackageBuildSet`.""" |
2177 | 1057 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 1061 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2178 | 1058 | result_set = store.find( | 1062 | result_set = store.find( |
2181 | 1059 | Build, | 1063 | BinaryPackageBuild, |
2182 | 1060 | BuildPackageJob.build == Build.id, | 1064 | BuildPackageJob.build == BinaryPackageBuild.id, |
2183 | 1061 | BuildPackageJob.job == BuildQueue.jobID, | 1065 | BuildPackageJob.job == BuildQueue.jobID, |
2184 | 1062 | BuildQueue.job == queue_entry.job) | 1066 | BuildQueue.job == queue_entry.job) |
2185 | 1063 | 1067 | ||
2186 | 1064 | return result_set.one() | 1068 | return result_set.one() |
2187 | 1065 | 1069 | ||
2188 | 1066 | def getQueueEntriesForBuildIDs(self, build_ids): | 1070 | def getQueueEntriesForBuildIDs(self, build_ids): |
2190 | 1067 | """See `IBuildSet`.""" | 1071 | """See `IBinaryPackageBuildSet`.""" |
2191 | 1068 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 1072 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2192 | 1069 | 1073 | ||
2193 | 1070 | origin = ( | 1074 | origin = ( |
2194 | 1071 | BuildPackageJob, | 1075 | BuildPackageJob, |
2195 | 1072 | Join(BuildQueue, BuildPackageJob.job == BuildQueue.jobID), | 1076 | Join(BuildQueue, BuildPackageJob.job == BuildQueue.jobID), |
2197 | 1073 | Join(Build, BuildPackageJob.build == Build.id), | 1077 | Join( |
2198 | 1078 | BinaryPackageBuild, | ||
2199 | 1079 | BuildPackageJob.build == BinaryPackageBuild.id), | ||
2200 | 1074 | LeftJoin( | 1080 | LeftJoin( |
2201 | 1075 | Builder, | 1081 | Builder, |
2202 | 1076 | BuildQueue.builderID == Builder.id), | 1082 | BuildQueue.builderID == Builder.id), |
2203 | 1077 | ) | 1083 | ) |
2204 | 1078 | result_set = store.using(*origin).find( | 1084 | result_set = store.using(*origin).find( |
2205 | 1079 | (BuildQueue, Builder, BuildPackageJob), | 1085 | (BuildQueue, Builder, BuildPackageJob), |
2207 | 1080 | In(Build.id, build_ids)) | 1086 | In(BinaryPackageBuild.id, build_ids)) |
2208 | 1081 | 1087 | ||
2209 | 1082 | return result_set | 1088 | return result_set |
2210 | 1083 | 1089 | ||
2211 | 1084 | def calculateCandidates(self, archseries): | 1090 | def calculateCandidates(self, archseries): |
2213 | 1085 | """See `IBuildSet`.""" | 1091 | """See `IBinaryPackageBuildSet`.""" |
2214 | 1086 | if not archseries: | 1092 | if not archseries: |
2215 | 1087 | raise AssertionError("Given 'archseries' cannot be None/empty.") | 1093 | raise AssertionError("Given 'archseries' cannot be None/empty.") |
2216 | 1088 | 1094 | ||
2217 | 1089 | 1095 | ||
2218 | === modified file 'lib/lp/soyuz/model/binarypackagerelease.py' | |||
2219 | --- lib/lp/soyuz/model/binarypackagerelease.py 2010-03-15 23:02:21 +0000 | |||
2220 | +++ lib/lp/soyuz/model/binarypackagerelease.py 2010-04-13 06:59:32 +0000 | |||
2221 | @@ -38,7 +38,8 @@ | |||
2222 | 38 | version = StringCol(dbName='version', notNull=True) | 38 | version = StringCol(dbName='version', notNull=True) |
2223 | 39 | summary = StringCol(dbName='summary', notNull=True, default="") | 39 | summary = StringCol(dbName='summary', notNull=True, default="") |
2224 | 40 | description = StringCol(dbName='description', notNull=True) | 40 | description = StringCol(dbName='description', notNull=True) |
2226 | 41 | build = ForeignKey(dbName='build', foreignKey='Build', notNull=True) | 41 | build = ForeignKey( |
2227 | 42 | dbName='build', foreignKey='BinaryPackageBuild', notNull=True) | ||
2228 | 42 | binpackageformat = EnumCol(dbName='binpackageformat', notNull=True, | 43 | binpackageformat = EnumCol(dbName='binpackageformat', notNull=True, |
2229 | 43 | schema=BinaryPackageFormat) | 44 | schema=BinaryPackageFormat) |
2230 | 44 | component = ForeignKey(dbName='component', foreignKey='Component', | 45 | component = ForeignKey(dbName='component', foreignKey='Component', |
2231 | 45 | 46 | ||
2232 | === modified file 'lib/lp/soyuz/model/buildpackagejob.py' | |||
2233 | --- lib/lp/soyuz/model/buildpackagejob.py 2010-03-25 14:38:25 +0000 | |||
2234 | +++ lib/lp/soyuz/model/buildpackagejob.py 2010-04-13 06:59:32 +0000 | |||
2235 | @@ -22,7 +22,7 @@ | |||
2236 | 22 | from lp.registry.interfaces.sourcepackage import SourcePackageUrgency | 22 | from lp.registry.interfaces.sourcepackage import SourcePackageUrgency |
2237 | 23 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 23 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
2238 | 24 | from lp.soyuz.interfaces.archive import ArchivePurpose | 24 | from lp.soyuz.interfaces.archive import ArchivePurpose |
2240 | 25 | from lp.soyuz.interfaces.build import IBuildSet | 25 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2241 | 26 | from lp.soyuz.interfaces.buildpackagejob import IBuildPackageJob | 26 | from lp.soyuz.interfaces.buildpackagejob import IBuildPackageJob |
2242 | 27 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 27 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2243 | 28 | 28 | ||
2244 | @@ -38,7 +38,7 @@ | |||
2245 | 38 | job = Reference(job_id, 'Job.id') | 38 | job = Reference(job_id, 'Job.id') |
2246 | 39 | 39 | ||
2247 | 40 | build_id = Int(name='build', allow_none=False) | 40 | build_id = Int(name='build', allow_none=False) |
2249 | 41 | build = Reference(build_id, 'Build.id') | 41 | build = Reference(build_id, 'BinaryPackageBuild.id') |
2250 | 42 | 42 | ||
2251 | 43 | def score(self): | 43 | def score(self): |
2252 | 44 | """See `IBuildPackageJob`.""" | 44 | """See `IBuildPackageJob`.""" |
2253 | @@ -242,7 +242,7 @@ | |||
2254 | 242 | # Builds in those situation should not be built because they will | 242 | # Builds in those situation should not be built because they will |
2255 | 243 | # be wasting build-time, the former case already has a newer source | 243 | # be wasting build-time, the former case already has a newer source |
2256 | 244 | # and the latter could not be built in DAK. | 244 | # and the latter could not be built in DAK. |
2258 | 245 | build_set = getUtility(IBuildSet) | 245 | build_set = getUtility(IBinaryPackageBuildSet) |
2259 | 246 | 246 | ||
2260 | 247 | build = build_set.getByQueueEntry(job) | 247 | build = build_set.getByQueueEntry(job) |
2261 | 248 | if build.pocket == PackagePublishingPocket.SECURITY: | 248 | if build.pocket == PackagePublishingPocket.SECURITY: |
2262 | 249 | 249 | ||
2263 | === modified file 'lib/lp/soyuz/model/distributionsourcepackagerelease.py' | |||
2264 | --- lib/lp/soyuz/model/distributionsourcepackagerelease.py 2009-09-18 12:18:51 +0000 | |||
2265 | +++ lib/lp/soyuz/model/distributionsourcepackagerelease.py 2010-04-13 06:59:32 +0000 | |||
2266 | @@ -29,7 +29,7 @@ | |||
2267 | 29 | DistroSeriesBinaryPackage) | 29 | DistroSeriesBinaryPackage) |
2268 | 30 | from lp.soyuz.model.publishing import ( | 30 | from lp.soyuz.model.publishing import ( |
2269 | 31 | BinaryPackagePublishingHistory) | 31 | BinaryPackagePublishingHistory) |
2271 | 32 | from lp.soyuz.model.build import Build | 32 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2272 | 33 | from lp.soyuz.model.publishing import \ | 33 | from lp.soyuz.model.publishing import \ |
2273 | 34 | SourcePackagePublishingHistory | 34 | SourcePackagePublishingHistory |
2274 | 35 | from lp.soyuz.interfaces.archive import MAIN_ARCHIVE_PURPOSES | 35 | from lp.soyuz.interfaces.archive import MAIN_ARCHIVE_PURPOSES |
2275 | @@ -100,8 +100,9 @@ | |||
2276 | 100 | # distribution that were built for a PPA but have been published | 100 | # distribution that were built for a PPA but have been published |
2277 | 101 | # in a main archive. | 101 | # in a main archive. |
2278 | 102 | builds_for_distro_exprs = ( | 102 | builds_for_distro_exprs = ( |
2281 | 103 | Build.sourcepackagerelease == self.sourcepackagerelease, | 103 | (BinaryPackageBuild.sourcepackagerelease == |
2282 | 104 | Build.distroarchseries == DistroArchSeries.id, | 104 | self.sourcepackagerelease), |
2283 | 105 | BinaryPackageBuild.distroarchseries == DistroArchSeries.id, | ||
2284 | 105 | DistroArchSeries.distroseries == DistroSeries.id, | 106 | DistroArchSeries.distroseries == DistroSeries.id, |
2285 | 106 | DistroSeries.distribution == self.distribution, | 107 | DistroSeries.distribution == self.distribution, |
2286 | 107 | ) | 108 | ) |
2287 | @@ -109,9 +110,9 @@ | |||
2288 | 109 | # First, get all the builds built in a main archive (this will | 110 | # First, get all the builds built in a main archive (this will |
2289 | 110 | # include new and failed builds.) | 111 | # include new and failed builds.) |
2290 | 111 | builds_built_in_main_archives = store.find( | 112 | builds_built_in_main_archives = store.find( |
2292 | 112 | Build, | 113 | BinaryPackageBuild, |
2293 | 113 | builds_for_distro_exprs, | 114 | builds_for_distro_exprs, |
2295 | 114 | Build.archive == Archive.id, | 115 | BinaryPackageBuild.archive == Archive.id, |
2296 | 115 | Archive.purpose.is_in(MAIN_ARCHIVE_PURPOSES)) | 116 | Archive.purpose.is_in(MAIN_ARCHIVE_PURPOSES)) |
2297 | 116 | 117 | ||
2298 | 117 | # Next get all the builds that have a binary published in the | 118 | # Next get all the builds that have a binary published in the |
2299 | @@ -119,9 +120,9 @@ | |||
2300 | 119 | # query, but not the new/failed ones. It will also include | 120 | # query, but not the new/failed ones. It will also include |
2301 | 120 | # ppa builds that have been published in main archives. | 121 | # ppa builds that have been published in main archives. |
2302 | 121 | builds_published_in_main_archives = store.find( | 122 | builds_published_in_main_archives = store.find( |
2304 | 122 | Build, | 123 | BinaryPackageBuild, |
2305 | 123 | builds_for_distro_exprs, | 124 | builds_for_distro_exprs, |
2307 | 124 | BinaryPackageRelease.build == Build.id, | 125 | BinaryPackageRelease.build == BinaryPackageBuild.id, |
2308 | 125 | BinaryPackagePublishingHistory.binarypackagerelease == | 126 | BinaryPackagePublishingHistory.binarypackagerelease == |
2309 | 126 | BinaryPackageRelease.id, | 127 | BinaryPackageRelease.id, |
2310 | 127 | BinaryPackagePublishingHistory.archive == Archive.id, | 128 | BinaryPackagePublishingHistory.archive == Archive.id, |
2311 | @@ -130,7 +131,8 @@ | |||
2312 | 130 | 131 | ||
2313 | 131 | return builds_built_in_main_archives.union( | 132 | return builds_built_in_main_archives.union( |
2314 | 132 | builds_published_in_main_archives).order_by( | 133 | builds_published_in_main_archives).order_by( |
2316 | 133 | Desc(Build.datecreated), Desc(Build.id)) | 134 | Desc( |
2317 | 135 | BinaryPackageBuild.datecreated), Desc(BinaryPackageBuild.id)) | ||
2318 | 134 | 136 | ||
2319 | 135 | @property | 137 | @property |
2320 | 136 | def binary_package_names(self): | 138 | def binary_package_names(self): |
2321 | 137 | 139 | ||
2322 | === modified file 'lib/lp/soyuz/model/distroarchseries.py' | |||
2323 | --- lib/lp/soyuz/model/distroarchseries.py 2010-02-22 10:31:48 +0000 | |||
2324 | +++ lib/lp/soyuz/model/distroarchseries.py 2010-04-13 06:59:32 +0000 | |||
2325 | @@ -26,7 +26,7 @@ | |||
2326 | 26 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 26 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
2327 | 27 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageName | 27 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageName |
2328 | 28 | from lp.soyuz.interfaces.binarypackagerelease import IBinaryPackageReleaseSet | 28 | from lp.soyuz.interfaces.binarypackagerelease import IBinaryPackageReleaseSet |
2330 | 29 | from lp.soyuz.interfaces.build import IBuildSet | 29 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2331 | 30 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 30 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
2332 | 31 | from lp.soyuz.interfaces.distroarchseries import ( | 31 | from lp.soyuz.interfaces.distroarchseries import ( |
2333 | 32 | IDistroArchSeries, IDistroArchSeriesSet, IPocketChroot) | 32 | IDistroArchSeries, IDistroArchSeriesSet, IPocketChroot) |
2334 | @@ -240,8 +240,9 @@ | |||
2335 | 240 | if arch_tag is not None and arch_tag != self.architecturetag: | 240 | if arch_tag is not None and arch_tag != self.architecturetag: |
2336 | 241 | return EmptyResultSet() | 241 | return EmptyResultSet() |
2337 | 242 | 242 | ||
2340 | 243 | # Use the facility provided by IBuildSet to retrieve the records. | 243 | # Use the facility provided by IBinaryPackageBuildSet to |
2341 | 244 | return getUtility(IBuildSet).getBuildsByArchIds( | 244 | # retrieve the records. |
2342 | 245 | return getUtility(IBinaryPackageBuildSet).getBuildsByArchIds( | ||
2343 | 245 | [self.id], build_state, name, pocket) | 246 | [self.id], build_state, name, pocket) |
2344 | 246 | 247 | ||
2345 | 247 | def getReleasedPackages(self, binary_name, pocket=None, | 248 | def getReleasedPackages(self, binary_name, pocket=None, |
2346 | 248 | 249 | ||
2347 | === modified file 'lib/lp/soyuz/model/publishedpackage.py' | |||
2348 | --- lib/lp/soyuz/model/publishedpackage.py 2009-06-25 04:06:00 +0000 | |||
2349 | +++ lib/lp/soyuz/model/publishedpackage.py 2010-04-13 06:59:32 +0000 | |||
2350 | @@ -53,7 +53,7 @@ | |||
2351 | 53 | binarypackagesummary = StringCol(immutable=True) | 53 | binarypackagesummary = StringCol(immutable=True) |
2352 | 54 | binarypackagedescription = StringCol(immutable=True) | 54 | binarypackagedescription = StringCol(immutable=True) |
2353 | 55 | binarypackageversion = StringCol(immutable=True) | 55 | binarypackageversion = StringCol(immutable=True) |
2355 | 56 | build = ForeignKey(foreignKey='Build', dbName='build') | 56 | build = ForeignKey(foreignKey='BinaryPackageBuild', dbName='build') |
2356 | 57 | datebuilt = UtcDateTimeCol(immutable=True) | 57 | datebuilt = UtcDateTimeCol(immutable=True) |
2357 | 58 | sourcepackagerelease = ForeignKey(dbName="sourcepackagerelease", | 58 | sourcepackagerelease = ForeignKey(dbName="sourcepackagerelease", |
2358 | 59 | foreignKey="SourcePackageRelease", | 59 | foreignKey="SourcePackageRelease", |
2359 | 60 | 60 | ||
2360 | === modified file 'lib/lp/soyuz/model/publishing.py' | |||
2361 | --- lib/lp/soyuz/model/publishing.py 2010-04-03 03:29:23 +0000 | |||
2362 | +++ lib/lp/soyuz/model/publishing.py 2010-04-13 06:59:32 +0000 | |||
2363 | @@ -54,7 +54,8 @@ | |||
2364 | 54 | from lp.soyuz.model.packagediff import PackageDiff | 54 | from lp.soyuz.model.packagediff import PackageDiff |
2365 | 55 | from lp.soyuz.interfaces.archive import ArchivePurpose | 55 | from lp.soyuz.interfaces.archive import ArchivePurpose |
2366 | 56 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet | 56 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet |
2368 | 57 | from lp.soyuz.interfaces.build import BuildSetStatus, IBuildSet | 57 | from lp.soyuz.interfaces.binarypackagebuild import ( |
2369 | 58 | BuildSetStatus, IBinaryPackageBuildSet) | ||
2370 | 58 | from lp.soyuz.interfaces.component import IComponentSet | 59 | from lp.soyuz.interfaces.component import IComponentSet |
2371 | 59 | from lp.soyuz.interfaces.publishing import ( | 60 | from lp.soyuz.interfaces.publishing import ( |
2372 | 60 | active_publishing_status, IBinaryPackageFilePublishing, | 61 | active_publishing_status, IBinaryPackageFilePublishing, |
2373 | @@ -510,19 +511,19 @@ | |||
2374 | 510 | return the_url | 511 | return the_url |
2375 | 511 | 512 | ||
2376 | 512 | def _getAllowedArchitectures(self, available_archs): | 513 | def _getAllowedArchitectures(self, available_archs): |
2378 | 513 | """Filter out any restricted architectures not specifically allowed | 514 | """Filter out any restricted architectures not specifically allowed |
2379 | 514 | for an archive. | 515 | for an archive. |
2380 | 515 | 516 | ||
2381 | 516 | :param available_archs: Architectures to consider | 517 | :param available_archs: Architectures to consider |
2382 | 517 | :return: Sequence of `IDistroArch` instances. | 518 | :return: Sequence of `IDistroArch` instances. |
2383 | 518 | """ | 519 | """ |
2384 | 519 | associated_proc_families = [ | 520 | associated_proc_families = [ |
2386 | 520 | archivearch.processorfamily for archivearch | 521 | archivearch.processorfamily for archivearch |
2387 | 521 | in getUtility(IArchiveArchSet).getByArchive(self.archive)] | 522 | in getUtility(IArchiveArchSet).getByArchive(self.archive)] |
2388 | 522 | # Return all distroarches with unrestricted processor families or with | 523 | # Return all distroarches with unrestricted processor families or with |
2389 | 523 | # processor families the archive is explicitly associated with. | 524 | # processor families the archive is explicitly associated with. |
2390 | 524 | return [distroarch for distroarch in available_archs | 525 | return [distroarch for distroarch in available_archs |
2392 | 525 | if not distroarch.processorfamily.restricted or | 526 | if not distroarch.processorfamily.restricted or |
2393 | 526 | distroarch.processorfamily in associated_proc_families] | 527 | distroarch.processorfamily in associated_proc_families] |
2394 | 527 | 528 | ||
2395 | 528 | def createMissingBuilds(self, architectures_available=None, | 529 | def createMissingBuilds(self, architectures_available=None, |
2396 | @@ -553,8 +554,8 @@ | |||
2397 | 553 | def _createMissingBuildForArchitecture(self, arch, logger=None): | 554 | def _createMissingBuildForArchitecture(self, arch, logger=None): |
2398 | 554 | """Create a build for a given architecture if it doesn't exist yet. | 555 | """Create a build for a given architecture if it doesn't exist yet. |
2399 | 555 | 556 | ||
2402 | 556 | Return the just-created `IBuild` record already scored or None | 557 | Return the just-created `IBinaryPackageBuild` record already |
2403 | 557 | if a suitable build is already present. | 558 | scored or None if a suitable build is already present. |
2404 | 558 | """ | 559 | """ |
2405 | 559 | build_candidate = self.sourcepackagerelease.getBuildByArch( | 560 | build_candidate = self.sourcepackagerelease.getBuildByArch( |
2406 | 560 | arch, self.archive) | 561 | arch, self.archive) |
2407 | @@ -804,8 +805,8 @@ | |||
2408 | 804 | datepublished = UtcDateTimeCol(default=None) | 805 | datepublished = UtcDateTimeCol(default=None) |
2409 | 805 | datecreated = UtcDateTimeCol(default=UTC_NOW) | 806 | datecreated = UtcDateTimeCol(default=UTC_NOW) |
2410 | 806 | datesuperseded = UtcDateTimeCol(default=None) | 807 | datesuperseded = UtcDateTimeCol(default=None) |
2413 | 807 | supersededby = ForeignKey(foreignKey='Build', dbName='supersededby', | 808 | supersededby = ForeignKey( |
2414 | 808 | default=None) | 809 | foreignKey='BinaryPackageBuild', dbName='supersededby', default=None) |
2415 | 809 | datemadepending = UtcDateTimeCol(default=None) | 810 | datemadepending = UtcDateTimeCol(default=None) |
2416 | 810 | dateremoved = UtcDateTimeCol(default=None) | 811 | dateremoved = UtcDateTimeCol(default=None) |
2417 | 811 | pocket = EnumCol(dbName='pocket', schema=PackagePublishingPocket) | 812 | pocket = EnumCol(dbName='pocket', schema=PackagePublishingPocket) |
2418 | @@ -1167,7 +1168,7 @@ | |||
2419 | 1167 | # Import Build and DistroArchSeries locally to avoid circular | 1168 | # Import Build and DistroArchSeries locally to avoid circular |
2420 | 1168 | # imports, since that Build uses SourcePackagePublishingHistory | 1169 | # imports, since that Build uses SourcePackagePublishingHistory |
2421 | 1169 | # and DistroArchSeries uses BinaryPackagePublishingHistory. | 1170 | # and DistroArchSeries uses BinaryPackagePublishingHistory. |
2423 | 1170 | from lp.soyuz.model.build import Build | 1171 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2424 | 1171 | from lp.soyuz.model.distroarchseries import ( | 1172 | from lp.soyuz.model.distroarchseries import ( |
2425 | 1172 | DistroArchSeries) | 1173 | DistroArchSeries) |
2426 | 1173 | 1174 | ||
2427 | @@ -1182,41 +1183,43 @@ | |||
2428 | 1182 | # ensure that the result is limited to builds in those states. | 1183 | # ensure that the result is limited to builds in those states. |
2429 | 1183 | if build_states is not None: | 1184 | if build_states is not None: |
2430 | 1184 | extra_exprs.append( | 1185 | extra_exprs.append( |
2432 | 1185 | Build.buildstate.is_in(build_states)) | 1186 | BinaryPackageBuild.buildstate.is_in(build_states)) |
2433 | 1186 | 1187 | ||
2434 | 1187 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 1188 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2435 | 1188 | 1189 | ||
2436 | 1189 | # We'll be looking for builds in the same distroseries as the | 1190 | # We'll be looking for builds in the same distroseries as the |
2437 | 1190 | # SPPH for the same release. | 1191 | # SPPH for the same release. |
2438 | 1191 | builds_for_distroseries_expr = ( | 1192 | builds_for_distroseries_expr = ( |
2440 | 1192 | Build.distroarchseriesID == DistroArchSeries.id, | 1193 | BinaryPackageBuild.distroarchseriesID == DistroArchSeries.id, |
2441 | 1193 | SourcePackagePublishingHistory.distroseriesID == | 1194 | SourcePackagePublishingHistory.distroseriesID == |
2442 | 1194 | DistroArchSeries.distroseriesID, | 1195 | DistroArchSeries.distroseriesID, |
2443 | 1195 | SourcePackagePublishingHistory.sourcepackagereleaseID == | 1196 | SourcePackagePublishingHistory.sourcepackagereleaseID == |
2445 | 1196 | Build.sourcepackagereleaseID, | 1197 | BinaryPackageBuild.sourcepackagereleaseID, |
2446 | 1197 | In(SourcePackagePublishingHistory.id, source_publication_ids) | 1198 | In(SourcePackagePublishingHistory.id, source_publication_ids) |
2447 | 1198 | ) | 1199 | ) |
2448 | 1199 | 1200 | ||
2449 | 1200 | # First, we'll find the builds that were built in the same | 1201 | # First, we'll find the builds that were built in the same |
2450 | 1201 | # archive context as the published sources. | 1202 | # archive context as the published sources. |
2451 | 1202 | builds_in_same_archive = store.find( | 1203 | builds_in_same_archive = store.find( |
2453 | 1203 | Build, | 1204 | BinaryPackageBuild, |
2454 | 1204 | builds_for_distroseries_expr, | 1205 | builds_for_distroseries_expr, |
2456 | 1205 | SourcePackagePublishingHistory.archiveID == Build.archiveID, | 1206 | (SourcePackagePublishingHistory.archiveID == |
2457 | 1207 | BinaryPackageBuild.archiveID), | ||
2458 | 1206 | *extra_exprs) | 1208 | *extra_exprs) |
2459 | 1207 | 1209 | ||
2460 | 1208 | # Next get all the builds that have a binary published in the | 1210 | # Next get all the builds that have a binary published in the |
2461 | 1209 | # same archive... even though the build was not built in | 1211 | # same archive... even though the build was not built in |
2462 | 1210 | # the same context archive. | 1212 | # the same context archive. |
2463 | 1211 | builds_copied_into_archive = store.find( | 1213 | builds_copied_into_archive = store.find( |
2465 | 1212 | Build, | 1214 | BinaryPackageBuild, |
2466 | 1213 | builds_for_distroseries_expr, | 1215 | builds_for_distroseries_expr, |
2468 | 1214 | SourcePackagePublishingHistory.archiveID != Build.archiveID, | 1216 | (SourcePackagePublishingHistory.archiveID != |
2469 | 1217 | BinaryPackageBuild.archiveID), | ||
2470 | 1215 | BinaryPackagePublishingHistory.archive == | 1218 | BinaryPackagePublishingHistory.archive == |
2471 | 1216 | SourcePackagePublishingHistory.archiveID, | 1219 | SourcePackagePublishingHistory.archiveID, |
2472 | 1217 | BinaryPackagePublishingHistory.binarypackagerelease == | 1220 | BinaryPackagePublishingHistory.binarypackagerelease == |
2473 | 1218 | BinaryPackageRelease.id, | 1221 | BinaryPackageRelease.id, |
2475 | 1219 | BinaryPackageRelease.build == Build.id, | 1222 | BinaryPackageRelease.build == BinaryPackageBuild.id, |
2476 | 1220 | *extra_exprs) | 1223 | *extra_exprs) |
2477 | 1221 | 1224 | ||
2478 | 1222 | builds_union = builds_copied_into_archive.union( | 1225 | builds_union = builds_copied_into_archive.union( |
2479 | @@ -1228,7 +1231,10 @@ | |||
2480 | 1228 | # can't sort on SourcePackagePublishingHistory.id after the | 1231 | # can't sort on SourcePackagePublishingHistory.id after the |
2481 | 1229 | # union. See bug 443353 for details. | 1232 | # union. See bug 443353 for details. |
2482 | 1230 | find_spec = ( | 1233 | find_spec = ( |
2484 | 1231 | SourcePackagePublishingHistory, Build, DistroArchSeries) | 1234 | SourcePackagePublishingHistory, |
2485 | 1235 | BinaryPackageBuild, | ||
2486 | 1236 | DistroArchSeries, | ||
2487 | 1237 | ) | ||
2488 | 1232 | 1238 | ||
2489 | 1233 | # Storm doesn't let us do builds_union.values('id') - | 1239 | # Storm doesn't let us do builds_union.values('id') - |
2490 | 1234 | # ('Union' object has no attribute 'columns'). So instead | 1240 | # ('Union' object has no attribute 'columns'). So instead |
2491 | @@ -1237,7 +1243,7 @@ | |||
2492 | 1237 | 1243 | ||
2493 | 1238 | result_set = store.find( | 1244 | result_set = store.find( |
2494 | 1239 | find_spec, builds_for_distroseries_expr, | 1245 | find_spec, builds_for_distroseries_expr, |
2496 | 1240 | Build.id.is_in(build_ids)) | 1246 | BinaryPackageBuild.id.is_in(build_ids)) |
2497 | 1241 | 1247 | ||
2498 | 1242 | return result_set.order_by( | 1248 | return result_set.order_by( |
2499 | 1243 | SourcePackagePublishingHistory.id, | 1249 | SourcePackagePublishingHistory.id, |
2500 | @@ -1285,14 +1291,14 @@ | |||
2501 | 1285 | # to avoid circular imports, since Build uses | 1291 | # to avoid circular imports, since Build uses |
2502 | 1286 | # SourcePackagePublishingHistory, BinaryPackageRelease uses Build | 1292 | # SourcePackagePublishingHistory, BinaryPackageRelease uses Build |
2503 | 1287 | # and DistroArchSeries uses BinaryPackagePublishingHistory. | 1293 | # and DistroArchSeries uses BinaryPackagePublishingHistory. |
2505 | 1288 | from lp.soyuz.model.build import Build | 1294 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2506 | 1289 | from lp.soyuz.model.distroarchseries import ( | 1295 | from lp.soyuz.model.distroarchseries import ( |
2507 | 1290 | DistroArchSeries) | 1296 | DistroArchSeries) |
2508 | 1291 | 1297 | ||
2509 | 1292 | join = [ | 1298 | join = [ |
2510 | 1293 | SourcePackagePublishingHistory.sourcepackagereleaseID == | 1299 | SourcePackagePublishingHistory.sourcepackagereleaseID == |
2513 | 1294 | Build.sourcepackagereleaseID, | 1300 | BinaryPackageBuild.sourcepackagereleaseID, |
2514 | 1295 | BinaryPackageRelease.build == Build.id, | 1301 | BinaryPackageRelease.build == BinaryPackageBuild.id, |
2515 | 1296 | BinaryPackageRelease.binarypackagenameID == | 1302 | BinaryPackageRelease.binarypackagenameID == |
2516 | 1297 | BinaryPackageName.id, | 1303 | BinaryPackageName.id, |
2517 | 1298 | SourcePackagePublishingHistory.distroseriesID == | 1304 | SourcePackagePublishingHistory.distroseriesID == |
2518 | @@ -1326,7 +1332,7 @@ | |||
2519 | 1326 | # to avoid circular imports, since Build uses | 1332 | # to avoid circular imports, since Build uses |
2520 | 1327 | # SourcePackagePublishingHistory and DistroArchSeries uses | 1333 | # SourcePackagePublishingHistory and DistroArchSeries uses |
2521 | 1328 | # BinaryPackagePublishingHistory. | 1334 | # BinaryPackagePublishingHistory. |
2523 | 1329 | from lp.soyuz.model.build import Build | 1335 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2524 | 1330 | from lp.soyuz.model.distroarchseries import ( | 1336 | from lp.soyuz.model.distroarchseries import ( |
2525 | 1331 | DistroArchSeries) | 1337 | DistroArchSeries) |
2526 | 1332 | 1338 | ||
2527 | @@ -1338,12 +1344,15 @@ | |||
2528 | 1338 | one_or_more_source_publications) | 1344 | one_or_more_source_publications) |
2529 | 1339 | 1345 | ||
2530 | 1340 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 1346 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2533 | 1341 | published_builds = store.find( | 1347 | published_builds = store.find(( |
2534 | 1342 | (SourcePackagePublishingHistory, Build, DistroArchSeries), | 1348 | SourcePackagePublishingHistory, |
2535 | 1349 | BinaryPackageBuild, | ||
2536 | 1350 | DistroArchSeries | ||
2537 | 1351 | ), | ||
2538 | 1343 | self._getSourceBinaryJoinForSources( | 1352 | self._getSourceBinaryJoinForSources( |
2539 | 1344 | source_publication_ids, active_binaries_only=False), | 1353 | source_publication_ids, active_binaries_only=False), |
2540 | 1345 | BinaryPackagePublishingHistory.datepublished != None, | 1354 | BinaryPackagePublishingHistory.datepublished != None, |
2542 | 1346 | Build.buildstate.is_in(build_states)) | 1355 | BinaryPackageBuild.buildstate.is_in(build_states)) |
2543 | 1347 | 1356 | ||
2544 | 1348 | published_builds.order_by( | 1357 | published_builds.order_by( |
2545 | 1349 | SourcePackagePublishingHistory.id, | 1358 | SourcePackagePublishingHistory.id, |
2546 | @@ -1361,7 +1370,7 @@ | |||
2547 | 1361 | """See `IPublishingSet`.""" | 1370 | """See `IPublishingSet`.""" |
2548 | 1362 | # Import Build locally to avoid circular imports, since that | 1371 | # Import Build locally to avoid circular imports, since that |
2549 | 1363 | # Build already imports SourcePackagePublishingHistory. | 1372 | # Build already imports SourcePackagePublishingHistory. |
2551 | 1364 | from lp.soyuz.model.build import Build | 1373 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2552 | 1365 | 1374 | ||
2553 | 1366 | source_publication_ids = self._extractIDs( | 1375 | source_publication_ids = self._extractIDs( |
2554 | 1367 | one_or_more_source_publications) | 1376 | one_or_more_source_publications) |
2555 | @@ -1374,9 +1383,9 @@ | |||
2556 | 1374 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, | 1383 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, |
2557 | 1375 | BinaryPackageFile.binarypackagerelease == | 1384 | BinaryPackageFile.binarypackagerelease == |
2558 | 1376 | BinaryPackageRelease.id, | 1385 | BinaryPackageRelease.id, |
2560 | 1377 | BinaryPackageRelease.buildID == Build.id, | 1386 | BinaryPackageRelease.buildID == BinaryPackageBuild.id, |
2561 | 1378 | SourcePackagePublishingHistory.sourcepackagereleaseID == | 1387 | SourcePackagePublishingHistory.sourcepackagereleaseID == |
2563 | 1379 | Build.sourcepackagereleaseID, | 1388 | BinaryPackageBuild.sourcepackagereleaseID, |
2564 | 1380 | BinaryPackagePublishingHistory.binarypackagereleaseID == | 1389 | BinaryPackagePublishingHistory.binarypackagereleaseID == |
2565 | 1381 | BinaryPackageRelease.id, | 1390 | BinaryPackageRelease.id, |
2566 | 1382 | BinaryPackagePublishingHistory.archiveID == | 1391 | BinaryPackagePublishingHistory.archiveID == |
2567 | @@ -1542,8 +1551,8 @@ | |||
2568 | 1542 | used in the calculation. | 1551 | used in the calculation. |
2569 | 1543 | """ | 1552 | """ |
2570 | 1544 | builds = source_publication.getBuilds() | 1553 | builds = source_publication.getBuilds() |
2573 | 1545 | summary = getUtility(IBuildSet).getStatusSummaryForBuilds( | 1554 | summary = getUtility( |
2574 | 1546 | builds) | 1555 | IBinaryPackageBuildSet).getStatusSummaryForBuilds(builds) |
2575 | 1547 | 1556 | ||
2576 | 1548 | # We only augment the result if: | 1557 | # We only augment the result if: |
2577 | 1549 | # 1. we (the SPPH) are ourselves in an active publishing state, and | 1558 | # 1. we (the SPPH) are ourselves in an active publishing state, and |
2578 | 1550 | 1559 | ||
2579 | === modified file 'lib/lp/soyuz/model/queue.py' | |||
2580 | --- lib/lp/soyuz/model/queue.py 2010-03-25 03:44:59 +0000 | |||
2581 | +++ lib/lp/soyuz/model/queue.py 2010-04-13 06:59:32 +0000 | |||
2582 | @@ -1370,7 +1370,7 @@ | |||
2583 | 1370 | foreignKey='PackageUpload' | 1370 | foreignKey='PackageUpload' |
2584 | 1371 | ) | 1371 | ) |
2585 | 1372 | 1372 | ||
2587 | 1373 | build = ForeignKey(dbName='build', foreignKey='Build') | 1373 | build = ForeignKey(dbName='build', foreignKey='BinaryPackageBuild') |
2588 | 1374 | 1374 | ||
2589 | 1375 | def checkComponentAndSection(self): | 1375 | def checkComponentAndSection(self): |
2590 | 1376 | """See `IPackageUploadBuild`.""" | 1376 | """See `IPackageUploadBuild`.""" |
2591 | 1377 | 1377 | ||
2592 | === modified file 'lib/lp/soyuz/model/sourcepackagerelease.py' | |||
2593 | --- lib/lp/soyuz/model/sourcepackagerelease.py 2010-03-20 23:16:42 +0000 | |||
2594 | +++ lib/lp/soyuz/model/sourcepackagerelease.py 2010-04-13 06:59:32 +0000 | |||
2595 | @@ -45,7 +45,7 @@ | |||
2596 | 45 | PackageDiffAlreadyRequested, PackageDiffStatus) | 45 | PackageDiffAlreadyRequested, PackageDiffStatus) |
2597 | 46 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 46 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2598 | 47 | from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease | 47 | from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease |
2600 | 48 | from lp.soyuz.model.build import Build | 48 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2601 | 49 | from lp.soyuz.model.files import SourcePackageReleaseFile | 49 | from lp.soyuz.model.files import SourcePackageReleaseFile |
2602 | 50 | from lp.soyuz.model.packagediff import PackageDiff | 50 | from lp.soyuz.model.packagediff import PackageDiff |
2603 | 51 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory | 51 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory |
2604 | @@ -144,7 +144,7 @@ | |||
2605 | 144 | # when copy-package works for copying packages across archives, | 144 | # when copy-package works for copying packages across archives, |
2606 | 145 | # a build may well have a different archive to the corresponding | 145 | # a build may well have a different archive to the corresponding |
2607 | 146 | # sourcepackagerelease. | 146 | # sourcepackagerelease. |
2609 | 147 | return Build.select(""" | 147 | return BinaryPackageBuild.select(""" |
2610 | 148 | sourcepackagerelease = %s AND | 148 | sourcepackagerelease = %s AND |
2611 | 149 | archive.id = build.archive AND | 149 | archive.id = build.archive AND |
2612 | 150 | archive.purpose IN %s | 150 | archive.purpose IN %s |
2613 | @@ -327,7 +327,7 @@ | |||
2614 | 327 | # same datecreated. | 327 | # same datecreated. |
2615 | 328 | datecreated = datetime.datetime.now(pytz.timezone('UTC')) | 328 | datecreated = datetime.datetime.now(pytz.timezone('UTC')) |
2616 | 329 | 329 | ||
2618 | 330 | return Build(distroarchseries=distroarchseries, | 330 | return BinaryPackageBuild(distroarchseries=distroarchseries, |
2619 | 331 | sourcepackagerelease=self, | 331 | sourcepackagerelease=self, |
2620 | 332 | processor=processor, | 332 | processor=processor, |
2621 | 333 | buildstate=status, | 333 | buildstate=status, |
2622 | @@ -356,7 +356,7 @@ | |||
2623 | 356 | """ % sqlvalues(self, distroarchseries.architecturetag, | 356 | """ % sqlvalues(self, distroarchseries.architecturetag, |
2624 | 357 | distroarchseries, archive) | 357 | distroarchseries, archive) |
2625 | 358 | 358 | ||
2627 | 359 | select_results = Build.select( | 359 | select_results = BinaryPackageBuild.select( |
2628 | 360 | query, clauseTables=clauseTables, distinct=True, | 360 | query, clauseTables=clauseTables, distinct=True, |
2629 | 361 | orderBy='-Build.id') | 361 | orderBy='-Build.id') |
2630 | 362 | 362 | ||
2631 | @@ -440,7 +440,7 @@ | |||
2632 | 440 | # across all possible locations. | 440 | # across all possible locations. |
2633 | 441 | query = " AND ".join(queries) | 441 | query = " AND ".join(queries) |
2634 | 442 | 442 | ||
2636 | 443 | return Build.selectFirst(query, orderBy=['-datecreated']) | 443 | return BinaryPackageBuild.selectFirst(query, orderBy=['-datecreated']) |
2637 | 444 | 444 | ||
2638 | 445 | def override(self, component=None, section=None, urgency=None): | 445 | def override(self, component=None, section=None, urgency=None): |
2639 | 446 | """See ISourcePackageRelease.""" | 446 | """See ISourcePackageRelease.""" |
2640 | 447 | 447 | ||
2641 | === modified file 'lib/lp/soyuz/scripts/buildd.py' | |||
2642 | --- lib/lp/soyuz/scripts/buildd.py 2010-04-03 03:38:55 +0000 | |||
2643 | +++ lib/lp/soyuz/scripts/buildd.py 2010-04-13 06:59:32 +0000 | |||
2644 | @@ -23,7 +23,7 @@ | |||
2645 | 23 | from lp.registry.interfaces.series import SeriesStatus | 23 | from lp.registry.interfaces.series import SeriesStatus |
2646 | 24 | from lp.services.scripts.base import ( | 24 | from lp.services.scripts.base import ( |
2647 | 25 | LaunchpadCronScript, LaunchpadScriptFailure) | 25 | LaunchpadCronScript, LaunchpadScriptFailure) |
2649 | 26 | from lp.soyuz.interfaces.build import IBuildSet | 26 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2650 | 27 | from lp.soyuz.pas import BuildDaemonPackagesArchSpecific | 27 | from lp.soyuz.pas import BuildDaemonPackagesArchSpecific |
2651 | 28 | 28 | ||
2652 | 29 | # XXX cprov 2009-04-16: This function should live in | 29 | # XXX cprov 2009-04-16: This function should live in |
2653 | @@ -161,7 +161,7 @@ | |||
2654 | 161 | """Create missing Buildd Jobs. """ | 161 | """Create missing Buildd Jobs. """ |
2655 | 162 | self.logger.info("Scanning for build queue entries that are missing") | 162 | self.logger.info("Scanning for build queue entries that are missing") |
2656 | 163 | 163 | ||
2658 | 164 | buildset = getUtility(IBuildSet) | 164 | buildset = getUtility(IBinaryPackageBuildSet) |
2659 | 165 | builds = buildset.getPendingBuildsForArchSet(archseries) | 165 | builds = buildset.getPendingBuildsForArchSet(archseries) |
2660 | 166 | 166 | ||
2661 | 167 | if not builds: | 167 | if not builds: |
2662 | @@ -186,13 +186,15 @@ | |||
2663 | 186 | return | 186 | return |
2664 | 187 | 187 | ||
2665 | 188 | # Get the current build job candidates. | 188 | # Get the current build job candidates. |
2667 | 189 | candidates = getUtility(IBuildSet).calculateCandidates(archseries) | 189 | candidates = getUtility(IBinaryPackageBuildSet).calculateCandidates( |
2668 | 190 | archseries) | ||
2669 | 190 | 191 | ||
2670 | 191 | self.logger.info("Found %d build in NEEDSBUILD state. Rescoring" | 192 | self.logger.info("Found %d build in NEEDSBUILD state. Rescoring" |
2671 | 192 | % candidates.count()) | 193 | % candidates.count()) |
2672 | 193 | 194 | ||
2673 | 194 | for job in candidates: | 195 | for job in candidates: |
2675 | 195 | uptodate_build = getUtility(IBuildSet).getByQueueEntry(job) | 196 | uptodate_build = getUtility( |
2676 | 197 | IBinaryPackageBuildSet).getByQueueEntry(job) | ||
2677 | 196 | if uptodate_build.buildstate != BuildStatus.NEEDSBUILD: | 198 | if uptodate_build.buildstate != BuildStatus.NEEDSBUILD: |
2678 | 197 | continue | 199 | continue |
2679 | 198 | job.score() | 200 | job.score() |
2680 | @@ -250,7 +252,7 @@ | |||
2681 | 250 | "Could not find distribution: %s" % self.options.distribution) | 252 | "Could not find distribution: %s" % self.options.distribution) |
2682 | 251 | 253 | ||
2683 | 252 | # Iterate over all supported distroarchseries with available chroot. | 254 | # Iterate over all supported distroarchseries with available chroot. |
2685 | 253 | build_set = getUtility(IBuildSet) | 255 | build_set = getUtility(IBinaryPackageBuildSet) |
2686 | 254 | for distroseries in distribution: | 256 | for distroseries in distribution: |
2687 | 255 | if distroseries.status == SeriesStatus.OBSOLETE: | 257 | if distroseries.status == SeriesStatus.OBSOLETE: |
2688 | 256 | self.logger.debug( | 258 | self.logger.debug( |
2689 | 257 | 259 | ||
2690 | === modified file 'lib/lp/soyuz/scripts/gina/handlers.py' | |||
2691 | --- lib/lp/soyuz/scripts/gina/handlers.py 2010-03-06 04:57:40 +0000 | |||
2692 | +++ lib/lp/soyuz/scripts/gina/handlers.py 2010-04-13 06:59:32 +0000 | |||
2693 | @@ -848,7 +848,7 @@ | |||
2694 | 848 | def ensureBuild(self, binary, srcpkg, distroarchinfo, archtag): | 848 | def ensureBuild(self, binary, srcpkg, distroarchinfo, archtag): |
2695 | 849 | """Ensure a build record.""" | 849 | """Ensure a build record.""" |
2696 | 850 | # Avoid circular imports. | 850 | # Avoid circular imports. |
2698 | 851 | from lp.soyuz.model.build import Build | 851 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2699 | 852 | 852 | ||
2700 | 853 | distroarchseries = distroarchinfo['distroarchseries'] | 853 | distroarchseries = distroarchinfo['distroarchseries'] |
2701 | 854 | distribution = distroarchseries.distroseries.distribution | 854 | distribution = distroarchseries.distroseries.distribution |
2702 | @@ -873,7 +873,7 @@ | |||
2703 | 873 | % quote(archtag)) | 873 | % quote(archtag)) |
2704 | 874 | 874 | ||
2705 | 875 | try: | 875 | try: |
2707 | 876 | build = Build.selectOne(query, clauseTables) | 876 | build = BinaryPackageBuild.selectOne(query, clauseTables) |
2708 | 877 | except SQLObjectMoreThanOneResultError: | 877 | except SQLObjectMoreThanOneResultError: |
2709 | 878 | # XXX kiko 2005-10-27: Untested. | 878 | # XXX kiko 2005-10-27: Untested. |
2710 | 879 | raise MultipleBuildError("More than one build was found " | 879 | raise MultipleBuildError("More than one build was found " |
2711 | @@ -896,7 +896,7 @@ | |||
2712 | 896 | key = None | 896 | key = None |
2713 | 897 | 897 | ||
2714 | 898 | processor = distroarchinfo['processor'] | 898 | processor = distroarchinfo['processor'] |
2716 | 899 | build = Build(processor=processor.id, | 899 | build = BinaryPackageBuild(processor=processor.id, |
2717 | 900 | distroarchseries=distroarchseries.id, | 900 | distroarchseries=distroarchseries.id, |
2718 | 901 | buildstate=BuildStatus.FULLYBUILT, | 901 | buildstate=BuildStatus.FULLYBUILT, |
2719 | 902 | sourcepackagerelease=srcpkg.id, | 902 | sourcepackagerelease=srcpkg.id, |
2720 | 903 | 903 | ||
2721 | === modified file 'lib/lp/soyuz/scripts/packagecopier.py' | |||
2722 | --- lib/lp/soyuz/scripts/packagecopier.py 2010-03-22 10:36:42 +0000 | |||
2723 | +++ lib/lp/soyuz/scripts/packagecopier.py 2010-04-13 06:59:32 +0000 | |||
2724 | @@ -28,7 +28,7 @@ | |||
2725 | 28 | from lp.buildmaster.interfaces.buildbase import BuildStatus | 28 | from lp.buildmaster.interfaces.buildbase import BuildStatus |
2726 | 29 | from lp.soyuz.adapters.packagelocation import build_package_location | 29 | from lp.soyuz.adapters.packagelocation import build_package_location |
2727 | 30 | from lp.soyuz.interfaces.archive import ArchivePurpose, CannotCopy | 30 | from lp.soyuz.interfaces.archive import ArchivePurpose, CannotCopy |
2729 | 31 | from lp.soyuz.interfaces.build import BuildSetStatus | 31 | from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus |
2730 | 32 | from lp.soyuz.interfaces.publishing import ( | 32 | from lp.soyuz.interfaces.publishing import ( |
2731 | 33 | IBinaryPackagePublishingHistory, IPublishingSet, | 33 | IBinaryPackagePublishingHistory, IPublishingSet, |
2732 | 34 | ISourcePackagePublishingHistory, active_publishing_status) | 34 | ISourcePackagePublishingHistory, active_publishing_status) |
2733 | 35 | 35 | ||
2734 | === modified file 'lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py' | |||
2735 | --- lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py 2010-03-06 04:57:40 +0000 | |||
2736 | +++ lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py 2010-04-13 06:59:32 +0000 | |||
2737 | @@ -21,7 +21,7 @@ | |||
2738 | 21 | from lp.registry.interfaces.distribution import IDistributionSet | 21 | from lp.registry.interfaces.distribution import IDistributionSet |
2739 | 22 | from lp.services.scripts.base import LaunchpadScriptFailure | 22 | from lp.services.scripts.base import LaunchpadScriptFailure |
2740 | 23 | from lp.soyuz.interfaces.component import IComponentSet | 23 | from lp.soyuz.interfaces.component import IComponentSet |
2742 | 24 | from lp.soyuz.model.build import Build | 24 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2743 | 25 | from lp.soyuz.scripts.buildd import QueueBuilder, RetryDepwait | 25 | from lp.soyuz.scripts.buildd import QueueBuilder, RetryDepwait |
2744 | 26 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | 26 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
2745 | 27 | 27 | ||
2746 | @@ -228,7 +228,7 @@ | |||
2747 | 228 | self.number_of_pending_builds = self.getPendingBuilds().count() | 228 | self.number_of_pending_builds = self.getPendingBuilds().count() |
2748 | 229 | 229 | ||
2749 | 230 | def getPendingBuilds(self): | 230 | def getPendingBuilds(self): |
2751 | 231 | return Build.selectBy(buildstate=BuildStatus.NEEDSBUILD) | 231 | return BinaryPackageBuild.selectBy(buildstate=BuildStatus.NEEDSBUILD) |
2752 | 232 | 232 | ||
2753 | 233 | def getRetryDepwait(self, distribution=None): | 233 | def getRetryDepwait(self, distribution=None): |
2754 | 234 | test_args = ['-n'] | 234 | test_args = ['-n'] |
2755 | @@ -268,7 +268,7 @@ | |||
2756 | 268 | 268 | ||
2757 | 269 | def testWorkingRun(self): | 269 | def testWorkingRun(self): |
2758 | 270 | """Modify sampledata and expects a new pending build to be created.""" | 270 | """Modify sampledata and expects a new pending build to be created.""" |
2760 | 271 | depwait_build = Build.get(12) | 271 | depwait_build = BinaryPackageBuild.get(12) |
2761 | 272 | 272 | ||
2762 | 273 | # Moving the target source to universe, so it can reach the only | 273 | # Moving the target source to universe, so it can reach the only |
2763 | 274 | # published binary we have in sampledata. | 274 | # published binary we have in sampledata. |
2764 | @@ -287,7 +287,7 @@ | |||
2765 | 287 | self.layer.commit() | 287 | self.layer.commit() |
2766 | 288 | 288 | ||
2767 | 289 | # Reload the build record after the multiple commits. | 289 | # Reload the build record after the multiple commits. |
2769 | 290 | depwait_build = Build.get(12) | 290 | depwait_build = BinaryPackageBuild.get(12) |
2770 | 291 | self.assertEqual( | 291 | self.assertEqual( |
2771 | 292 | self.number_of_pending_builds + 1, | 292 | self.number_of_pending_builds + 1, |
2772 | 293 | self.getPendingBuilds().count()) | 293 | self.getPendingBuilds().count()) |
2773 | 294 | 294 | ||
2774 | === modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py' | |||
2775 | --- lib/lp/soyuz/scripts/tests/test_copypackage.py 2010-03-24 07:05:39 +0000 | |||
2776 | +++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2010-04-13 06:59:32 +0000 | |||
2777 | @@ -30,7 +30,7 @@ | |||
2778 | 30 | from lp.soyuz.adapters.packagelocation import PackageLocationError | 30 | from lp.soyuz.adapters.packagelocation import PackageLocationError |
2779 | 31 | from lp.soyuz.interfaces.archive import ( | 31 | from lp.soyuz.interfaces.archive import ( |
2780 | 32 | ArchivePurpose, CannotCopy) | 32 | ArchivePurpose, CannotCopy) |
2782 | 33 | from lp.soyuz.interfaces.build import BuildSetStatus | 33 | from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus |
2783 | 34 | from lp.soyuz.interfaces.component import IComponentSet | 34 | from lp.soyuz.interfaces.component import IComponentSet |
2784 | 35 | from lp.soyuz.interfaces.publishing import ( | 35 | from lp.soyuz.interfaces.publishing import ( |
2785 | 36 | IBinaryPackagePublishingHistory, ISourcePackagePublishingHistory, | 36 | IBinaryPackagePublishingHistory, ISourcePackagePublishingHistory, |
2786 | @@ -49,8 +49,7 @@ | |||
2787 | 49 | CopyChecker, do_copy, _do_delayed_copy, _do_direct_copy, PackageCopier, | 49 | CopyChecker, do_copy, _do_delayed_copy, _do_direct_copy, PackageCopier, |
2788 | 50 | re_upload_file, UnembargoSecurityPackage, update_files_privacy) | 50 | re_upload_file, UnembargoSecurityPackage, update_files_privacy) |
2789 | 51 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | 51 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
2792 | 52 | from lp.testing import ( | 52 | from lp.testing import TestCaseWithFactory |
2791 | 53 | TestCase, TestCaseWithFactory) | ||
2793 | 54 | 53 | ||
2794 | 55 | 54 | ||
2795 | 56 | class ReUploadFileTestCase(TestCaseWithFactory): | 55 | class ReUploadFileTestCase(TestCaseWithFactory): |
2796 | 57 | 56 | ||
2797 | === modified file 'lib/lp/soyuz/scripts/tests/test_populatearchive.py' | |||
2798 | --- lib/lp/soyuz/scripts/tests/test_populatearchive.py 2010-03-06 04:57:40 +0000 | |||
2799 | +++ lib/lp/soyuz/scripts/tests/test_populatearchive.py 2010-04-13 06:59:32 +0000 | |||
2800 | @@ -23,7 +23,7 @@ | |||
2801 | 23 | from lp.services.job.interfaces.job import JobStatus | 23 | from lp.services.job.interfaces.job import JobStatus |
2802 | 24 | from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet | 24 | from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet |
2803 | 25 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet | 25 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet |
2805 | 26 | from lp.soyuz.interfaces.build import IBuildSet | 26 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2806 | 27 | from lp.soyuz.interfaces.packagecopyrequest import ( | 27 | from lp.soyuz.interfaces.packagecopyrequest import ( |
2807 | 28 | IPackageCopyRequestSet, PackageCopyStatus) | 28 | IPackageCopyRequestSet, PackageCopyStatus) |
2808 | 29 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 29 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2809 | @@ -130,7 +130,7 @@ | |||
2810 | 130 | self._verifyClonedSourcePackages(copy_archive, hoary) | 130 | self._verifyClonedSourcePackages(copy_archive, hoary) |
2811 | 131 | 131 | ||
2812 | 132 | # Now check that we have build records for the sources cloned. | 132 | # Now check that we have build records for the sources cloned. |
2814 | 133 | builds = list(getUtility(IBuildSet).getBuildsForArchive( | 133 | builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2815 | 134 | copy_archive, status=BuildStatus.NEEDSBUILD)) | 134 | copy_archive, status=BuildStatus.NEEDSBUILD)) |
2816 | 135 | 135 | ||
2817 | 136 | # Please note: there will be no build for the pmount package | 136 | # Please note: there will be no build for the pmount package |
2818 | @@ -331,7 +331,7 @@ | |||
2819 | 331 | self._verifyClonedSourcePackages(copy_archive, hoary) | 331 | self._verifyClonedSourcePackages(copy_archive, hoary) |
2820 | 332 | 332 | ||
2821 | 333 | # Now check that we have zero build records for the sources cloned. | 333 | # Now check that we have zero build records for the sources cloned. |
2823 | 334 | builds = list(getUtility(IBuildSet).getBuildsForArchive( | 334 | builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2824 | 335 | copy_archive, status=BuildStatus.NEEDSBUILD)) | 335 | copy_archive, status=BuildStatus.NEEDSBUILD)) |
2825 | 336 | build_spns = [ | 336 | build_spns = [ |
2826 | 337 | get_spn(removeSecurityProxy(build)).name for build in builds] | 337 | get_spn(removeSecurityProxy(build)).name for build in builds] |
2827 | @@ -629,7 +629,7 @@ | |||
2828 | 629 | self._verifyClonedSourcePackages(copy_archive, hoary) | 629 | self._verifyClonedSourcePackages(copy_archive, hoary) |
2829 | 630 | 630 | ||
2830 | 631 | # Now check that we have the build records expected. | 631 | # Now check that we have the build records expected. |
2832 | 632 | builds = list(getUtility(IBuildSet).getBuildsForArchive( | 632 | builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2833 | 633 | copy_archive, status=BuildStatus.NEEDSBUILD)) | 633 | copy_archive, status=BuildStatus.NEEDSBUILD)) |
2834 | 634 | build_spns = [ | 634 | build_spns = [ |
2835 | 635 | get_spn(removeSecurityProxy(build)).name for build in builds] | 635 | get_spn(removeSecurityProxy(build)).name for build in builds] |
2836 | @@ -669,7 +669,8 @@ | |||
2837 | 669 | self._verifyClonedSourcePackages(archive, hoary) | 669 | self._verifyClonedSourcePackages(archive, hoary) |
2838 | 670 | 670 | ||
2839 | 671 | # Get the binary builds generated for the copy archive at hand. | 671 | # Get the binary builds generated for the copy archive at hand. |
2841 | 672 | builds = list(getUtility(IBuildSet).getBuildsForArchive(archive)) | 672 | builds = list(getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2842 | 673 | archive)) | ||
2843 | 673 | # At least one binary build was generated for the target copy archive. | 674 | # At least one binary build was generated for the target copy archive. |
2844 | 674 | self.assertTrue(len(builds) > 0) | 675 | self.assertTrue(len(builds) > 0) |
2845 | 675 | # Now check that the binary builds and their associated job records | 676 | # Now check that the binary builds and their associated job records |
2846 | 676 | 677 | ||
2847 | === modified file 'lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt' | |||
2848 | --- lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2010-03-06 04:57:40 +0000 | |||
2849 | +++ lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2010-04-13 06:59:32 +0000 | |||
2850 | @@ -412,10 +412,12 @@ | |||
2851 | 412 | 412 | ||
2852 | 413 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus | 413 | >>> from lp.buildmaster.interfaces.buildbase import BuildStatus |
2853 | 414 | >>> from lp.registry.interfaces.person import IPersonSet | 414 | >>> from lp.registry.interfaces.person import IPersonSet |
2855 | 415 | >>> from lp.soyuz.interfaces.build import IBuildSet | 415 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2856 | 416 | ... IBinaryPackageBuildSet) | ||
2857 | 416 | >>> login('foo.bar@canonical.com') | 417 | >>> login('foo.bar@canonical.com') |
2858 | 417 | >>> cprov_ppa = getUtility(IPersonSet).getByName('cprov').archive | 418 | >>> cprov_ppa = getUtility(IPersonSet).getByName('cprov').archive |
2860 | 418 | >>> builds = getUtility(IBuildSet).getBuildsForArchive(cprov_ppa) | 419 | >>> builds = getUtility(IBinaryPackageBuildSet).getBuildsForArchive( |
2861 | 420 | ... cprov_ppa) | ||
2862 | 419 | >>> builds[0].buildstate = BuildStatus.BUILDING | 421 | >>> builds[0].buildstate = BuildStatus.BUILDING |
2863 | 420 | >>> logout() | 422 | >>> logout() |
2864 | 421 | 423 | ||
2865 | 422 | 424 | ||
2866 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt' | |||
2867 | --- lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt 2009-08-28 07:34:44 +0000 | |||
2868 | +++ lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt 2010-04-13 06:59:32 +0000 | |||
2869 | @@ -21,13 +21,14 @@ | |||
2870 | 21 | XXX: noodles 2009-01-16 bug 317863: move this into the STP. | 21 | XXX: noodles 2009-01-16 bug 317863: move this into the STP. |
2871 | 22 | 22 | ||
2872 | 23 | >>> from lp.soyuz.model.queue import PackageUploadBuild | 23 | >>> from lp.soyuz.model.queue import PackageUploadBuild |
2874 | 24 | >>> from lp.soyuz.interfaces.build import IBuildSet | 24 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2875 | 25 | ... IBinaryPackageBuildSet) | ||
2876 | 25 | >>> from lp.registry.interfaces.pocket import ( | 26 | >>> from lp.registry.interfaces.pocket import ( |
2877 | 26 | ... PackagePublishingPocket) | 27 | ... PackagePublishingPocket) |
2878 | 27 | >>> from zope.component import getUtility | 28 | >>> from zope.component import getUtility |
2879 | 28 | 29 | ||
2880 | 29 | >>> login('foo.bar@canonical.com') | 30 | >>> login('foo.bar@canonical.com') |
2882 | 30 | >>> build = getUtility(IBuildSet).getByBuildID(2) | 31 | >>> build = getUtility(IBinaryPackageBuildSet).getByBuildID(2) |
2883 | 31 | >>> package_upload = build.distroseries.createQueueEntry( | 32 | >>> package_upload = build.distroseries.createQueueEntry( |
2884 | 32 | ... PackagePublishingPocket.UPDATES, 'changes.txt', 'my changes', | 33 | ... PackagePublishingPocket.UPDATES, 'changes.txt', 'my changes', |
2885 | 33 | ... build.archive) | 34 | ... build.archive) |
2886 | 34 | 35 | ||
2887 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-build-record.txt' | |||
2888 | --- lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-03-27 03:11:00 +0000 | |||
2889 | +++ lib/lp/soyuz/stories/soyuz/xx-build-record.txt 2010-04-13 06:59:32 +0000 | |||
2890 | @@ -23,8 +23,10 @@ | |||
2891 | 23 | >>> bob_builder.builderok = True | 23 | >>> bob_builder.builderok = True |
2892 | 24 | 24 | ||
2893 | 25 | # Set a known duration for the current job. | 25 | # Set a known duration for the current job. |
2896 | 26 | >>> from lp.soyuz.interfaces.build import IBuildSet | 26 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2897 | 27 | >>> build2 = getUtility(IBuildSet).getByQueueEntry(bob_builder.currentjob) | 27 | ... IBinaryPackageBuildSet) |
2898 | 28 | >>> build2 = getUtility(IBinaryPackageBuildSet).getByQueueEntry( | ||
2899 | 29 | ... bob_builder.currentjob) | ||
2900 | 28 | >>> in_progress_build = removeSecurityProxy(build2) | 30 | >>> in_progress_build = removeSecurityProxy(build2) |
2901 | 29 | >>> one_minute = datetime.timedelta(seconds=60) | 31 | >>> one_minute = datetime.timedelta(seconds=60) |
2902 | 30 | >>> in_progress_build.buildqueue_record.estimated_duration = one_minute | 32 | >>> in_progress_build.buildqueue_record.estimated_duration = one_minute |
2903 | 31 | 33 | ||
2904 | === modified file 'lib/lp/soyuz/stories/webservice/xx-builds.txt' | |||
2905 | --- lib/lp/soyuz/stories/webservice/xx-builds.txt 2010-03-06 04:57:40 +0000 | |||
2906 | +++ lib/lp/soyuz/stories/webservice/xx-builds.txt 2010-04-13 06:59:32 +0000 | |||
2907 | @@ -64,17 +64,18 @@ | |||
2908 | 64 | >>> login('foo.bar@canonical.com') | 64 | >>> login('foo.bar@canonical.com') |
2909 | 65 | 65 | ||
2910 | 66 | >>> from zope.component import getUtility | 66 | >>> from zope.component import getUtility |
2912 | 67 | >>> from lp.soyuz.interfaces.build import IBuildSet | 67 | >>> from lp.soyuz.interfaces.binarypackagebuild import ( |
2913 | 68 | ... IBinaryPackageBuildSet) | ||
2914 | 68 | 69 | ||
2916 | 69 | >>> build = getUtility(IBuildSet).getByBuildID(26) | 70 | >>> build = getUtility(IBinaryPackageBuildSet).getByBuildID(26) |
2917 | 70 | >>> build.upload_log = build.buildlog | 71 | >>> build.upload_log = build.buildlog |
2918 | 71 | 72 | ||
2919 | 72 | >>> logout() | 73 | >>> logout() |
2920 | 73 | 74 | ||
2925 | 74 | IBuild 'build_log_url' and 'upload_log_url' are webapp URLs, relative | 75 | IBinaryPackageBuild 'build_log_url' and 'upload_log_url' are webapp |
2926 | 75 | to the build itself. This way API users can access private files | 76 | URLs, relative to the build itself. This way API users can access |
2927 | 76 | (stored in the restricted librarian) directly because they will be | 77 | private files (stored in the restricted librarian) directly because they |
2928 | 77 | proxied by the webapp. | 78 | will be proxied by the webapp. |
2929 | 78 | 79 | ||
2930 | 79 | >>> builds = webservice.named_get( | 80 | >>> builds = webservice.named_get( |
2931 | 80 | ... source_pub['self_link'], 'getBuilds').jsonBody() | 81 | ... source_pub['self_link'], 'getBuilds').jsonBody() |
2932 | 81 | 82 | ||
2933 | === modified file 'lib/lp/soyuz/tests/test_archive.py' | |||
2934 | --- lib/lp/soyuz/tests/test_archive.py 2010-03-17 09:55:40 +0000 | |||
2935 | +++ lib/lp/soyuz/tests/test_archive.py 2010-04-13 06:59:32 +0000 | |||
2936 | @@ -27,7 +27,7 @@ | |||
2937 | 27 | from lp.soyuz.interfaces.binarypackagerelease import BinaryPackageFormat | 27 | from lp.soyuz.interfaces.binarypackagerelease import BinaryPackageFormat |
2938 | 28 | from lp.soyuz.interfaces.processor import IProcessorFamilySet | 28 | from lp.soyuz.interfaces.processor import IProcessorFamilySet |
2939 | 29 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 29 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2941 | 30 | from lp.soyuz.model.build import Build | 30 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2942 | 31 | from lp.soyuz.model.binarypackagerelease import ( | 31 | from lp.soyuz.model.binarypackagerelease import ( |
2943 | 32 | BinaryPackageReleaseDownloadCount) | 32 | BinaryPackageReleaseDownloadCount) |
2944 | 33 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | 33 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
2945 | @@ -413,7 +413,7 @@ | |||
2946 | 413 | self.ubuntutest, ArchivePurpose.PRIMARY) | 413 | self.ubuntutest, ArchivePurpose.PRIMARY) |
2947 | 414 | 414 | ||
2948 | 415 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 415 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
2950 | 416 | sample_data = store.find(Build) | 416 | sample_data = store.find(BinaryPackageBuild) |
2951 | 417 | for build in sample_data: | 417 | for build in sample_data: |
2952 | 418 | build.buildstate = BuildStatus.FULLYBUILT | 418 | build.buildstate = BuildStatus.FULLYBUILT |
2953 | 419 | store.flush() | 419 | store.flush() |
2954 | 420 | 420 | ||
2955 | === modified file 'lib/lp/soyuz/tests/test_build.py' | |||
2956 | --- lib/lp/soyuz/tests/test_build.py 2010-03-06 04:57:40 +0000 | |||
2957 | +++ lib/lp/soyuz/tests/test_build.py 2010-04-13 06:59:32 +0000 | |||
2958 | @@ -16,7 +16,8 @@ | |||
2959 | 16 | from lp.buildmaster.interfaces.buildbase import BuildStatus, IBuildBase | 16 | from lp.buildmaster.interfaces.buildbase import BuildStatus, IBuildBase |
2960 | 17 | from lp.buildmaster.interfaces.builder import IBuilderSet | 17 | from lp.buildmaster.interfaces.builder import IBuilderSet |
2961 | 18 | from lp.buildmaster.model.buildqueue import BuildQueue | 18 | from lp.buildmaster.model.buildqueue import BuildQueue |
2963 | 19 | from lp.soyuz.interfaces.build import IBuild, IBuildSet | 19 | from lp.soyuz.interfaces.binarypackagebuild import ( |
2964 | 20 | IBinaryPackageBuild, IBinaryPackageBuildSet) | ||
2965 | 20 | from lp.soyuz.interfaces.component import IComponentSet | 21 | from lp.soyuz.interfaces.component import IComponentSet |
2966 | 21 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 22 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
2967 | 22 | from lp.soyuz.model.buildpackagejob import BuildPackageJob | 23 | from lp.soyuz.model.buildpackagejob import BuildPackageJob |
2968 | @@ -38,13 +39,13 @@ | |||
2969 | 38 | sourcename="gedit", status=PackagePublishingStatus.PUBLISHED) | 39 | sourcename="gedit", status=PackagePublishingStatus.PUBLISHED) |
2970 | 39 | build = gedit_src_hist.createMissingBuilds()[0] | 40 | build = gedit_src_hist.createMissingBuilds()[0] |
2971 | 40 | 41 | ||
2973 | 41 | # The IBuild.calculated_buildstart property asserts | 42 | # The IBinaryPackageBuild.calculated_buildstart property asserts |
2974 | 42 | # that both datebuilt and buildduration are set. | 43 | # that both datebuilt and buildduration are set. |
2975 | 43 | build.datebuilt = datetime.now(pytz.UTC) | 44 | build.datebuilt = datetime.now(pytz.UTC) |
2976 | 44 | build.buildduration = timedelta(0, 1) | 45 | build.buildduration = timedelta(0, 1) |
2977 | 45 | 46 | ||
2978 | 46 | self.assertProvides(build, IBuildBase) | 47 | self.assertProvides(build, IBuildBase) |
2980 | 47 | self.assertProvides(build, IBuild) | 48 | self.assertProvides(build, IBinaryPackageBuild) |
2981 | 48 | 49 | ||
2982 | 49 | class TestBuildUpdateDependencies(TestCaseWithFactory): | 50 | class TestBuildUpdateDependencies(TestCaseWithFactory): |
2983 | 50 | 51 | ||
2984 | @@ -53,7 +54,7 @@ | |||
2985 | 53 | def _setupSimpleDepwaitContext(self): | 54 | def _setupSimpleDepwaitContext(self): |
2986 | 54 | """Use `SoyuzTestPublisher` to setup a simple depwait context. | 55 | """Use `SoyuzTestPublisher` to setup a simple depwait context. |
2987 | 55 | 56 | ||
2989 | 56 | Return an `IBuild` in MANUALDEWAIT state and depending on a | 57 | Return an `IBinaryPackageBuild` in MANUALDEWAIT state and depending on a |
2990 | 57 | binary that exists and is reachable. | 58 | binary that exists and is reachable. |
2991 | 58 | """ | 59 | """ |
2992 | 59 | test_publisher = SoyuzTestPublisher() | 60 | test_publisher = SoyuzTestPublisher() |
2993 | @@ -107,14 +108,14 @@ | |||
2994 | 107 | 0) | 108 | 0) |
2995 | 108 | 109 | ||
2996 | 109 | def testUpdateDependenciesWorks(self): | 110 | def testUpdateDependenciesWorks(self): |
2998 | 110 | # Calling `IBuild.updateDependencies` makes the build | 111 | # Calling `IBinaryPackageBuild.updateDependencies` makes the build |
2999 | 111 | # record ready for dispatch. | 112 | # record ready for dispatch. |
3000 | 112 | depwait_build = self._setupSimpleDepwaitContext() | 113 | depwait_build = self._setupSimpleDepwaitContext() |
3001 | 113 | depwait_build.updateDependencies() | 114 | depwait_build.updateDependencies() |
3002 | 114 | self.assertEquals(depwait_build.dependencies, '') | 115 | self.assertEquals(depwait_build.dependencies, '') |
3003 | 115 | 116 | ||
3004 | 116 | def testInvalidDependencies(self): | 117 | def testInvalidDependencies(self): |
3006 | 117 | # Calling `IBuild.updateDependencies` on a build with | 118 | # Calling `IBinaryPackageBuild.updateDependencies` on a build with |
3007 | 118 | # invalid 'dependencies' raises an AssertionError. | 119 | # invalid 'dependencies' raises an AssertionError. |
3008 | 119 | # Anything not following '<name> [([relation] <version>)][, ...]' | 120 | # Anything not following '<name> [([relation] <version>)][, ...]' |
3009 | 120 | depwait_build = self._setupSimpleDepwaitContext() | 121 | depwait_build = self._setupSimpleDepwaitContext() |
3010 | @@ -140,10 +141,10 @@ | |||
3011 | 140 | AssertionError, depwait_build.updateDependencies) | 141 | AssertionError, depwait_build.updateDependencies) |
3012 | 141 | 142 | ||
3013 | 142 | def testBug378828(self): | 143 | def testBug378828(self): |
3018 | 143 | # `IBuild.updateDependencies` copes with the scenario where | 144 | # `IBinaryPackageBuild.updateDependencies` copes with the |
3019 | 144 | # the corresponding source publication is not active (deleted) | 145 | # scenario where the corresponding source publication is not |
3020 | 145 | # and the source original component is not a valid ubuntu | 146 | # active (deleted) and the source original component is not a |
3021 | 146 | # component. | 147 | # valid ubuntu component. |
3022 | 147 | depwait_build = self._setupSimpleDepwaitContext() | 148 | depwait_build = self._setupSimpleDepwaitContext() |
3023 | 148 | 149 | ||
3024 | 149 | depwait_build.current_source_publication.requestDeletion( | 150 | depwait_build.current_source_publication.requestDeletion( |
3025 | @@ -194,7 +195,7 @@ | |||
3026 | 194 | 195 | ||
3027 | 195 | # Short-cuts for our tests. | 196 | # Short-cuts for our tests. |
3028 | 196 | self.archive = self.publisher.distroseries.main_archive | 197 | self.archive = self.publisher.distroseries.main_archive |
3030 | 197 | self.build_set = getUtility(IBuildSet) | 198 | self.build_set = getUtility(IBinaryPackageBuildSet) |
3031 | 198 | 199 | ||
3032 | 199 | def test_getBuildsForArchive_no_params(self): | 200 | def test_getBuildsForArchive_no_params(self): |
3033 | 200 | # All builds should be returned when called without filtering | 201 | # All builds should be returned when called without filtering |
3034 | @@ -218,7 +219,7 @@ | |||
3035 | 218 | super(TestBuildSetGetBuildsForBuilder, self).setUp() | 219 | super(TestBuildSetGetBuildsForBuilder, self).setUp() |
3036 | 219 | 220 | ||
3037 | 220 | # Short-cuts for our tests. | 221 | # Short-cuts for our tests. |
3039 | 221 | self.build_set = getUtility(IBuildSet) | 222 | self.build_set = getUtility(IBinaryPackageBuildSet) |
3040 | 222 | 223 | ||
3041 | 223 | # Create a 386 builder | 224 | # Create a 386 builder |
3042 | 224 | owner = self.factory.makePerson() | 225 | owner = self.factory.makePerson() |
3043 | 225 | 226 | ||
3044 | === modified file 'lib/lp/soyuz/tests/test_buildpackagejob.py' | |||
3045 | --- lib/lp/soyuz/tests/test_buildpackagejob.py 2010-03-06 04:57:40 +0000 | |||
3046 | +++ lib/lp/soyuz/tests/test_buildpackagejob.py 2010-04-13 06:59:32 +0000 | |||
3047 | @@ -15,7 +15,7 @@ | |||
3048 | 15 | from lp.buildmaster.interfaces.builder import IBuilderSet | 15 | from lp.buildmaster.interfaces.builder import IBuilderSet |
3049 | 16 | from lp.soyuz.interfaces.archive import ArchivePurpose | 16 | from lp.soyuz.interfaces.archive import ArchivePurpose |
3050 | 17 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 17 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
3052 | 18 | from lp.soyuz.model.build import Build | 18 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
3053 | 19 | from lp.soyuz.model.processor import ProcessorFamilySet | 19 | from lp.soyuz.model.processor import ProcessorFamilySet |
3054 | 20 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | 20 | from lp.soyuz.tests.test_publishing import SoyuzTestPublisher |
3055 | 21 | from lp.testing import TestCaseWithFactory | 21 | from lp.testing import TestCaseWithFactory |
3056 | @@ -126,7 +126,7 @@ | |||
3057 | 126 | 126 | ||
3058 | 127 | # First mark all builds in the sample data as already built. | 127 | # First mark all builds in the sample data as already built. |
3059 | 128 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 128 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
3061 | 129 | sample_data = store.find(Build) | 129 | sample_data = store.find(BinaryPackageBuild) |
3062 | 130 | for build in sample_data: | 130 | for build in sample_data: |
3063 | 131 | build.buildstate = BuildStatus.FULLYBUILT | 131 | build.buildstate = BuildStatus.FULLYBUILT |
3064 | 132 | store.flush() | 132 | store.flush() |
rubber stamped!