Merge lp:~wgrant/launchpad/bug-692114-recipes-main-component into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 12112
Proposed branch: lp:~wgrant/launchpad/bug-692114-recipes-main-component
Merge into: lp:launchpad
Diff against target: 42 lines (+10/-4)
2 files modified
lib/lp/code/model/sourcepackagerecipebuild.py (+4/-4)
lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+6/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-692114-recipes-main-component
Reviewer Review Type Date Requested Status
Tim Penhey (community) code Approve
Steve Kowalik (community) code* Approve
Review via email: mp+44184@code.launchpad.net

Commit message

[r=stevenk,thumper][ui=none][bug=692114] Recipe builds now always build in main, since PPAs only have indices for main.

Description of the change

SourcePackageRecipeBuild.current_component is now always multiverse. Recipes only build into PPAs, and PPAs only support main, so multiverse is always wrong. New PPAs don't even have indices for the other components, so recipe builds fail!

This will need to become more dynamic when we start building recipes into other archive types, but for now setting it to main will work fine. Note that this does not affect the component used by the primary archive dependency.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) wrote :

After a discussion with William about this change, I'm happy with it.

review: Approve (code*)
Revision history for this message
Tim Penhey (thumper) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/code/model/sourcepackagerecipebuild.py'
--- lib/lp/code/model/sourcepackagerecipebuild.py 2010-11-30 12:23:01 +0000
+++ lib/lp/code/model/sourcepackagerecipebuild.py 2010-12-20 01:48:50 +0000
@@ -61,9 +61,6 @@
61from lp.code.model.sourcepackagerecipedata import SourcePackageRecipeData61from lp.code.model.sourcepackagerecipedata import SourcePackageRecipeData
62from lp.registry.interfaces.pocket import PackagePublishingPocket62from lp.registry.interfaces.pocket import PackagePublishingPocket
63from lp.services.job.model.job import Job63from lp.services.job.model.job import Job
64from lp.soyuz.adapters.archivedependencies import (
65 default_component_dependency_name,
66 )
67from lp.soyuz.interfaces.component import IComponentSet64from lp.soyuz.interfaces.component import IComponentSet
68from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild65from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
69from lp.soyuz.model.buildfarmbuildjob import BuildFarmBuildJob66from lp.soyuz.model.buildfarmbuildjob import BuildFarmBuildJob
@@ -96,7 +93,10 @@
9693
97 @property94 @property
98 def current_component(self):95 def current_component(self):
99 return getUtility(IComponentSet)[default_component_dependency_name]96 # Since recipes only build into PPAs, they should always build
97 # in main. This will need to change once other archives are
98 # supported.
99 return getUtility(IComponentSet)['main']
100100
101 distroseries_id = Int(name='distroseries', allow_none=True)101 distroseries_id = Int(name='distroseries', allow_none=True)
102 distroseries = Reference(distroseries_id, 'DistroSeries.id')102 distroseries = Reference(distroseries_id, 'DistroSeries.id')
103103
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-11-19 12:22:15 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2010-12-20 01:48:50 +0000
@@ -135,6 +135,12 @@
135 spb = self.makeSourcePackageRecipeBuild()135 spb = self.makeSourcePackageRecipeBuild()
136 self.assertEqual(spb.distroseries.distribution, spb.distribution)136 self.assertEqual(spb.distroseries.distribution, spb.distribution)
137137
138 def test_current_component(self):
139 # Since recipes build only into PPAs, they always build in main.
140 # PPAs lack indices for other components.
141 spb = self.makeSourcePackageRecipeBuild()
142 self.assertEqual('main', spb.current_component.name)
143
138 def test_is_private(self):144 def test_is_private(self):
139 # A source package recipe build is currently always public.145 # A source package recipe build is currently always public.
140 spb = self.makeSourcePackageRecipeBuild()146 spb = self.makeSourcePackageRecipeBuild()