← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/precise-lts-flavours into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #914055 in Launchpad itself: "Add Kubuntu, Edubuntu, and Xubuntu LTS Supported fields for Precise"
  https://bugs.launchpad.net/launchpad/+bug/914055

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/precise-lts-flavours/+merge/88009

== 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.
-- 
https://code.launchpad.net/~cjwatson/launchpad/precise-lts-flavours/+merge/88009
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/precise-lts-flavours into lp:launchpad.
=== modified file 'cronscripts/publishing/maintenance-check.py'
--- cronscripts/publishing/maintenance-check.py	2012-01-03 10:35:26 +0000
+++ cronscripts/publishing/maintenance-check.py	2012-01-10 01:23:26 +0000
@@ -38,64 +38,74 @@
         ]
     SUPPORTED_SEEDS = ["all"]
 
-    # normal support timeframe
-    # time, seeds
-    SUPPORT_TIMEFRAME = [
-        ("18m", SUPPORTED_SEEDS),
-        ]
-
     # distro names that we check the seeds for
     DISTRO_NAMES = [
         "ubuntu",
         ]
 
+    def support_timeframe(self, name):
+        """Normal support timeframe.
+
+        Return a list of (time, seeds) tuples describing the length of time
+        those seeds are supported for.  Order is important; the shortest
+        time period must come last.
+
+        """
+        return [("18m", self.SUPPORTED_SEEDS)]
+
 
 # This is fun! We have a bunch of cases for 10.04 LTS
 #
-#  - distro "ubuntu" follows SUPPORT_TIMEFRAME_LTS but only for
-#    amd64/i386
+#  - distro "ubuntu" follows LTS support timeframe but only for amd64/i386
 #  - distros "kubuntu", "edubuntu" and "netbook" need to be
-#    considered *but* only follow SUPPORT_TIMEFRAME
-#  - anything that is in armel follows SUPPORT_TIMEFRAME
+#    considered *but* only follow standard support timeframe
+#  - anything that is in armel follows standard support timeframe
 #
 class LucidUbuntuMaintenance(UbuntuMaintenance):
     """ Represents the support timeframe for a 10.04 (lucid) LTS release,
         the exact rules differ from LTS release to LTS release
     """
 
-    # lts support timeframe, order is important, least supported must be last
-    # time, seeds
-    SUPPORT_TIMEFRAME = [
-        ("5y",  UbuntuMaintenance.SERVER_SEEDS),
-        ("3y",  UbuntuMaintenance.DESKTOP_SEEDS),
-        ("18m", UbuntuMaintenance.SUPPORTED_SEEDS),
-        ]
-
     # on a LTS this is significant, it defines what names get LTS support
     DISTRO_NAMES = [
         "ubuntu",
         "kubuntu",
         ]
 
+    def support_timeframe(self, name):
+        """See `UbuntuMaintenance`."""
+        return [
+            ("5y", self.SERVER_SEEDS),
+            ("3y", self.DESKTOP_SEEDS),
+            ("18m", self.SUPPORTED_SEEDS),
+            ]
+
 
 class PreciseUbuntuMaintenance(UbuntuMaintenance):
     """ The support timeframe for the 12.04 (precise) LTS release.
-        This changes the timeframe for desktop packages from 3y to 5y
+        This changes the timeframe for desktop packages from 3y to 5y for
+        Ubuntu, Kubuntu, and Edubuntu.  Xubuntu desktop packages get 3y.
     """
 
-    # lts support timeframe, order is important, least supported must be last
-    # time, seeds
-    SUPPORT_TIMEFRAME = [
-        ("5y", UbuntuMaintenance.SERVER_SEEDS),
-        ("5y", UbuntuMaintenance.DESKTOP_SEEDS),
-        ("18m", UbuntuMaintenance.SUPPORTED_SEEDS),
-        ]
-
     # on a LTS this is significant, it defines what names get LTS support
     DISTRO_NAMES = [
         "ubuntu",
+        "kubuntu",
+        "edubuntu",
+        "xubuntu",
         ]
 
