Merge lp:~jml/launchpad/remove-builder-status into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/remove-builder-status
Merge into: lp:launchpad
Diff against target: 274 lines (+4/-133)
7 files modified
lib/lp/buildmaster/doc/builder.txt (+0/-63)
lib/lp/buildmaster/doc/buildfarmjobbehavior.txt (+3/-24)
lib/lp/buildmaster/interfaces/builder.py (+0/-2)
lib/lp/buildmaster/interfaces/buildfarmjobbehavior.py (+1/-4)
lib/lp/buildmaster/model/builder.py (+0/-18)
lib/lp/soyuz/browser/tests/builder-views.txt (+0/-12)
lib/lp/soyuz/model/binarypackagebuildbehavior.py (+0/-10)
To merge this branch: bzr merge lp:~jml/launchpad/remove-builder-status
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+17262@code.launchpad.net

Commit message

Remove IBuilder.status and IBuildFarmJobBehaviour.status, neither of which are actually used.

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

It looks like Builder.status and BuildJobBehaviour.status aren't used. This branch deletes them.

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks again Jonathan. Please check the text in the documentation at the points where you've removed the status examples, I think you'll find they need to be updated, but other than that, r=me.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/buildmaster/doc/builder.txt'
2--- lib/lp/buildmaster/doc/builder.txt 2010-01-13 04:41:19 +0000
3+++ lib/lp/buildmaster/doc/builder.txt 2010-01-13 20:22:13 +0000
4@@ -23,20 +23,6 @@
5 >>> print builder.name
6 bob
7
8-Test 'status' property:
9-
10- >>> print builder.status
11- Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE
12-
13- >>> builder.manual = True
14- >>> print builder.status
15- Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE
16-
17- >>> builder.builderok = False
18- >>> builder.failnotes = 'Could not open Socket'
19- >>> print builder.status
20- Could not open Socket
21-
22 >>> builder.builderok = True
23 >>> builder.failnotes = None
24
25@@ -52,55 +38,6 @@
26 ... builder.current_build_behavior, BinaryPackageBuildBehavior)
27 True
28
29-In case of copy archives the status string will show both the copy
30-archive owner as well as the copy archive name.
31-
32- >>> from lp.soyuz.interfaces.archive import ArchivePurpose
33- >>> from zope.security.proxy import removeSecurityProxy
34- >>> from lp.soyuz.interfaces.build import IBuildSet
35- >>> build = getUtility(IBuildSet).getByQueueEntry(builder.currentjob)
36- >>> builder_archive = removeSecurityProxy(
37- ... build.archive)
38- >>> saved_purpose = builder_archive.purpose
39- >>> builder_archive.purpose = ArchivePurpose.COPY
40-
41-The archive owner and name are shown at the end of the status string.
42-
43- >>> print builder.status
44- Building ... mozilla-firefox 0.9 in ubuntu ... [ubuntu-team/primary]
45-
46-Similarly, the status for a build in a PPA will show the owner and the
47-archive name:
48-
49- >>> builder_archive.purpose = ArchivePurpose.PPA
50- >>> print builder.status
51- Building ... mozilla-firefox 0.9 in ubuntu ... [ubuntu-team/primary]
52-
53-The name of a PRIVATE team cannot be displayed publicly, so it is we
54-simply don't bother in adding the PPA information in the content
55-class domain.
56-
57- # Create a new PRIVATE team and reassign the building PPA to it.
58- >>> from lp.registry.interfaces.person import (
59- ... IPersonSet, PersonVisibility)
60- >>> login('foo.bar@canonical.com')
61- >>> salgado = getUtility(IPersonSet).getByName('salgado')
62- >>> private_team = factory.makeTeam(
63- ... salgado, name='private-team',
64- ... displayname='Private Team',
65- ... visibility=PersonVisibility.PRIVATE)
66- >>> saved_owner = builder_archive.owner
67- >>> builder_archive.owner = private_team
68- >>> login(ANONYMOUS)
69-
70- >>> print builder.status
71- Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE
72-
73-Restore the original archive purpose and owner.
74-
75- >>> builder_archive.purpose = saved_purpose
76- >>> builder_archive.owner = saved_owner
77-
78 Confirm we can get the slave xmlrpc interface
79
80 >>> s = builder.slave
81
82=== modified file 'lib/lp/buildmaster/doc/buildfarmjobbehavior.txt'
83--- lib/lp/buildmaster/doc/buildfarmjobbehavior.txt 2010-01-13 04:41:19 +0000
84+++ lib/lp/buildmaster/doc/buildfarmjobbehavior.txt 2010-01-13 20:22:13 +0000
85@@ -33,10 +33,6 @@
86 ...
87 ... def dispatchBuildToSlave(self, build_queue_item_id, logger):
88 ... print "Did something special to dispatch MySpecialBuild."
89- ...
90- ... @property
91- ... def status(self):
92- ... return "Currently building a MyNewBuild object."
93
94 For this documentation, we'll also need a dummy new build farm job.
95
96@@ -65,16 +61,14 @@
97
98 This will then allow the builder to request and set the required behavior from
99 the current job. Bob the builder currently has a binary package job and so
100-finds itself with a binary package build behavior which defines the status
101-attribute with some binary-build specific information.
102+finds itself with a binary package build behavior which defines binary-build
103+specific information.
104
105 >>> from lp.buildmaster.model.builder import Builder
106 >>> from canonical.launchpad.webapp.interfaces import (
107 ... IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)
108 >>> store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
109 >>> bob = store.find(Builder, Builder.name == 'bob').one()
110- >>> print bob.status
111- Building i386 build of mozilla-firefox 0.9 in ubuntu hoary RELEASE
112
113 XXX Michael Nelson 2009-12-04 bug 484819. At the time of writing the
114 BuildQueue.specific_job method has not been updated to support different
115@@ -85,19 +79,7 @@
116
117 Once the builder has the relevant behavior, it is able to provide both general
118 builder functionality of its own accord, while delegating any build-type
119-specific functionality to the behavior. For example, if the builder is not
120-disabled, the builder delegates the status property to the behavior.
121-
122- >>> print bob.status
123- Currently building a MyNewBuild object.
124-
125-On the other hand, if the builder is disabled, the builder itself determines
126-the status.
127-
128- >>> bob.builderok = False
129- >>> print bob.status
130- Disabled
131- >>> bob.builderok = True
132+specific functionality to the behavior.
133
134 The IBuildFarmJobBehavior interface currently provides customisation points
135 throughout the build life-cycle, from logging the start of a build, verifying
136@@ -120,9 +102,6 @@
137 >>> bob.current_build_behavior = None
138 >>> bob.currentjob.destroySelf()
139
140- >>> print bob.status
141- Idle
142-
143 Attempting to use any other build-related functionality when a builder is
144 idle, such as making a call to log the start of a build, will raise an
145 appropriate exception.
146
147=== modified file 'lib/lp/buildmaster/interfaces/builder.py'
148--- lib/lp/buildmaster/interfaces/builder.py 2010-01-13 04:41:19 +0000
149+++ lib/lp/buildmaster/interfaces/builder.py 2010-01-13 20:22:13 +0000
150@@ -143,8 +143,6 @@
151
152 currentjob = Attribute("BuildQueue instance for job being processed.")
153
154- status = Attribute("Generated status information")
155-
156 is_available = Bool(
157 title=_("Whether or not a builder is available for building "
158 "new jobs. "),
159
160=== modified file 'lib/lp/buildmaster/interfaces/buildfarmjobbehavior.py'
161--- lib/lp/buildmaster/interfaces/buildfarmjobbehavior.py 2010-01-11 21:59:08 +0000
162+++ lib/lp/buildmaster/interfaces/buildfarmjobbehavior.py 2010-01-13 20:22:13 +0000
163@@ -12,7 +12,7 @@
164 'IBuildFarmJobBehavior',
165 ]
166
167-from zope.interface import Attribute, Interface
168+from zope.interface import Interface
169
170
171 class BuildBehaviorMismatch(Exception):
172@@ -24,9 +24,6 @@
173
174 class IBuildFarmJobBehavior(Interface):
175
176- status = Attribute(
177- "Generated status information for this particular job.")
178-
179 def setBuilder(builder):
180 """Sets the associated builder reference for this instance."""
181
182
183=== modified file 'lib/lp/buildmaster/model/builder.py'
184--- lib/lp/buildmaster/model/builder.py 2010-01-13 05:07:42 +0000
185+++ lib/lp/buildmaster/model/builder.py 2010-01-13 20:22:13 +0000
186@@ -331,24 +331,6 @@
187 self.handleTimeout(logger, error_message)
188 raise BuildSlaveFailure
189
190-
191- # XXX cprov 2009-06-24: This code does not belong to the content
192- # class domain. Here we cannot make sensible decisions about what
193- # we are allowed to present according to the request user. Then
194- # bad things happens, see bug #391721.
195-
196- @property
197- def status(self):
198- """See IBuilder"""
199- if not self.builderok:
200- if self.failnotes is not None:
201- return self.failnotes
202- return 'Disabled'
203-
204- # If the builder is OK then we delegate the status
205- # to our current behavior.
206- return self.current_build_behavior.status
207-
208 def failbuilder(self, reason):
209 """See IBuilder"""
210 self.builderok = False
211
212=== modified file 'lib/lp/soyuz/browser/tests/builder-views.txt'
213--- lib/lp/soyuz/browser/tests/builder-views.txt 2009-12-14 21:13:49 +0000
214+++ lib/lp/soyuz/browser/tests/builder-views.txt 2010-01-13 20:22:13 +0000
215@@ -171,7 +171,6 @@
216 * Frog is OK;
217 * Frog 'currentjob' exists;
218 * Frog has no 'failnotes';
219- * Frog status exposes its 'currentjob'.
220
221 >>> print frog.builderok
222 True
223@@ -184,10 +183,6 @@
224 >>> print frog.failnotes
225 None
226
227- >>> print frog.status
228- Building i386 build of privacy-test 666 in ubuntutest breezy-autotest
229- RELEASE [cprov/ppa]
230-
231 Accessing the view for $builder/+index as a Foo Bar, which has
232 launchpad.View permission on the target archive of the 'currentjob',
233 all the 'private' information is exposed.
234@@ -209,10 +204,6 @@
235 >>> print admin_view.context.failnotes
236 None
237
238- >>> print admin_view.context.status
239- Building i386 build of privacy-test 666 in ubuntutest breezy-autotest
240- RELEASE [cprov/ppa]
241-
242 >>> import datetime
243 >>> import pytz
244 >>> private_job.setDateStarted(
245@@ -233,9 +224,6 @@
246 >>> login('no-priv@canonical.com')
247 >>> nopriv_view = getMultiAdapter((frog, empty_request), name="+index")
248
249- >>> print nopriv_view.context.status
250- Idle
251-
252 >>> login(ANONYMOUS)
253
254
255
256=== modified file 'lib/lp/soyuz/model/binarypackagebuildbehavior.py'
257--- lib/lp/soyuz/model/binarypackagebuildbehavior.py 2010-01-13 04:41:19 +0000
258+++ lib/lp/soyuz/model/binarypackagebuildbehavior.py 2010-01-13 20:22:13 +0000
259@@ -41,16 +41,6 @@
260 logger.info("startBuild(%s, %s, %s, %s)", self._builder.url,
261 spr.name, spr.version, self.build.pocket.title)
262
263- @property
264- def status(self):
265- """See `IBuildFarmJobBehavior`."""
266- msg = 'Building %s' % self.build.title
267- archive = self.build.archive
268- if not archive.owner.private and (archive.is_ppa or archive.is_copy):
269- return '%s [%s/%s]' % (msg, archive.owner.name, archive.name)
270- else:
271- return msg
272-
273 def dispatchBuildToSlave(self, build_queue_id, logger):
274 """See `IBuildFarmJobBehavior`."""
275