Merge lp:~stevenk/launchpad/drop-builder-description into lp:launchpad

Proposed by Steve Kowalik on 2012-05-29
Status: Merged
Approved by: William Grant on 2012-05-29
Approved revision: no longer in the source branch.
Merged at revision: 15323
Proposed branch: lp:~stevenk/launchpad/drop-builder-description
Merge into: lp:launchpad
Diff against target: 314 lines (+42/-78)
10 files modified
lib/lp/buildmaster/doc/builder.txt (+2/-2)
lib/lp/buildmaster/interfaces/builder.py (+8/-14)
lib/lp/buildmaster/model/builder.py (+4/-6)
lib/lp/soyuz/browser/builder.py (+4/-7)
lib/lp/soyuz/browser/tests/builder-views.txt (+14/-31)
lib/lp/soyuz/stories/soyuz/xx-builder-page.txt (+2/-4)
lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt (+2/-3)
lib/lp/soyuz/stories/webservice/xx-builders.txt (+0/-1)
lib/lp/soyuz/tests/test_binarypackagebuild.py (+2/-4)
lib/lp/testing/factory.py (+4/-6)
To merge this branch: bzr merge lp:~stevenk/launchpad/drop-builder-description
Reviewer Review Type Date Requested Status
William Grant code 2012-05-29 Approve on 2012-05-29
Review via email: mp+107698@code.launchpad.net

Commit Message

Delete the code portions of Builder.description.

Description of the Change

Following on my branch that drops the NOT NULL constraint from Builder.description, this branch removes it from the code and tests.

I have also refactored the portion of builder-views.txt that creates builders to not be disgusting and make small children cry.

