Merge lp:~cjwatson/launchpad/precise-lts-flavours into lp:launchpad

Proposed by Colin Watson
Status: Work in progress
Proposed branch: lp:~cjwatson/launchpad/precise-lts-flavours
Merge into: lp:launchpad
Diff against target: 196 lines (+57/-38)
3 files modified
cronscripts/publishing/maintenance-check.py (+43/-31)
lib/lp/soyuz/scripts/tests/germinate-test-data/mock-lp-root/scripts/ftpmaster-tools/lp-query-distro.py (+2/-2)
lib/lp/soyuz/scripts/tests/test_cron_germinate.py (+12/-5)
To merge this branch: bzr merge lp:~cjwatson/launchpad/precise-lts-flavours
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+88009@code.launchpad.net

Commit message

Support Kubuntu and Edubuntu 12.04 for five years, and Xubuntu for three years.

Description of the change

== Summary ==

In today's Ubuntu Technical Board meeting (http://irclogs.ubuntu.com/2012/01/09/%23ubuntu-meeting.html#t20:58), we resolved that the Kubuntu and Edubuntu flavours of 12.04 will be supported for five years, and Xubuntu for three years. This requires some changes to Launchpad to emit the correct Supported fields.

== Proposed fix ==

Emit the correct Supported fields.

== Implementation details ==

The difference in LTS lifetimes got too complicated to handle using the simple SUPPORTED_TIMEFRAME constants, so I turned those into methods that can look at the flavour name.

== Tests ==

bin/test -vvct test_cron_germinate

This isn't properly unit-tested right now, and that's hard until I get round to rewriting maintenance-check.py to use python-germinate directly. Still, even just these basic integration tests did manage to catch a bug in the initial version of this branch, so better than nothing.

== Demo and Q/A ==

Run cronscripts/publishing/cron.germinate on mawson and check that packages unique to the Kubuntu, Edubuntu, and Xubuntu get the correct Supported overrides.

== lint ==

