← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~abentley/launchpad/allow-0.3 into lp:launchpad/devel

 

Aaron Bentley has proposed merging lp:~abentley/launchpad/allow-0.3 into lp:launchpad/devel with lp:~abentley/launchpad/safe-v3 as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #479705 merge subdirs
  https://bugs.launchpad.net/bugs/479705


= Summary =
Fix bug #479705

== Proposed fix ==
Support recipe format 0.3, which supports nest-part

== Pre-implementation notes ==
None

== Implementation details ==
Made 0.3 the default everywhere, so that if people choose to add a nest-part
command to the default template, it will just work.

== Tests ==
bin/test test_sourcepackagerecipe

== Demo and Q/A ==
Create a recipe that uses 0.3 and nest-part.  If it builds, correctly, this
worked.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/code/model/sourcepackagerecipedata.py
  lib/lp/code/model/tests/test_sourcepackagerecipe.py
  lib/canonical/buildd/buildrecipe
  lib/canonical/buildd/debian/control
  lib/lp/code/browser/tests/test_sourcepackagerecipe.py
  lib/lp/code/interfaces/sourcepackagerecipe.py
  lib/lp/code/model/tests/test_recipebuilder.py

./lib/lp/code/model/sourcepackagerecipedata.py
     168: E202 whitespace before ')'
./lib/lp/code/model/tests/test_sourcepackagerecipe.py
     285: E231 missing whitespace after ','
     309: E231 missing whitespace after ','
     317: E231 missing whitespace after ','
     324: E231 missing whitespace after ','
     332: E231 missing whitespace after ','
     370: E231 missing whitespace after ','
     430: E231 missing whitespace after ','
     510: E301 expected 1 blank line, found 0
     731: Line exceeds 78 characters.
./lib/canonical/buildd/debian/control
      11: Line exceeds 78 characters.
./lib/lp/code/browser/tests/test_sourcepackagerecipe.py
     275: E231 missing whitespace after ','
./lib/lp/code/interfaces/sourcepackagerecipe.py
      77: E231 missing whitespace after ','
     154: E202 whitespace before ')'
     154: E231 missing whitespace after ','
./lib/lp/code/model/tests/test_recipebuilder.py
     169: E501 line too long (82 characters)
     176: E501 line too long (80 characters)
     203: E501 line too long (80 characters)
     245: E301 expected 1 blank line, found 2
      82: Line exceeds 78 characters.
     169: Line exceeds 78 characters.
     176: Line exceeds 78 characters.
     203: Line exceeds 78 characters.
-- 
https://code.launchpad.net/~abentley/launchpad/allow-0.3/+merge/34478
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~abentley/launchpad/allow-0.3 into lp:launchpad/devel.
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2010-09-01 03:25:36 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py	2010-09-02 20:14:47 +0000
@@ -146,7 +146,7 @@
             .*
 
             Recipe contents