To post a comment you must log in.
William Grant (wgrant) :
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 2011-12-24 17:49:30 +0000
3+++ lib/lp/buildmaster/doc/builder.txt 2012-05-29 22:37:30 +0000
4@@ -82,8 +82,8 @@
5
6 The 'new' method will create a new builder in the database.
7
8- >>> bnew = builderset.new(1, 'http://dummy.com:8221/', 'dummy',
9- ... 'Dummy Title', 'eh ?', 1)
10+ >>> bnew = builderset.new(
11+ ... 1, 'http://dummy.com:8221/', 'dummy', 'Dummy Title', 1)
12 >>> bnew.name
13 u'dummy'
14
15
16=== modified file 'lib/lp/buildmaster/interfaces/builder.py'
17--- lib/lp/buildmaster/interfaces/builder.py 2012-02-09 23:09:36 +0000
18+++ lib/lp/buildmaster/interfaces/builder.py 2012-05-29 22:37:30 +0000
19@@ -1,4 +1,4 @@
20-# Copyright 2009 Canonical Ltd. This software is licensed under the
21+# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
22 # GNU Affero General Public License version 3 (see the file LICENSE).
23
24 # pylint: disable-msg=E0211,E0213
25@@ -102,11 +102,11 @@
26 Builder instance represents a single builder slave machine within the
27 Launchpad Auto Build System. It should specify a 'processor' on which the
28 machine is based and is able to build packages for; a URL, by which the
29- machine is accessed through an XML-RPC interface; name, title,
30- description for entity identification and browsing purposes; an LP-like
31- owner which has unrestricted access to the instance; the build slave
32- machine status representation, including the field/properties:
33- virtualized, builderok, status, failnotes and currentjob.
34+ machine is accessed through an XML-RPC interface; name, title for entity
35+ identification and browsing purposes; an LP-like owner which has
36+ unrestricted access to the instance; the build slave machine status
37+ representation, including the field/properties: virtualized, builderok,
38+ status, failnotes and currentjob.
39 """
40 export_as_webservice_entry()
41
42@@ -139,12 +139,6 @@
43 description=_(
44 'The builder slave title. Should be just a few words.')))
45
46- description = exported(Description(
47- title=_('Description'), required=False,
48- description=_('The builder slave description, may be several '
49- 'paragraphs of text, giving the highlights and '
50- 'details.')))
51-
52 virtualized = exported(Bool(
53 title=_('Virtualized'), required=True, default=False,
54 description=_('Whether or not the builder is a virtual Xen '
55@@ -367,8 +361,8 @@
56 def getByName(name):
57 """Retrieve a builder by name"""
58
59- def new(processor, url, name, title, description, owner,
60- active=True, virtualized=False, vm_host=None):
61+ def new(processor, url, name, title, owner, active=True,
62+ virtualized=False, vm_host=None):
63 """Create a new Builder entry.
64
65 Additionally to the given arguments, builder are created with
66
67=== modified file 'lib/lp/buildmaster/model/builder.py'
68--- lib/lp/buildmaster/model/builder.py 2012-02-28 04:24:19 +0000
69+++ lib/lp/buildmaster/model/builder.py 2012-05-29 22:37:30 +0000
70@@ -410,7 +410,6 @@
71 url = StringCol(dbName='url', notNull=True)
72 name = StringCol(dbName='name', notNull=True)
73 title = StringCol(dbName='title', notNull=True)
74- description = StringCol(dbName='description', notNull=True)
75 owner = ForeignKey(
76 dbName='owner', foreignKey='Person',
77 storm_validator=validate_public_person, notNull=True)
78@@ -883,13 +882,12 @@
79 def __getitem__(self, name):
80 return self.getByName(name)
81
82- def new(self, processor, url, name, title, description, owner,
83- active=True, virtualized=False, vm_host=None, manual=True):
84+ def new(self, processor, url, name, title, owner, active=True,
85+ virtualized=False, vm_host=None, manual=True):
86 """See IBuilderSet."""
87 return Builder(processor=processor, url=url, name=name, title=title,
88- description=description, owner=owner, active=active,
89- virtualized=virtualized, vm_host=vm_host,
90- _builderok=True, manual=manual)
91+ owner=owner, active=active, virtualized=virtualized,
92+ vm_host=vm_host, _builderok=True, manual=manual)
93
94 def get(self, builder_id):
95 """See IBuilderSet."""
96
97=== modified file 'lib/lp/soyuz/browser/builder.py'
98--- lib/lp/soyuz/browser/builder.py 2012-03-27 04:00:45 +0000
99+++ lib/lp/soyuz/browser/builder.py 2012-05-29 22:37:30 +0000
100@@ -321,12 +321,11 @@
101 label = "Register a new build machine"
102
103 field_names = [
104- 'name', 'title', 'description', 'processor', 'url',
105- 'active', 'virtualized', 'vm_host', 'owner'
106+ 'name', 'title', 'processor', 'url', 'active', 'virtualized',
107+ 'vm_host', 'owner'
108 ]
109
110 custom_widget('owner', HiddenUserWidget)
111- custom_widget('description', TextAreaWidget, height=3)
112 custom_widget('url', TextWidget, displayWidth=30)
113 custom_widget('vm_host', TextWidget, displayWidth=30)
114
115@@ -338,7 +337,6 @@
116 url=data.get('url'),
117 name=data.get('name'),
118 title=data.get('title'),
119- description=data.get('description'),
120 owner=data.get('owner'),
121 active=data.get('active'),
122 virtualized=data.get('virtualized'),
123@@ -364,9 +362,8 @@
124 schema = IBuilder
125
126 field_names = [
127- 'name', 'title', 'description', 'processor', 'url', 'manual',
128- 'owner', 'virtualized', 'builderok', 'failnotes', 'vm_host',
129- 'active',
130+ 'name', 'title', 'processor', 'url', 'manual', 'owner',
131+ 'virtualized', 'builderok', 'failnotes', 'vm_host', 'active',
132 ]
133
134 @action(_('Change'), name='update')
135
136=== modified file 'lib/lp/soyuz/browser/tests/builder-views.txt'
137--- lib/lp/soyuz/browser/tests/builder-views.txt 2011-12-30 06:14:56 +0000
138+++ lib/lp/soyuz/browser/tests/builder-views.txt 2012-05-29 22:37:30 +0000
139@@ -67,7 +67,6 @@
140 ... print field_name
141 name
142 title
143- description
144 processor
145 url
146 manual
147@@ -259,40 +258,24 @@
148 >>> amd64 = Processor.selectOneBy(name='amd64')
149 >>> hppa = Processor.selectOneBy(name='hppa')
150
151- >>> a_builder = builderset.new(
152- ... i386, url='http://hamburger', name="hamburger",
153- ... title="The Hamburger Builder", description="Uhmmm", owner=cprov,
154- ... virtualized=True)
155-
156- >>> a_builder = builderset.new(
157- ... hppa, url='http://cheese', name="cheese",
158- ... title="The Cheese Builder", description="Uhmmm", owner=cprov,
159- ... virtualized=True)
160-
161- >>> a_builder = builderset.new(
162- ... amd64, url='http://bacon', name="bacon",
163- ... title="The Bacon Builder", description="Uhmmm", owner=cprov,
164- ... virtualized=True)
165-
166- >>> a_builder = builderset.new(
167- ... i386, url='http://egg', name="egg",
168- ... title="The Egg Builder", description="Uhmmm", owner=cprov,
169- ... virtualized=False)
170-
171- >>> a_builder = builderset.new(
172- ... hppa, url='http://ham', name="ham",
173- ... title="The Ham Builder", description="Uhmmm", owner=cprov,
174- ... virtualized=False)
175-
176- >>> a_builder = builderset.new(
177- ... amd64, url='http://prosciuto', name="prosciuto",
178- ... title="The Prosciuto Builder", description="Uhmmm", owner=cprov,
179- ... virtualized=False)
180+ >>> ignored = factory.makeBuilder(
181+ ... name='hamburger', processor=i386, virtualized=True)
182+ >>> ignored = factory.makeBuilder(
183+ ... name='cheese', processor=hppa, virtualized=True)
184+ >>> ignored = factory.makeBuilder(
185+ ... name='bacon', processor=amd64, virtualized=True)
186+ >>> ignored = factory.makeBuilder(
187+ ... name='egg', processor=i386, virtualized=False)
188+ >>> ignored = factory.makeBuilder(
189+ ... name='ham', processor=hppa, virtualized=False, manual=True)
190+ >>> ignored = factory.makeBuilder(
191+ ... name='prosciuto', processor=amd64, virtualized=False)
192
193 Newly created builders will be in manual mode because we don't want
194 them going straight into the build farm until tested.
195
196- >>> a_builder.manual
197+ >>> ham = builderset.getByName('ham')
198+ >>> ham.manual
199 True
200
201 The 'Other' builder category is a `BuilderCategory` class, which
202
203=== modified file 'lib/lp/soyuz/stories/soyuz/xx-builder-page.txt'
204--- lib/lp/soyuz/stories/soyuz/xx-builder-page.txt 2012-03-07 05:16:26 +0000
205+++ lib/lp/soyuz/stories/soyuz/xx-builder-page.txt 2012-05-29 22:37:30 +0000
206@@ -40,8 +40,8 @@
207 Updated on ...
208
209 The anonymous user can see the builder details portlet and it contains
210-information about the builder itself, like name, architecture,
211-location and description.
212+information about the builder itself, like name, architecture and
213+location.
214
215 >>> print extract_text(
216 ... find_portlet(anon_browser.contents, 'Builder information'))
217@@ -86,8 +86,6 @@
218 'bob'
219 >>> cprov_browser.getControl(name="field.title").value
220 'Bob The Builder'
221- >>> cprov_browser.getControl(name="field.description").value
222- 'The default build-slave'
223 >>> cprov_browser.getControl(name="field.processor").value
224 ['386']
225 >>> cprov_browser.getControl(name="field.owner").value
226
227=== modified file 'lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt'
228--- lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt 2012-03-07 05:16:26 +0000
229+++ lib/lp/soyuz/stories/soyuz/xx-buildfarm-index.txt 2012-05-29 22:37:30 +0000
230@@ -129,12 +129,11 @@
231 >>> print admin_browser.title
232 Register a new...
233
234-Registering a new builder involves setting its name, title,
235-description and corresponding location.
236+Registering a new builder involves setting its name, title and corresponding
237+location.
238
239 >>> admin_browser.getControl('Name').value = 'tubaina'
240 >>> admin_browser.getControl('Title').value = 'Tubaina'
241- >>> admin_browser.getControl('Description').value = 'Bogus'
242 >>> admin_browser.getControl(
243 ... 'URL').value = 'http://tubaina.buildd'
244
245
246=== modified file 'lib/lp/soyuz/stories/webservice/xx-builders.txt'
247--- lib/lp/soyuz/stories/webservice/xx-builders.txt 2010-10-26 16:51:20 +0000
248+++ lib/lp/soyuz/stories/webservice/xx-builders.txt 2012-05-29 22:37:30 +0000
249@@ -29,7 +29,6 @@
250 ...
251 active
252 builderok
253- description
254 failnotes
255 failure_count
256 manual
257
258=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuild.py'
259--- lib/lp/soyuz/tests/test_binarypackagebuild.py 2012-04-06 23:20:43 +0000
260+++ lib/lp/soyuz/tests/test_binarypackagebuild.py 2012-05-29 22:37:30 +0000
261@@ -15,7 +15,6 @@
262 from zope.security.proxy import removeSecurityProxy
263
264 from lp.buildmaster.enums import BuildStatus
265-from lp.buildmaster.interfaces.builder import IBuilderSet
266 from lp.buildmaster.interfaces.buildqueue import IBuildQueue
267 from lp.buildmaster.interfaces.packagebuild import IPackageBuild
268 from lp.buildmaster.model.builder import BuilderSlave
269@@ -478,11 +477,10 @@
270 owner = self.factory.makePerson()
271 processor_family = ProcessorFamilySet().getByProcessorName('386')
272 processor = processor_family.processors[0]
273- builder_set = getUtility(IBuilderSet)
274
275- self.builder = builder_set.new(
276+ self.builder = self.factory.makeBuilder(
277 processor, 'http://example.com', 'Newbob', 'New Bob the Builder',
278- 'A new and improved bob.', owner)
279+ owner=owner)
280
281 # Ensure that our builds were all built by the test builder.
282 for build in self.builds:
283
284=== modified file 'lib/lp/testing/factory.py'
285--- lib/lp/testing/factory.py 2012-05-25 01:48:31 +0000
286+++ lib/lp/testing/factory.py 2012-05-29 22:37:30 +0000
287@@ -2743,8 +2743,8 @@
288 return person
289
290 def makeBuilder(self, processor=None, url=None, name=None, title=None,
291- description=None, owner=None, active=True,
292- virtualized=True, vm_host=None, manual=False):
293+ owner=None, active=True, virtualized=True, vm_host=None,
294+ manual=False):
295 """Make a new builder for i386 virtualized builds by default.
296
297 Note: the builder returned will not be able to actually build -
298@@ -2760,14 +2760,12 @@
299 name = self.getUniqueString('builder-name')
300 if title is None:
301 title = self.getUniqueString('builder-title')
302- if description is None:
303- description = self.getUniqueString('description')
304 if owner is None:
305 owner = self.makePerson()
306
307 return getUtility(IBuilderSet).new(
308- processor, url, name, title, description, owner, active,
309- virtualized, vm_host, manual=manual)
310+ processor, url, name, title, owner, active, virtualized, vm_host,
311+ manual=manual)
312
313 def makeRecipeText(self, *branches):
314 if len(branches) == 0: