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

Proposed by Colin Watson
Status: Merged
Merged at revision: 18928
Proposed branch: lp:~cjwatson/launchpad/initialize-distroseries-proposed
Merge into: lp:launchpad
Diff against target: 109 lines (+19/-15)
2 files modified
lib/lp/soyuz/scripts/initialize_distroseries.py (+9/-5)
lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+10/-10)
To merge this branch: bzr merge lp:~cjwatson/launchpad/initialize-distroseries-proposed
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+366099@code.launchpad.net

Commit message

Copy PROPOSED pocket when initialising a new distroseries.

Description of the change

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.)

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/scripts/initialize_distroseries.py'
2--- lib/lp/soyuz/scripts/initialize_distroseries.py 2016-04-27 16:08:05 +0000
3+++ lib/lp/soyuz/scripts/initialize_distroseries.py 2019-04-16 10:52:21 +0000
4@@ -1,4 +1,4 @@
5-# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
6+# Copyright 2009-2019 Canonical Ltd. This software is licensed under the
7 # GNU Affero General Public License version 3 (see the file LICENSE).
8
9 """Initialize a distroseries from its parent distroseries."""
10@@ -52,11 +52,13 @@
11 class InitializationError(Exception):
12 """Raised when there is an exception during the initialization process."""
13
14+
15 # Pockets to consider when initializing the derived series from its parent(s).
16 INIT_POCKETS = [
17 PackagePublishingPocket.RELEASE,
18 PackagePublishingPocket.SECURITY,
19 PackagePublishingPocket.UPDATES,
20+ PackagePublishingPocket.PROPOSED,
21 ]
22
23
24@@ -214,8 +216,9 @@
25 def _checkBuilds(self, parent):
26 """Assert there are no pending builds for the given parent series.
27
28- Only cares about the RELEASE, SECURITY and UPDATES pockets, which are
29- the only ones inherited via initializeFromParent method.
30+ Only cares about the RELEASE, SECURITY, UPDATES and PROPOSED
31+ pockets, which are the only ones inherited via the
32+ initializeFromParent method.
33 Restrict the check to the select architectures (if applicable).
34 Restrict the check to the selected packages if a limited set of
35 packagesets is used by the initialization.
36@@ -240,8 +243,9 @@
37 def _checkQueue(self, parent):
38 """Assert upload queue is empty on the given parent series.
39
40- Only cares about the RELEASE, SECURITY and UPDATES pockets, which are
41- the only ones inherited via initializeFromParent method.
42+ Only cares about the RELEASE, SECURITY, UPDATES and PROPOSED
43+ pockets, which are the only ones inherited via the
44+ initializeFromParent method.
45 Restrict the check to the selected packages if a limited set of
46 packagesets is used by the initialization.
47 """
48
49=== modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py'
50--- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2018-01-02 16:10:26 +0000
51+++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2019-04-16 10:52:21 +0000
52@@ -1,4 +1,4 @@
53-# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
54+# Copyright 2010-2019 Canonical Ltd. This software is licensed under the
55 # GNU Affero General Public License version 3 (see the file LICENSE).
56
57 """Test the initialize_distroseries script machinery."""
58@@ -248,6 +248,7 @@
59 PackagePublishingPocket.RELEASE,
60 PackagePublishingPocket.SECURITY,
61 PackagePublishingPocket.UPDATES,
62+ PackagePublishingPocket.PROPOSED,
63 ]
64 for pocket in pockets:
65 self.parent, self.parent_das = self.setupParent()
66@@ -263,11 +264,10 @@
67 "selected sources."),
68 ids.check)
69
70- def test_success_with_builds_in_backports_or_proposed(self):
71- # With pending builds in the BACKPORT or PROPOSED pockets, we
72- # still can initialize.
73+ def test_success_with_builds_in_backports(self):
74+ # With pending builds in the BACKPORTS pocket, we still can
75+ # initialize.
76 pockets = [
77- PackagePublishingPocket.PROPOSED,
78 PackagePublishingPocket.BACKPORTS,
79 ]
80 for pocket in pockets:
81@@ -420,11 +420,10 @@
82 self.assertEqual(1, pending_child_sources.count())
83
84 def test_check_success_with_binary_queue_items_pockets(self):
85- # If the parent series has binary items in pockets PROPOSED or
86- # BACKPORTS, in its queues, we still can initialize because these
87- # pockets are not considered by the initialization process.
88+ # If the parent series has binary items in the BACKPORTS pocket in
89+ # its queues, we can still initialize because this pocket is not
90+ # considered by the initialization process.
91 pockets = [
92- PackagePublishingPocket.PROPOSED,
93 PackagePublishingPocket.BACKPORTS,
94 ]
95 for pocket in pockets:
96@@ -441,11 +440,12 @@
97
98 def test_failure_with_binary_queue_items_pockets(self):
99 # If the parent series has binary items in pockets RELEASE,
100- # SECURITY or UPDATES in its queues, we can't initialize.
101+ # SECURITY, UPDATES or PROPOSED in its queues, we can't initialize.
102 pockets = [
103 PackagePublishingPocket.RELEASE,
104 PackagePublishingPocket.SECURITY,
105 PackagePublishingPocket.UPDATES,
106+ PackagePublishingPocket.PROPOSED,
107 ]
108 for pocket in pockets:
109 parent, parent_das = self.setupParent()