Merge lp:~rvb/launchpad/bug-815751 into lp:launchpad

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 13520
Proposed branch: lp:~rvb/launchpad/bug-815751
Merge into: lp:launchpad
Prerequisite: lp:~rvb/launchpad/use-copier-first-init-bug-814643
Diff against target: 101 lines (+32/-10)
2 files modified
lib/lp/soyuz/scripts/initialize_distroseries.py (+8/-3)
lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+24/-7)
To merge this branch: bzr merge lp:~rvb/launchpad/bug-815751
Reviewer Review Type Date Requested Status
Benji York (community) code Approve
Review via email: mp+69120@code.launchpad.net

Commit message

[r=benji][bug=815751] First-initialization copies package from RELEASE, UPDATES and SECURITY.

Description of the change

This branches fixes the call to the package copier in initialize_series so that the packages from the pockets UPDATES and SECURITY will also be copied into the child series.

= Tests =

./bin/test -vvc test_initialize_distroseries test_success_with_security_packages
./bin/test -vvc test_initialize_distroseries test_success_with_updates_packages

= QA =

First-initialize (https://dev.launchpad.net/LEP/DerivativeDistributions#Vocabulary) a series with packages in the UPDATES and SECURITY pockets and make sure that these packages end up in the child series.

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

This branch looks good to me.

review: Approve (code)
Revision history for this message
Raphaël Badin (rvb) wrote :

Thanks for review!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/soyuz/scripts/initialize_distroseries.py'
--- lib/lp/soyuz/scripts/initialize_distroseries.py 2011-07-25 16:01:36 +0000
+++ lib/lp/soyuz/scripts/initialize_distroseries.py 2011-07-25 16:01:38 +0000
@@ -432,9 +432,14 @@
432 else:432 else:
433 # There is only one available pocket in an unreleased433 # There is only one available pocket in an unreleased
434 # series.434 # series.
435 pocket = PackagePublishingPocket.RELEASE435 target_pocket = PackagePublishingPocket.RELEASE
436 pockets_to_copy = (
437 PackagePublishingPocket.RELEASE,
438 PackagePublishingPocket.UPDATES,
439 PackagePublishingPocket.SECURITY)
436 sources = archive.getPublishedSources(440 sources = archive.getPublishedSources(
437 distroseries=parent, pocket=pocket, name=spns)441 distroseries=parent, pocket=pockets_to_copy,
442 name=spns)
438 # XXX: rvb 2011-06-23 bug=801112: do_copy is atomic (all443 # XXX: rvb 2011-06-23 bug=801112: do_copy is atomic (all
439 # or none of the sources will be copied). This might444 # or none of the sources will be copied). This might
440 # lead to a partially initialised series if there is a445 # lead to a partially initialised series if there is a
@@ -442,7 +447,7 @@
442 try:447 try:
443 sources_published = do_copy(448 sources_published = do_copy(
444 sources, target_archive, self.distroseries,449 sources, target_archive, self.distroseries,
445 pocket, include_binaries=not self.rebuild,450 target_pocket, include_binaries=not self.rebuild,
446 check_permissions=False, strict_binaries=False,451 check_permissions=False, strict_binaries=False,
447 close_bugs=False, create_dsd_job=False)452 close_bugs=False, create_dsd_job=False)
448 if self.rebuild:453 if self.rebuild:
449454
=== modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2011-07-25 16:01:36 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2011-07-25 16:01:38 +0000
@@ -59,7 +59,9 @@
59 # - initialize a child from parents.59 # - initialize a child from parents.
6060
61 def setupParent(self, packages=None, format_selection=None,61 def setupParent(self, packages=None, format_selection=None,
62 distribution=None):62 distribution=None,
63 pocket=PackagePublishingPocket.RELEASE,
64 ):
63 parent = self.factory.makeDistroSeries(distribution)65 parent = self.factory.makeDistroSeries(distribution)
64 pf = getUtility(IProcessorFamilySet).getByName('x86')66 pf = getUtility(IProcessorFamilySet).getByName('x86')
65 parent_das = self.factory.makeDistroArchSeries(67 parent_das = self.factory.makeDistroArchSeries(
@@ -75,10 +77,11 @@
75 getUtility(ISourcePackageFormatSelectionSet).add(77 getUtility(ISourcePackageFormatSelectionSet).add(
76 parent, format_selection)78 parent, format_selection)
77 parent.backports_not_automatic = True79 parent.backports_not_automatic = True
78 self._populate_parent(parent, parent_das, packages)80 self._populate_parent(parent, parent_das, packages, pocket)
79 return parent, parent_das81 return parent, parent_das
8082
81 def _populate_parent(self, parent, parent_das, packages=None):83 def _populate_parent(self, parent, parent_das, packages=None,
84 pocket=PackagePublishingPocket.RELEASE):
82 if packages is None:85 if packages is None:
83 packages = {'udev': '0.1-1', 'libc6': '2.8-1',86 packages = {'udev': '0.1-1', 'libc6': '2.8-1',
84 'postgresql': '9.0-1', 'chromium': '3.6'}87 'postgresql': '9.0-1', 'chromium': '3.6'}
@@ -87,8 +90,7 @@
87 spph = self.factory.makeSourcePackagePublishingHistory(90 spph = self.factory.makeSourcePackagePublishingHistory(
88 sourcepackagename=spn, version=packages[package],91 sourcepackagename=spn, version=packages[package],
89 distroseries=parent,92 distroseries=parent,
90 pocket=PackagePublishingPocket.RELEASE,93 pocket=pocket, status=PackagePublishingStatus.PUBLISHED)
91 status=PackagePublishingStatus.PUBLISHED)
92 status = BuildStatus.FULLYBUILT94 status = BuildStatus.FULLYBUILT
93 if package is 'chromium':95 if package is 'chromium':
94 status = BuildStatus.FAILEDTOBUILD96 status = BuildStatus.FAILEDTOBUILD
@@ -104,8 +106,7 @@
104 self.factory.makeBinaryPackagePublishingHistory(106 self.factory.makeBinaryPackagePublishingHistory(
105 binarypackagerelease=bpr,107 binarypackagerelease=bpr,
106 distroarchseries=parent_das,108 distroarchseries=parent_das,
107 pocket=PackagePublishingPocket.RELEASE,109 pocket=pocket, status=PackagePublishingStatus.PUBLISHED)
108 status=PackagePublishingStatus.PUBLISHED)
109 self.factory.makeBinaryPackageFile(binarypackagerelease=bpr)110 self.factory.makeBinaryPackageFile(binarypackagerelease=bpr)
110111
111 def _fullInitialize(self, parents, child=None, previous_series=None,112 def _fullInitialize(self, parents, child=None, previous_series=None,
@@ -174,6 +175,22 @@
174 InitializationError, "Parent series has pending builds.",175 InitializationError, "Parent series has pending builds.",
175 ids.check)176 ids.check)
176177
178 def test_success_with_updates_packages(self):
179 # Initialization copies all the package from the UPDATES pocket.
180 self.parent, self.parent_das = self.setupParent(
181 pocket=PackagePublishingPocket.UPDATES)
182 child = self._fullInitialize([self.parent])
183 self.assertDistroSeriesInitializedCorrectly(
184 child, self.parent, self.parent_das)
185
186 def test_success_with_security_packages(self):
187 # Initialization copies all the package from the SECURITY pocket.
188 self.parent, self.parent_das = self.setupParent(
189 pocket=PackagePublishingPocket.SECURITY)
190 child = self._fullInitialize([self.parent])
191 self.assertDistroSeriesInitializedCorrectly(
192 child, self.parent, self.parent_das)
193
177 def test_success_with_pending_builds(self):194 def test_success_with_pending_builds(self):
178 # If the parent series has pending builds, and the child's195 # If the parent series has pending builds, and the child's
179 # distribution is different, we can initialize.196 # distribution is different, we can initialize.