launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15907
[Merge] lp:~stevenk/launchpad/use-new-processor into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/use-new-processor into lp:launchpad with lp:~stevenk/launchpad/db-add-processor as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1225856 in Launchpad itself: "ProcessorFamily mostly just duplicates Processor"
https://bugs.launchpad.net/launchpad/+bug/1225856
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/use-new-processor/+merge/186228
Continuing the work to destroy ProcessorFamily, add the new columns added in 49-0 to the model, and set them for new objects created.
--
https://code.launchpad.net/~stevenk/launchpad/use-new-processor/+merge/186228
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/use-new-processor into lp:launchpad.
=== modified file 'lib/lp/registry/browser/tests/test_distribution_views.py'
--- lib/lp/registry/browser/tests/test_distribution_views.py 2012-09-21 06:52:06 +0000
+++ lib/lp/registry/browser/tests/test_distribution_views.py 2013-09-18 02:36:05 +0000
@@ -189,6 +189,9 @@
self.distribution = self.factory.makeDistribution()
proc_family_set = getUtility(IProcessorFamilySet)
self.restricted_families = proc_family_set.getRestricted()
+ for family in self.restricted_families:
+ if family.processors.is_empty():
+ self.factory.makeProcessor(family=family)
def test_edit_distro_init_value_require_virtualized(self):
view = create_initialized_view(
@@ -249,8 +252,7 @@
method='POST', form=edit_form)
self.assertContentEqual(
- [],
- self.distribution.main_archive.enabled_restricted_families)
+ [], self.distribution.main_archive.enabled_restricted_families)
def test_package_derivatives_email(self):
# Test that the edit form allows changing package_derivatives_email
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2013-08-29 10:49:29 +0000
+++ lib/lp/registry/model/distroseries.py 2013-09-18 02:36:05 +0000
@@ -1114,7 +1114,8 @@
"""See `IDistroSeries`."""
distroarchseries = DistroArchSeries(
architecturetag=architecturetag, processorfamily=processorfamily,
- official=official, distroseries=self, owner=owner,
+ processor=processorfamily.processors[0], official=official,
+ distroseries=self, owner=owner,
supports_virtualized=supports_virtualized, enabled=enabled)
return distroarchseries
=== modified file 'lib/lp/soyuz/browser/tests/test_archive_webservice.py'
--- lib/lp/soyuz/browser/tests/test_archive_webservice.py 2013-09-13 07:07:25 +0000
+++ lib/lp/soyuz/browser/tests/test_archive_webservice.py 2013-09-18 02:36:05 +0000
@@ -284,6 +284,8 @@
archive = self.factory.makeArchive()
commercial = getUtility(ILaunchpadCelebrities).commercial_admin
commercial_admin = self.factory.makePerson(member_of=[commercial])
+ arm_family = getUtility(IProcessorFamilySet).getByName('arm')
+ self.factory.makeProcessor(family=arm_family)
transaction.commit()
ws_arm = self.service.processor_families.getByName(name='arm')
ws_archive = self.wsObject(archive, user=commercial_admin)
=== modified file 'lib/lp/soyuz/interfaces/archivearch.py'
--- lib/lp/soyuz/interfaces/archivearch.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/archivearch.py 2013-09-18 02:36:05 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""ArchiveArch interfaces."""
@@ -16,7 +16,10 @@
from lp import _
from lp.soyuz.interfaces.archive import IArchive
-from lp.soyuz.interfaces.processor import IProcessorFamily
+from lp.soyuz.interfaces.processor import (
+ IProcessor,
+ IProcessorFamily,
+ )
class IArchiveArch(Interface):
@@ -36,6 +39,12 @@
description=_(
"The processorfamily associated with the archive at hand."))
+ processor = Reference(
+ title=_("Processor"), schema=IProcessor,
+ required=False, readonly=True,
+ description=_(
+ "The processor associated with the archive at hand."))
+
class IArchiveArchSet(Interface):
"""An interface for sets of archive/processor family associations."""
@@ -70,4 +79,3 @@
The second value in the tuple will be None if the given `archive`
is not associated with the `ProcessorFamily` yet.
"""
-
=== modified file 'lib/lp/soyuz/interfaces/distroarchseries.py'
--- lib/lp/soyuz/interfaces/distroarchseries.py 2013-06-24 15:51:00 +0000
+++ lib/lp/soyuz/interfaces/distroarchseries.py 2013-09-18 02:36:05 +0000
@@ -59,6 +59,8 @@
processorfamily = Choice(
title=_("Processor Family"),
required=True, vocabulary='ProcessorFamily')
+ processor = Choice(
+ title=_("Processor"), required=False, vocabulary='Processor')
architecturetag = exported(
TextLine(
title=_("Architecture Tag"),
=== modified file 'lib/lp/soyuz/interfaces/processor.py'
--- lib/lp/soyuz/interfaces/processor.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/interfaces/processor.py 2013-09-18 02:36:05 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Processor interfaces."""
@@ -77,6 +77,9 @@
Text(title=_("Description"),
description=_("The Processor Description")),
as_of='devel', readonly=True)
+ restricted = exported(
+ Bool(title=_("Whether this processor is restricted.")),
+ as_of='devel', readonly=True)
class IProcessorFamily(Interface):
=== modified file 'lib/lp/soyuz/model/archivearch.py'
--- lib/lp/soyuz/model/archivearch.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/model/archivearch.py 2013-09-18 02:36:05 +0000
@@ -1,8 +1,11 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__metaclass__ = type
-__all__ = ['ArchiveArch', 'ArchiveArchSet']
+__all__ = [
+ 'ArchiveArch',
+ 'ArchiveArchSet'
+ ]
from storm.expr import (
And,
@@ -33,6 +36,8 @@
archive = Reference(archive_id, 'Archive.id')
processorfamily_id = Int(name='processorfamily', allow_none=True)
processorfamily = Reference(processorfamily_id, 'ProcessorFamily.id')
+ processor_id = Int(name='processor', allow_none=True)
+ processor = Reference(processor_id, 'Processor.id')
class ArchiveArchSet:
@@ -44,6 +49,7 @@
archivearch = ArchiveArch()
archivearch.archive = archive
archivearch.processorfamily = processorfamily
+ archivearch.processor = processorfamily.processors[0]
IStore(ArchiveArch).add(archivearch)
return archivearch
=== modified file 'lib/lp/soyuz/model/distroarchseries.py'
--- lib/lp/soyuz/model/distroarchseries.py 2013-07-22 15:14:38 +0000
+++ lib/lp/soyuz/model/distroarchseries.py 2013-09-18 02:36:05 +0000
@@ -18,8 +18,10 @@
StringCol,
)
from storm.locals import (
+ Int,
Join,
Or,
+ Reference,
)
from storm.store import EmptyResultSet
from zope.component import getUtility
@@ -68,6 +70,8 @@
foreignKey='DistroSeries', notNull=True)
processorfamily = ForeignKey(dbName='processorfamily',
foreignKey='ProcessorFamily', notNull=True)
+ processor_id = Int(name='processor', allow_none=True)
+ processor = Reference(processor_id, Processor.id)
architecturetag = StringCol(notNull=True)
official = BoolCol(notNull=True)
owner = ForeignKey(
@@ -368,12 +372,11 @@
implements(IPocketChroot)
_table = "PocketChroot"
- distroarchseries = ForeignKey(dbName='distroarchseries',
- foreignKey='DistroArchSeries',
- notNull=True)
+ distroarchseries = ForeignKey(
+ dbName='distroarchseries', foreignKey='DistroArchSeries', notNull=True)
- pocket = EnumCol(schema=PackagePublishingPocket,
- default=PackagePublishingPocket.RELEASE,
- notNull=True)
+ pocket = EnumCol(
+ schema=PackagePublishingPocket,
+ default=PackagePublishingPocket.RELEASE, notNull=True)
chroot = ForeignKey(dbName='chroot', foreignKey='LibraryFileAlias')
=== modified file 'lib/lp/soyuz/model/processor.py'
--- lib/lp/soyuz/model/processor.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/model/processor.py 2013-09-18 02:36:05 +0000
@@ -1,8 +1,12 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__metaclass__ = type
-__all__ = ['Processor', 'ProcessorFamily', 'ProcessorFamilySet']
+__all__ = [
+ 'Processor',
+ 'ProcessorFamily',
+ 'ProcessorFamilySet'
+ ]
from sqlobject import (
ForeignKey,
@@ -32,6 +36,7 @@
name = StringCol(dbName='name', notNull=True)
title = StringCol(dbName='title', notNull=True)
description = StringCol(dbName='description', notNull=True)
+ restricted = Bool(allow_none=True, default=False)
def __repr__(self):
return "<Processor %r>" % self.title
@@ -68,7 +73,7 @@
def addProcessor(self, name, title, description):
"""See `IProcessorFamily`."""
return Processor(family=self, name=name, title=title,
- description=description)
+ description=description, restricted=self.restricted)
def __repr__(self):
return "<ProcessorFamily %r>" % self.title
=== modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2013-09-18 02:36:05 +0000
@@ -51,6 +51,8 @@
def setupDas(self, parent, proc, arch_tag):
pf = getUtility(IProcessorFamilySet).getByName(proc)
+ if pf.processors.is_empty():
+ self.factory.makeProcessor(family=pf)
parent_das = self.factory.makeDistroArchSeries(
distroseries=parent, processorfamily=pf,
architecturetag=arch_tag)
=== modified file 'lib/lp/soyuz/tests/test_archive.py'
--- lib/lp/soyuz/tests/test_archive.py 2013-07-16 08:10:32 +0000
+++ lib/lp/soyuz/tests/test_archive.py 2013-09-18 02:36:05 +0000
@@ -1007,6 +1007,7 @@
self.archive = self.factory.makeArchive()
self.archive_arch_set = getUtility(IArchiveArchSet)
self.arm = getUtility(IProcessorFamilySet).getByName('arm')
+ self.factory.makeProcessor(family=self.arm)
def test_default(self):
"""By default, ARM builds are not allowed as ARM is restricted."""
=== modified file 'lib/lp/soyuz/tests/test_archivearch.py'
--- lib/lp/soyuz/tests/test_archivearch.py 2012-06-08 12:45:50 +0000
+++ lib/lp/soyuz/tests/test_archivearch.py 2013-09-18 02:36:05 +0000
@@ -29,9 +29,11 @@
self.cell_proc = pss.new(
'cell-proc', 'PS cell processor', 'Screamingly faaaaaaaaaaaast',
True)
+ self.cell_proc.addProcessor('Cell', '', '')
self.omap = pss.new(
'omap', 'Multimedia applications processor',
'Does all your sound & video', True)
+ self.omap.addProcessor('Omap', '', '')
def test_getRestrictedFamilies_no_restricted_associations(self):
# Our archive is not associated with any restricted processor
=== modified file 'lib/lp/soyuz/tests/test_build_start_estimation.py'
--- lib/lp/soyuz/tests/test_build_start_estimation.py 2012-01-01 02:58:52 +0000
+++ lib/lp/soyuz/tests/test_build_start_estimation.py 2013-09-18 02:36:05 +0000
@@ -42,7 +42,7 @@
self.bob = getUtility(IBuilderSet).getByName(BOB_THE_BUILDER_NAME)
das = self.factory.makeDistroArchSeries(
distroseries=self.distroseries,
- processorfamily=self.bob.processor.id,
+ processorfamily=self.bob.processor.family,
architecturetag='i386', supports_virtualized=True)
with person_logged_in(self.admin):
self.distroseries.nominatedarchindep = das
=== modified file 'lib/lp/soyuz/tests/test_initializedistroseriesjob.py'
--- lib/lp/soyuz/tests/test_initializedistroseriesjob.py 2013-07-04 07:34:53 +0000
+++ lib/lp/soyuz/tests/test_initializedistroseriesjob.py 2013-09-18 02:36:05 +0000
@@ -274,6 +274,8 @@
def setupDas(self, parent, proc, arch_tag):
pf = getUtility(IProcessorFamilySet).getByName(proc)
+ if pf.processors.is_empty():
+ self.factory.makeProcessor(family=pf)
parent_das = self.factory.makeDistroArchSeries(
distroseries=parent, processorfamily=pf,
architecturetag=arch_tag)
Follow ups