← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/drop-builder-description into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #984342 in Launchpad itself: "description field for builder is optional but mandatory for DB"
  https://bugs.launchpad.net/launchpad/+bug/984342

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/drop-builder-description/+merge/107698

Following on my branch that drops the NOT NULL constraint from Builder.description, this branch removes it from the code and tests.
-- 
https://code.launchpad.net/~stevenk/launchpad/drop-builder-description/+merge/107698
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/drop-builder-description into lp:launchpad.
=== modified file 'lib/lp/buildmaster/interfaces/builder.py'
--- lib/lp/buildmaster/interfaces/builder.py	2012-02-09 23:09:36 +0000
+++ lib/lp/buildmaster/interfaces/builder.py	2012-05-29 01:31:21 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2012 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 # pylint: disable-msg=E0211,E0213
@@ -102,11 +102,11 @@
     Builder instance represents a single builder slave machine within the
     Launchpad Auto Build System. It should specify a 'processor' on which the
     machine is based and is able to build packages for; a URL, by which the
-    machine is accessed through an XML-RPC interface; name, title,
-    description for entity identification and browsing purposes; an LP-like
-    owner which has unrestricted access to the instance; the build slave
-    machine status representation, including the field/properties:
-    virtualized, builderok, status, failnotes and currentjob.
+    machine is accessed through an XML-RPC interface; name, title for entity
+    identification and browsing purposes; an LP-like owner which has
+    unrestricted access to the instance; the build slave machine status
+    representation, including the field/properties: virtualized, builderok,
+    status, failnotes and currentjob.
     """
     export_as_webservice_entry()
 
@@ -139,12 +139,6 @@
         description=_(
             'The builder slave title. Should be just a few words.')))
 
-    description = exported(Description(
-        title=_('Description'), required=False,
-        description=_('The builder slave description, may be several '
-                      'paragraphs of text, giving the highlights and '
-                      'details.')))
-
     virtualized = exported(Bool(
         title=_('Virtualized'), required=True, default=False,
         description=_('Whether or not the builder is a virtual Xen '
@@ -367,8 +361,8 @@
     def getByName(name):
         """Retrieve a builder by name"""
 
-    def new(processor, url, name, title, description, owner,
-            active=True, virtualized=False, vm_host=None):
+    def new(processor, url, name, title, owner, active=True,
+            virtualized=False, vm_host=None):
         """Create a new Builder entry.
 
         Additionally to the given arguments, builder are created with

=== modified file 'lib/lp/buildmaster/model/builder.py'
--- lib/lp/buildmaster/model/builder.py	2012-02-28 04:24:19 +0000
+++ lib/lp/buildmaster/model/builder.py	2012-05-29 01:31:21 +0000
@@ -410,7 +410,6 @@
     url = StringCol(dbName='url', notNull=True)
     name = StringCol(dbName='name', notNull=True)
     title = StringCol(dbName='title', notNull=True)
-    description = StringCol(dbName='description', notNull=True)
     owner = ForeignKey(
         dbName='owner', foreignKey='Person',
         storm_validator=validate_public_person, notNull=True)
@@ -883,13 +882,12 @@
     def __getitem__(self, name):
         return self.getByName(name)
 
-    def new(self, processor, url, name, title, description, owner,
-            active=True, virtualized=False, vm_host=None, manual=True):
+    def new(self, processor, url, name, title, owner, active=True,
+            virtualized=False, vm_host=None, manual=True):
         """See IBuilderSet."""
         return Builder(processor=processor, url=url, name=name, title=title,
-                       description=description, owner=owner, active=active,
-                       virtualized=virtualized, vm_host=vm_host,
-                       _builderok=True, manual=manual)
+                       owner=owner, active=active, virtualized=virtualized,
+                       vm_host=vm_host, _builderok=True, manual=manual)
 
     def get(self, builder_id):
         """See IBuilderSet."""

