← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bug-653382-domination-series-restriction into lp:launchpad/devel

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-653382-domination-series-restriction into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #653382 BinaryPackagePublishingHistory._getOtherPublications fails to restrict the distroseries context
  https://bugs.launchpad.net/bugs/653382


I recently Stormified BinaryPackagePublishingHistory._getOtherPublications, but broke one of the predicates, resulting in publications in other series being inappropriately superseded. See bug #653382 for details.
-- 
https://code.launchpad.net/~wgrant/launchpad/bug-653382-domination-series-restriction/+merge/37333
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-653382-domination-series-restriction into lp:launchpad/devel.
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py	2010-09-27 14:35:58 +0000
+++ lib/lp/soyuz/model/publishing.py	2010-10-02 02:29:44 +0000
@@ -1015,7 +1015,7 @@
                 BinaryPackagePublishingHistory,
                 BinaryPackagePublishingHistory.status.is_in(
                     [PUBLISHED, PENDING]),
-                BinaryPackagePublishingHistory.distroarchseries in (
+                BinaryPackagePublishingHistory.distroarchseriesID.is_in(
                     available_architectures),
                 binarypackagerelease=self.binarypackagerelease,
                 archive=self.archive,

=== modified file 'lib/lp/soyuz/tests/test_publishing.py'
--- lib/lp/soyuz/tests/test_publishing.py	2010-08-30 19:06:34 +0000
+++ lib/lp/soyuz/tests/test_publishing.py	2010-10-02 02:29:44 +0000
@@ -1322,3 +1322,13 @@
         # This will supersede both atomically.
         bins[0].supersede()
         self.checkOtherPublications(bins[0], [])
+
+    def testDoesntFindPublicationsInOtherSeries(self):
+        """Publications in other series shouldn't be found."""
+        bins = self.getPubBinaries(architecturespecific=False)
+        series = self.factory.makeDistroSeries()
+        arch = self.factory.makeDistroArchSeries(distroseries=series)
+        foreign_bins = bins[0].copyTo(
+            series, bins[0].pocket, bins[0].archive)
+        self.checkOtherPublications(bins[0], bins)
+        self.checkOtherPublications(foreign_bins[0], foreign_bins)