← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/ids-index-compressors into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/ids-index-compressors into lp:launchpad.

Commit message:
Copy index_compressors from previous series during initialisation.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1573500 in Launchpad itself: "index_compressors is not copied from previous distroseries"
  https://bugs.launchpad.net/launchpad/+bug/1573500

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/ids-index-compressors/+merge/293144

Copy index_compressors from previous series during initialisation.

Unlike the other publishing options, I didn't bother trying to union the values of all derivation parents (which seems a bit questionable to me, but anyway), since it's likely to be inappropriate for this list-typed value.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/ids-index-compressors into lp:launchpad.
=== modified file 'lib/lp/soyuz/scripts/initialize_distroseries.py'
--- lib/lp/soyuz/scripts/initialize_distroseries.py	2016-03-31 00:31:07 +0000
+++ lib/lp/soyuz/scripts/initialize_distroseries.py	2016-04-27 16:20:23 +0000
@@ -375,6 +375,8 @@
         self.distroseries.include_long_descriptions = any(
             parent.include_long_descriptions
                 for parent in self.derivation_parents)
+        self.distroseries.index_compressors = list(
+            self.derivation_parents[0].index_compressors)
         self.distroseries.publish_by_hash = any(
             parent.publish_by_hash
                 for parent in self.derivation_parents)

=== modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py	2016-03-31 00:31:07 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py	2016-04-27 16:20:23 +0000
@@ -22,6 +22,7 @@
 from lp.services.database.interfaces import IStore
 from lp.soyuz.enums import (
     ArchivePurpose,
+    IndexCompressionType,
     PackageUploadStatus,
     SourcePackageFormat,
     )
@@ -83,6 +84,7 @@
             spfss_utility.add(parent, format_selection)
         parent.backports_not_automatic = True
         parent.include_long_descriptions = False
+        parent.index_compressors = [IndexCompressionType.XZ]
         parent.publish_by_hash = True
         parent.advertise_by_hash = True
         parent.strict_supported_component_dependencies = False
@@ -613,6 +615,7 @@
         # Other configuration bits are copied too.
         self.assertTrue(child.backports_not_automatic)
         self.assertFalse(child.include_long_descriptions)
+        self.assertEqual([IndexCompressionType.XZ], child.index_compressors)
         self.assertTrue(child.publish_by_hash)
         self.assertTrue(child.advertise_by_hash)
         self.assertFalse(child.strict_supported_component_dependencies)


Follow ups