=== modified file 'lib/lp/soyuz/browser/builder.py'
--- lib/lp/soyuz/browser/builder.py	2012-03-27 04:00:45 +0000
+++ lib/lp/soyuz/browser/builder.py	2012-05-29 01:31:21 +0000
@@ -321,12 +321,11 @@
     label = "Register a new build machine"
 
     field_names = [
-        'name', 'title', 'description', 'processor', 'url',
-        'active', 'virtualized', 'vm_host', 'owner'
+        'name', 'title', 'processor', 'url', 'active', 'virtualized',
+        'vm_host', 'owner'
         ]
 
     custom_widget('owner', HiddenUserWidget)
-    custom_widget('description', TextAreaWidget, height=3)
     custom_widget('url', TextWidget, displayWidth=30)
     custom_widget('vm_host', TextWidget, displayWidth=30)
 
@@ -338,7 +337,6 @@
             url=data.get('url'),
             name=data.get('name'),
             title=data.get('title'),
-            description=data.get('description'),
             owner=data.get('owner'),
             active=data.get('active'),
             virtualized=data.get('virtualized'),
@@ -364,9 +362,8 @@
     schema = IBuilder
 
     field_names = [
-        'name', 'title', 'description', 'processor', 'url', 'manual',
-        'owner', 'virtualized', 'builderok', 'failnotes', 'vm_host',
-        'active',
+        'name', 'title', 'processor', 'url', 'manual', 'owner',
+        'virtualized', 'builderok', 'failnotes', 'vm_host', 'active',
         ]
 
     @action(_('Change'), name='update')

=== modified file 'lib/lp/soyuz/browser/tests/builder-views.txt'
--- lib/lp/soyuz/browser/tests/builder-views.txt	2011-12-30 06:14:56 +0000
+++ lib/lp/soyuz/browser/tests/builder-views.txt	2012-05-29 01:31:21 +0000
@@ -67,7 +67,6 @@
     ...     print field_name
     name
     title
-    description
     processor
     url
     manual
@@ -258,41 +257,25 @@
     >>> i386 = Processor.selectOneBy(name='386')
     >>> amd64 = Processor.selectOneBy(name='amd64')
     >>> hppa = Processor.selectOneBy(name='hppa')
-
-    >>> a_builder = builderset.new(
-    ...     i386, url='http://hamburger', name="hamburger",
-    ...     title="The Hamburger Builder", description="Uhmmm", owner=cprov,
-    ...     virtualized=True)
-
-    >>> a_builder = builderset.new(
-    ...     hppa, url='http://cheese', name="cheese",
-    ...     title="The Cheese Builder", description="Uhmmm", owner=cprov,
-    ...     virtualized=True)
-
-    >>> a_builder = builderset.new(
-    ...     amd64, url='http://bacon', name="bacon",
-    ...     title="The Bacon Builder", description="Uhmmm", owner=cprov,
-    ...     virtualized=True)
-
-    >>> a_builder = builderset.new(
-    ...     i386, url='http://egg', name="egg",
-    ...     title="The Egg Builder", description="Uhmmm", owner=cprov,
-    ...     virtualized=False)
-
-    >>> a_builder = builderset.new(
-    ...     hppa, url='http://ham', name="ham",
-    ...     title="The Ham Builder", description="Uhmmm", owner=cprov,
-    ...     virtualized=False)
-
-    >>> a_builder = builderset.new(
-    ...     amd64, url='http://prosciuto', name="prosciuto",
-    ...     title="The Prosciuto Builder", description="Uhmmm", owner=cprov,
-    ...     virtualized=False)
+    >>> def create_builder(name, arch, virtualized):
+    ...     url = 'http://%s' % name
+    ...     title = 'The %s Builder' % name.title
+    ...     ignored = builderset.new(
+    ...         arch, url=url, name=name, title=title, owner=cprov,
+    ...         virtualized=virtualized)
+
+    >>> create_builder('hamburger', i386, True)
+    >>> create_builder('cheese', hppa, True)
+    >>> create_builder('bacon', amd64, True)
+    >>> create_builder('egg', i386, False)
+    >>> create_builder('ham', hppa, False)
+    >>> create_builder('prosciuto', amd64, False)
 
 Newly created builders will be in manual mode because we don't want
 them going straight into the build farm until tested.
 
-    >>> a_builder.manual
+    >>> ham = builderset.getByName('ham')
+    >>> ham.manual
     True
 
 The 'Other' builder category is a `BuilderCategory` class, which


Follow ups