+    def support_timeframe(self, name):
+        """See `UbuntuMaintenance`."""
+        timeframe = []
+        timeframe.append(("5y", self.SERVER_SEEDS))
+        if name == "xubuntu":
+            timeframe.append(("3y", self.DESKTOP_SEEDS))
+        else:
+            timeframe.append(("5y", self.DESKTOP_SEEDS))
+        timeframe.append(("18m", self.SUPPORTED_SEEDS))
+        return timeframe
+
 
 # Names of the distribution releases that are not supported by this
 # tool. All later versions are supported.
@@ -301,7 +311,7 @@
 def get_packages_support_time(structure, name, pkg_support_time,
                               support_timeframe_list):
     """
-    input a structure file and a list of pair<timeframe, seedlist>
+    input a structure file and a list of tuple<timeframe, seedlist>
     return a dict of pkgnames -> support timeframe string
     """
     for (timeframe, seedlist) in support_timeframe_list:
@@ -379,7 +389,7 @@
             continue
 
         # get dicts of pkgname -> support timeframe string
-        support_timeframe = ubuntu_maintenance.SUPPORT_TIMEFRAME
+        support_timeframe = ubuntu_maintenance.support_timeframe(name)
         get_packages_support_time(
             structure, name, pkg_support_time, support_timeframe)
 
@@ -435,6 +445,9 @@
             raise
         sys.stderr.write("hints-file: %s gave 404 error\n" % hints_file)
 
+    standard_support_time = ubuntu_maintenance.support_timeframe(
+        "ubuntu")[-1][0]
+
     # output suitable for the extra-override file
     for pkgname in sorted(pkg_support_time.keys()):
         # special case, the hints file may contain overrides that
@@ -460,5 +473,4 @@
                     # not a LTS supported architecture, gets only regular
                     # support_timeframe
                     print "%s %s %s" % (
-                        pkgname_and_arch, SUPPORT_TAG,
-                        ubuntu_maintenance.SUPPORT_TIMEFRAME[-1][0])
+                        pkgname_and_arch, SUPPORT_TAG, standard_support_time)

=== modified file 'lib/lp/soyuz/scripts/tests/germinate-test-data/mock-lp-root/scripts/ftpmaster-tools/lp-query-distro.py'
--- 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
+++ 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
@@ -19,9 +19,9 @@
     if len(args) == 2:
         distro = args[1]
         if distro == "development":
-                return "natty"
+            return "q-series"
         elif distro == "supported":
-                return "hardy jaunty karmic lucid maverick"
+            return "hardy jaunty karmic lucid maverick precise"
     elif len(args) == 4 and args[1] == '-s' and args[3] == 'archs':
         return "i386 amd64 powerpc armel"
     error_and_exit()

=== modified file 'lib/lp/soyuz/scripts/tests/test_cron_germinate.py'
--- lib/lp/soyuz/scripts/tests/test_cron_germinate.py	2011-12-14 15:21:50 +0000
+++ lib/lp/soyuz/scripts/tests/test_cron_germinate.py	2012-01-10 01:23:26 +0000
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2010 Canonical Ltd.  This software is licensed under the
+# Copyright 2010-2012 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """This is a test for the soyuz cron.germinate script."""
@@ -16,9 +16,16 @@
 
 class TestCronGerminate(TestCase):
 
-    DISTRO_NAMES = ["platform", "ubuntu", "kubuntu", "netbook"]
-    DISTS = ["hardy", "lucid", "maverick"]
-    DEVELOPMENT_DIST = "natty"
+    DISTRO_NAMES = [
+        "platform",
+        "ubuntu",
+        "kubuntu",
+        "netbook",
+        "edubuntu",
+        "xubuntu",
+        ]
+    DISTS = ["hardy", "lucid", "maverick", "precise"]
+    DEVELOPMENT_DIST = "q-series"
     COMPONENTS = ["main", "restricted", "universe", "multiverse"]
     ARCHES = ["i386", "amd64", "armel", "powerpc"]
     BASEPATH = os.path.abspath(os.path.dirname(__file__))
@@ -172,7 +179,7 @@
             fake_environ["MAINTENANCE_CHECK_HINTS_DIR_URL"] = "file://%s" % \
                 os.path.abspath(hints_file_url)
             # add hints override to test that feature
-            f=open(hints_file_url % "lucid", "a")
+            f = open(hints_file_url % "lucid", "a")
             f.write("linux-image-2.6.32-25-server 5y\n")
             f.close()
         return fake_environ


Follow ups