None.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Marking WIP for now as there's some disagreement in the bug.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cronscripts/publishing/maintenance-check.py'
2--- cronscripts/publishing/maintenance-check.py 2012-01-03 10:35:26 +0000
3+++ cronscripts/publishing/maintenance-check.py 2012-01-10 01:23:26 +0000
4@@ -38,64 +38,74 @@
5 ]
6 SUPPORTED_SEEDS = ["all"]
7
8- # normal support timeframe
9- # time, seeds
10- SUPPORT_TIMEFRAME = [
11- ("18m", SUPPORTED_SEEDS),
12- ]
13-
14 # distro names that we check the seeds for
15 DISTRO_NAMES = [
16 "ubuntu",
17 ]
18
19+ def support_timeframe(self, name):
20+ """Normal support timeframe.
21+
22+ Return a list of (time, seeds) tuples describing the length of time
23+ those seeds are supported for. Order is important; the shortest
24+ time period must come last.
25+
26+ """
27+ return [("18m", self.SUPPORTED_SEEDS)]
28+
29
30 # This is fun! We have a bunch of cases for 10.04 LTS
31 #
32-# - distro "ubuntu" follows SUPPORT_TIMEFRAME_LTS but only for
33-# amd64/i386
34+# - distro "ubuntu" follows LTS support timeframe but only for amd64/i386
35 # - distros "kubuntu", "edubuntu" and "netbook" need to be
36-# considered *but* only follow SUPPORT_TIMEFRAME
37-# - anything that is in armel follows SUPPORT_TIMEFRAME
38+# considered *but* only follow standard support timeframe
39+# - anything that is in armel follows standard support timeframe
40 #
41 class LucidUbuntuMaintenance(UbuntuMaintenance):
42 """ Represents the support timeframe for a 10.04 (lucid) LTS release,
43 the exact rules differ from LTS release to LTS release
44 """
45
46- # lts support timeframe, order is important, least supported must be last
47- # time, seeds
48- SUPPORT_TIMEFRAME = [
49- ("5y", UbuntuMaintenance.SERVER_SEEDS),
50- ("3y", UbuntuMaintenance.DESKTOP_SEEDS),
51- ("18m", UbuntuMaintenance.SUPPORTED_SEEDS),
52- ]
53-
54 # on a LTS this is significant, it defines what names get LTS support
55 DISTRO_NAMES = [
56 "ubuntu",
57 "kubuntu",
58 ]
59
60+ def support_timeframe(self, name):
61+ """See `UbuntuMaintenance`."""
62+ return [
63+ ("5y", self.SERVER_SEEDS),
64+ ("3y", self.DESKTOP_SEEDS),
65+ ("18m", self.SUPPORTED_SEEDS),
66+ ]
67+
68
69 class PreciseUbuntuMaintenance(UbuntuMaintenance):
70 """ The support timeframe for the 12.04 (precise) LTS release.
71- This changes the timeframe for desktop packages from 3y to 5y
72+ This changes the timeframe for desktop packages from 3y to 5y for
73+ Ubuntu, Kubuntu, and Edubuntu. Xubuntu desktop packages get 3y.
74 """
75
76- # lts support timeframe, order is important, least supported must be last
77- # time, seeds
78- SUPPORT_TIMEFRAME = [
79- ("5y", UbuntuMaintenance.SERVER_SEEDS),
80- ("5y", UbuntuMaintenance.DESKTOP_SEEDS),
81- ("18m", UbuntuMaintenance.SUPPORTED_SEEDS),
82- ]
83-
84 # on a LTS this is significant, it defines what names get LTS support
85 DISTRO_NAMES = [
86 "ubuntu",
87+ "kubuntu",
88+ "edubuntu",
89+ "xubuntu",
90 ]
91
92+ def support_timeframe(self, name):
93+ """See `UbuntuMaintenance`."""
94+ timeframe = []
95+ timeframe.append(("5y", self.SERVER_SEEDS))
96+ if name == "xubuntu":
97+ timeframe.append(("3y", self.DESKTOP_SEEDS))
98+ else:
99+ timeframe.append(("5y", self.DESKTOP_SEEDS))
100+ timeframe.append(("18m", self.SUPPORTED_SEEDS))
101+ return timeframe
102+
103
104 # Names of the distribution releases that are not supported by this
105 # tool. All later versions are supported.
106@@ -301,7 +311,7 @@
107 def get_packages_support_time(structure, name, pkg_support_time,
108 support_timeframe_list):
109 """
110- input a structure file and a list of pair<timeframe, seedlist>
111+ input a structure file and a list of tuple<timeframe, seedlist>
112 return a dict of pkgnames -> support timeframe string
113 """
114 for (timeframe, seedlist) in support_timeframe_list:
115@@ -379,7 +389,7 @@
116 continue
117
118 # get dicts of pkgname -> support timeframe string
119- support_timeframe = ubuntu_maintenance.SUPPORT_TIMEFRAME
120+ support_timeframe = ubuntu_maintenance.support_timeframe(name)
121 get_packages_support_time(
122 structure, name, pkg_support_time, support_timeframe)
123
124@@ -435,6 +445,9 @@
125 raise
126 sys.stderr.write("hints-file: %s gave 404 error\n" % hints_file)
127
128+ standard_support_time = ubuntu_maintenance.support_timeframe(
129+ "ubuntu")[-1][0]
130+
131 # output suitable for the extra-override file
132 for pkgname in sorted(pkg_support_time.keys()):
133 # special case, the hints file may contain overrides that
134@@ -460,5 +473,4 @@
135 # not a LTS supported architecture, gets only regular
136 # support_timeframe
137 print "%s %s %s" % (
138- pkgname_and_arch, SUPPORT_TAG,
139- ubuntu_maintenance.SUPPORT_TIMEFRAME[-1][0])
140+ pkgname_and_arch, SUPPORT_TAG, standard_support_time)
141
142=== modified file 'lib/lp/soyuz/scripts/tests/germinate-test-data/mock-lp-root/scripts/ftpmaster-tools/lp-query-distro.py'
143--- lib/lp/soyuz/scripts/tests/germinate-test-data/mock-lp-root/scripts/ftpmaster-tools/lp-query-distro.py 2011-10-15 02:57:02 +0000
144+++ lib/lp/soyuz/scripts/tests/germinate-test-data/mock-lp-root/scripts/ftpmaster-tools/lp-query-distro.py 2012-01-10 01:23:26 +0000
145@@ -19,9 +19,9 @@
146 if len(args) == 2:
147 distro = args[1]
148 if distro == "development":
149- return "natty"
150+ return "q-series"
151 elif distro == "supported":
152- return "hardy jaunty karmic lucid maverick"
153+ return "hardy jaunty karmic lucid maverick precise"
154 elif len(args) == 4 and args[1] == '-s' and args[3] == 'archs':
155 return "i386 amd64 powerpc armel"
156 error_and_exit()
157
158=== modified file 'lib/lp/soyuz/scripts/tests/test_cron_germinate.py'
159--- lib/lp/soyuz/scripts/tests/test_cron_germinate.py 2011-12-14 15:21:50 +0000
160+++ lib/lp/soyuz/scripts/tests/test_cron_germinate.py 2012-01-10 01:23:26 +0000
161@@ -1,5 +1,5 @@
162 #!/usr/bin/python
163-# Copyright 2010 Canonical Ltd. This software is licensed under the
164+# Copyright 2010-2012 Canonical Ltd. This software is licensed under the
165 # GNU Affero General Public License version 3 (see the file LICENSE).
166
167 """This is a test for the soyuz cron.germinate script."""
168@@ -16,9 +16,16 @@
169
170 class TestCronGerminate(TestCase):
171
172- DISTRO_NAMES = ["platform", "ubuntu", "kubuntu", "netbook"]
173- DISTS = ["hardy", "lucid", "maverick"]
174- DEVELOPMENT_DIST = "natty"
175+ DISTRO_NAMES = [
176+ "platform",
177+ "ubuntu",
178+ "kubuntu",
179+ "netbook",
180+ "edubuntu",
181+ "xubuntu",
182+ ]
183+ DISTS = ["hardy", "lucid", "maverick", "precise"]
184+ DEVELOPMENT_DIST = "q-series"
185 COMPONENTS = ["main", "restricted", "universe", "multiverse"]
186 ARCHES = ["i386", "amd64", "armel", "powerpc"]
187 BASEPATH = os.path.abspath(os.path.dirname(__file__))
188@@ -172,7 +179,7 @@
189 fake_environ["MAINTENANCE_CHECK_HINTS_DIR_URL"] = "file://%s" % \
190 os.path.abspath(hints_file_url)
191 # add hints override to test that feature
192- f=open(hints_file_url % "lucid", "a")
193+ f = open(hints_file_url % "lucid", "a")
194 f.write("linux-image-2.6.32-25-server 5y\n")
195 f.close()
196 return fake_environ