-            # bzr-builder format 0.2 deb-version 0\+\{revno\}
+            # bzr-builder format 0.3 deb-version 0\+\{revno\}
             lp://dev/~chef/ratatouille/veggies"""
         main_text = extract_text(find_main_content(browser.contents))
         self.assertTextMatchesExpressionIgnoreWhitespace(
@@ -267,7 +267,7 @@
 
         browser = self.createRecipe(
             dedent('''
-                # bzr-builder format 0.2 deb-version 0+{revno}
+                # bzr-builder format 0.3 deb-version 0+{revno}
                 %(branch)s
                 merge %(package_branch)s
                 ''' % {
@@ -403,7 +403,7 @@
             .*
 
             Recipe contents
-            # bzr-builder format 0.2 deb-version 0\+\{revno\}
+            # bzr-builder format 0.3 deb-version 0\+\{revno\}
             lp://dev/~chef/ratatouille/meat"""
         main_text = extract_text(find_main_content(browser.contents))
         self.assertTextMatchesExpressionIgnoreWhitespace(
@@ -513,7 +513,7 @@
             .*
 
             Recipe contents
-            # bzr-builder format 0.2 deb-version 0\+\{revno\}
+            # bzr-builder format 0.3 deb-version 0\+\{revno\}
             lp://dev/~chef/ratatouille/meat"""
         main_text = extract_text(find_main_content(browser.contents))
         self.assertTextMatchesExpressionIgnoreWhitespace(
@@ -567,7 +567,7 @@
             Request build\(s\)
 
             Recipe contents
-            # bzr-builder format 0.2 deb-version 0\+\{revno\}
+            # bzr-builder format 0.3 deb-version 0\+\{revno\}
             lp://dev/~chef/chocolate/cake""", self.getMainText(recipe))
 
     def test_index_no_builds(self):

=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
--- lib/lp/code/interfaces/sourcepackagerecipe.py	2010-08-20 20:31:18 +0000
+++ lib/lp/code/interfaces/sourcepackagerecipe.py	2010-09-02 20:14:47 +0000
@@ -59,7 +59,7 @@
 
 
 MINIMAL_RECIPE_TEXT = dedent(u'''\
-    # bzr-builder format 0.2 deb-version 0+{revno}
+    # bzr-builder format 0.3 deb-version 0+{revno}
     %s
     ''')
 

=== modified file 'lib/lp/code/model/sourcepackagerecipedata.py'
--- lib/lp/code/model/sourcepackagerecipedata.py	2010-08-20 20:31:18 +0000
+++ lib/lp/code/model/sourcepackagerecipedata.py	2010-09-02 20:14:47 +0000
@@ -253,8 +253,8 @@
 
     def setRecipe(self, builder_recipe):
         """Convert the BaseRecipeBranch `builder_recipe` to the db form."""
-        if builder_recipe.format > 0.2:
-            raise TooNewRecipeFormat(builder_recipe.format, 0.2)
+        if builder_recipe.format > 0.3:
+            raise TooNewRecipeFormat(builder_recipe.format, 0.3)
         branch_map = self._scanInstructions(builder_recipe)
         # If this object hasn't been added to a store yet, there can't be any
         # instructions linking to us yet.

=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
--- lib/lp/code/model/tests/test_recipebuilder.py	2010-08-27 15:03:18 +0000
+++ lib/lp/code/model/tests/test_recipebuilder.py	2010-09-02 20:14:47 +0000
@@ -155,7 +155,7 @@
            'author_name': u'Joe User',
            'archive_purpose': 'PPA',
            'ogrecomponent': 'universe',
-           'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'
+           'recipe_text': '# bzr-builder format 0.3 deb-version 0+{revno}\n'
                           'lp://dev/~joe/someapp/pkg\n',
            'archives': expected_archives,
            'distroseries_name': job.build.distroseries.name,
@@ -222,7 +222,7 @@
            'author_name': u'Joe User',
            'archive_purpose': 'PPA',
            'ogrecomponent': 'universe',
-           'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'
+           'recipe_text': '# bzr-builder format 0.3 deb-version 0+{revno}\n'
                           'lp://dev/~joe/someapp/pkg\n',
            'archives': expected_archives,
            'distroseries_name': job.build.distroseries.name,

=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipe.py	2010-09-01 03:25:36 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py	2010-09-02 20:14:47 +0000
@@ -239,7 +239,7 @@
 
     def test_rejects_run_command(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         run touch test
         ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)
@@ -255,7 +255,7 @@
         sp_recipe = self.makeSourcePackageRecipeFromBuilderRecipe(
             builder_recipe1)
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         run touch test
         ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)
@@ -267,9 +267,15 @@
             builder_recipe2)
         self.assertEquals([branch1], list(sp_recipe.getReferencedBranches()))
 
+    def test_accept_format_0_3(self):
+        """Recipe format 0.3 is accepted."""
+        builder_recipe = self.factory.makeRecipe()
+        builder_recipe.format = 0.3
+        self.makeSourcePackageRecipeFromBuilderRecipe(builder_recipe)
+
     def test_reject_newer_formats(self):
         builder_recipe = self.factory.makeRecipe()
-        builder_recipe.format = 0.3
+        builder_recipe.format = 0.4
         self.assertRaises(
             TooNewRecipeFormat,
             self.makeSourcePackageRecipeFromBuilderRecipe, builder_recipe)
@@ -568,7 +574,7 @@
 
     def test_builds_simplest_recipe(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         ''' % self.branch_identities
         base_branch = self.get_recipe(recipe_text)
@@ -578,7 +584,7 @@
 
     def test_builds_recipe_with_merge(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         merge bar %(merged)s
         ''' % self.branch_identities
@@ -593,7 +599,7 @@
 
     def test_builds_recipe_with_nest(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         nest bar %(nested)s baz
         ''' % self.branch_identities
@@ -608,7 +614,7 @@
 
     def test_builds_recipe_with_nest_then_merge(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         nest bar %(nested)s baz
         merge zam %(merged)s
@@ -628,7 +634,7 @@
 
     def test_builds_recipe_with_merge_then_nest(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         merge zam %(merged)s
         nest bar %(nested)s baz
@@ -648,7 +654,7 @@
 
     def test_builds_a_merge_in_to_a_nest(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         nest bar %(nested)s baz
           merge zam %(merged)s
@@ -671,7 +677,7 @@
         nested2 = self.factory.makeAnyBranch()
         self.branch_identities['nested2'] = nested2.bzr_identity
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s
         nest bar %(nested)s baz
           nest zam %(nested2)s zoo
@@ -691,7 +697,7 @@
 
     def tests_builds_recipe_with_revspecs(self):
         recipe_text = '''\
-        # bzr-builder format 0.2 deb-version 0.1-{revno}
+        # bzr-builder format 0.3 deb-version 0.1-{revno}
         %(base)s revid:a
         nest bar %(nested)s baz tag:b
         merge zam %(merged)s 2