← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/initialize-distroseries-proposed into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/initialize-distroseries-proposed into lp:launchpad.

Commit message:
Copy PROPOSED pocket when initialising a new distroseries.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1824966 in Launchpad itself: "Series initialisation should (optionally?) also copy post-release pockets"
  https://bugs.launchpad.net/launchpad/+bug/1824966

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/initialize-distroseries-proposed/+merge/366099

Adam Conrad thinks this will be less error-prone, and is happy to deal with the consequences.  (Requiring the source upload queue to be empty would be a showstopper, but we don't require that, only that the build upload queue is empty.)
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/initialize-distroseries-proposed into lp:launchpad.
=== modified file 'lib/lp/soyuz/scripts/initialize_distroseries.py'
--- lib/lp/soyuz/scripts/initialize_distroseries.py	2016-04-27 16:08:05 +0000
+++ lib/lp/soyuz/scripts/initialize_distroseries.py	2019-04-16 10:52:21 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2016 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2019 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Initialize a distroseries from its parent distroseries."""
@@ -52,11 +52,13 @@
 class InitializationError(Exception):
     """Raised when there is an exception during the initialization process."""
 
+
 # Pockets to consider when initializing the derived series from its parent(s).
 INIT_POCKETS = [
     PackagePublishingPocket.RELEASE,
     PackagePublishingPocket.SECURITY,
     PackagePublishingPocket.UPDATES,
+    PackagePublishingPocket.PROPOSED,
     ]
 
 
@@ -214,8 +216,9 @@
     def _checkBuilds(self, parent):
         """Assert there are no pending builds for the given parent series.
 
-        Only cares about the RELEASE, SECURITY and UPDATES pockets, which are
-        the only ones inherited via initializeFromParent method.
+        Only cares about the RELEASE, SECURITY, UPDATES and PROPOSED
+        pockets, which are the only ones inherited via the
+        initializeFromParent method.
         Restrict the check to the select architectures (if applicable).
         Restrict the check to the selected packages if a limited set of
         packagesets is used by the initialization.
@@ -240,8 +243,9 @@
     def _checkQueue(self, parent):
         """Assert upload queue is empty on the given parent series.
 
-        Only cares about the RELEASE, SECURITY and UPDATES pockets, which are
-        the only ones inherited via initializeFromParent method.
+        Only cares about the RELEASE, SECURITY, UPDATES and PROPOSED
+        pockets, which are the only ones inherited via the
+        initializeFromParent method.
         Restrict the check to the selected packages if a limited set of
         packagesets is used by the initialization.
          """

=== modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py	2018-01-02 16:10:26 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py	2019-04-16 10:52:21 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010-2016 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2019 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Test the initialize_distroseries script machinery."""
@@ -248,6 +248,7 @@
             PackagePublishingPocket.RELEASE,
             PackagePublishingPocket.SECURITY,
             PackagePublishingPocket.UPDATES,
+            PackagePublishingPocket.PROPOSED,
             ]
         for pocket in pockets:
             self.parent, self.parent_das = self.setupParent()
@@ -263,11 +264,10 @@
                  "selected sources."),
                 ids.check)
 
-    def test_success_with_builds_in_backports_or_proposed(self):
-        # With pending builds in the BACKPORT or PROPOSED pockets, we
-        # still can initialize.
+    def test_success_with_builds_in_backports(self):
+        # With pending builds in the BACKPORTS pocket, we still can
+        # initialize.
         pockets = [
-            PackagePublishingPocket.PROPOSED,
             PackagePublishingPocket.BACKPORTS,
             ]
         for pocket in pockets:
@@ -420,11 +420,10 @@
         self.assertEqual(1, pending_child_sources.count())
 
     def test_check_success_with_binary_queue_items_pockets(self):
-        # If the parent series has binary items in pockets PROPOSED or
-        # BACKPORTS, in its queues, we still can initialize because these
-        # pockets are not considered by the initialization process.
+        # If the parent series has binary items in the BACKPORTS pocket in
+        # its queues, we can still initialize because this pocket is not
+        # considered by the initialization process.
         pockets = [
-            PackagePublishingPocket.PROPOSED,
             PackagePublishingPocket.BACKPORTS,
             ]
         for pocket in pockets:
@@ -441,11 +440,12 @@
 
     def test_failure_with_binary_queue_items_pockets(self):
         # If the parent series has binary items in pockets RELEASE,
-        # SECURITY or UPDATES in its queues, we can't initialize.
+        # SECURITY, UPDATES or PROPOSED in its queues, we can't initialize.
         pockets = [
             PackagePublishingPocket.RELEASE,
             PackagePublishingPocket.SECURITY,
             PackagePublishingPocket.UPDATES,
+            PackagePublishingPocket.PROPOSED,
             ]
         for pocket in pockets:
             parent, parent_das = self.setupParent()


Follow ups