Merge lp:~abentley/launchpad/allow-0.3 into lp:launchpad

Proposed by Aaron Bentley
Status: Rejected
Rejected by: Aaron Bentley
Proposed branch: lp:~abentley/launchpad/allow-0.3
Merge into: lp:launchpad
Prerequisite: lp:~abentley/launchpad/safe-v3
Diff against target: 205 lines (+26/-20)
5 files modified
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+5/-5)
lib/lp/code/interfaces/sourcepackagerecipe.py (+1/-1)
lib/lp/code/model/sourcepackagerecipedata.py (+2/-2)
lib/lp/code/model/tests/test_recipebuilder.py (+2/-2)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+16/-10)
To merge this branch: bzr merge lp:~abentley/launchpad/allow-0.3
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Disapprove
Paul Hummer (community) Approve
Review via email: mp+34478@code.launchpad.net

Commit message

Description of the change

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

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) :
review: Approve
Revision history for this message
Aaron Bentley (abentley) wrote :
review: Disapprove

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2010-10-04 19:50:45 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2010-10-26 15:43:30 +0000
@@ -141,7 +141,7 @@
141 .*141 .*
142142
143 Recipe contents143 Recipe contents
144 # bzr-builder format 0.2 deb-version 0\+\{revno\}144 # bzr-builder format 0.3 deb-version 0\+\{revno\}
145 lp://dev/~chef/ratatouille/veggies"""145 lp://dev/~chef/ratatouille/veggies"""
146 main_text = extract_text(find_main_content(browser.contents))146 main_text = extract_text(find_main_content(browser.contents))
147 self.assertTextMatchesExpressionIgnoreWhitespace(147 self.assertTextMatchesExpressionIgnoreWhitespace(
@@ -262,7 +262,7 @@
262262
263 browser = self.createRecipe(263 browser = self.createRecipe(
264 dedent('''264 dedent('''
265 # bzr-builder format 0.2 deb-version 0+{revno}265 # bzr-builder format 0.3 deb-version 0+{revno}
266 %(branch)s266 %(branch)s
267 merge %(package_branch)s267 merge %(package_branch)s
268 ''' % {268 ''' % {
@@ -416,7 +416,7 @@
416 .*416 .*
417417
418 Recipe contents418 Recipe contents
419 # bzr-builder format 0.2 deb-version 0\+\{revno\}419 # bzr-builder format 0.3 deb-version 0\+\{revno\}
420 lp://dev/~chef/ratatouille/meat"""420 lp://dev/~chef/ratatouille/meat"""
421 main_text = extract_text(find_main_content(browser.contents))421 main_text = extract_text(find_main_content(browser.contents))
422 self.assertTextMatchesExpressionIgnoreWhitespace(422 self.assertTextMatchesExpressionIgnoreWhitespace(
@@ -556,7 +556,7 @@
556 .*556 .*
557557
558 Recipe contents558 Recipe contents
559 # bzr-builder format 0.2 deb-version 0\+\{revno\}559 # bzr-builder format 0.3 deb-version 0\+\{revno\}
560 lp://dev/~chef/ratatouille/meat"""560 lp://dev/~chef/ratatouille/meat"""
561 main_text = extract_text(find_main_content(browser.contents))561 main_text = extract_text(find_main_content(browser.contents))
562 self.assertTextMatchesExpressionIgnoreWhitespace(562 self.assertTextMatchesExpressionIgnoreWhitespace(
@@ -610,7 +610,7 @@
610 Request build\(s\)610 Request build\(s\)
611611
612 Recipe contents612 Recipe contents
613 # bzr-builder format 0.2 deb-version 0\+\{revno\}613 # bzr-builder format 0.3 deb-version 0\+\{revno\}
614 lp://dev/~chef/chocolate/cake""", self.getMainText(recipe))614 lp://dev/~chef/chocolate/cake""", self.getMainText(recipe))
615615
616 def test_index_no_builds(self):616 def test_index_no_builds(self):
617617
=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
--- lib/lp/code/interfaces/sourcepackagerecipe.py 2010-09-08 15:29:51 +0000
+++ lib/lp/code/interfaces/sourcepackagerecipe.py 2010-10-26 15:43:30 +0000
@@ -59,7 +59,7 @@
5959
6060
61MINIMAL_RECIPE_TEXT = dedent(u'''\61MINIMAL_RECIPE_TEXT = dedent(u'''\
62 # bzr-builder format 0.2 deb-version 0+{revno}62 # bzr-builder format 0.3 deb-version 0+{revno}
63 %s63 %s
64 ''')64 ''')
6565
6666
=== modified file 'lib/lp/code/model/sourcepackagerecipedata.py'
--- lib/lp/code/model/sourcepackagerecipedata.py 2010-09-02 14:28:57 +0000
+++ lib/lp/code/model/sourcepackagerecipedata.py 2010-10-26 15:43:30 +0000
@@ -255,8 +255,8 @@
255255
256 def setRecipe(self, builder_recipe):256 def setRecipe(self, builder_recipe):
257 """Convert the BaseRecipeBranch `builder_recipe` to the db form."""257 """Convert the BaseRecipeBranch `builder_recipe` to the db form."""
258 if builder_recipe.format > 0.2:258 if builder_recipe.format > 0.3:
259 raise TooNewRecipeFormat(builder_recipe.format, 0.2)259 raise TooNewRecipeFormat(builder_recipe.format, 0.3)
260 branch_map = self._scanInstructions(builder_recipe)260 branch_map = self._scanInstructions(builder_recipe)
261 # If this object hasn't been added to a store yet, there can't be any261 # If this object hasn't been added to a store yet, there can't be any
262 # instructions linking to us yet.262 # instructions linking to us yet.
263263
=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
--- lib/lp/code/model/tests/test_recipebuilder.py 2010-10-04 19:50:45 +0000
+++ lib/lp/code/model/tests/test_recipebuilder.py 2010-10-26 15:43:30 +0000
@@ -166,7 +166,7 @@
166 'author_name': u'Joe User',166 'author_name': u'Joe User',
167 'archive_purpose': 'PPA',167 'archive_purpose': 'PPA',
168 'ogrecomponent': 'universe',168 'ogrecomponent': 'universe',
169 'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'169 'recipe_text': '# bzr-builder format 0.3 deb-version 0+{revno}\n'
170 'lp://dev/~joe/someapp/pkg\n',170 'lp://dev/~joe/someapp/pkg\n',
171 'archives': expected_archives,171 'archives': expected_archives,
172 'distroseries_name': job.build.distroseries.name,172 'distroseries_name': job.build.distroseries.name,
@@ -233,7 +233,7 @@
233 'author_name': u'Joe User',233 'author_name': u'Joe User',
234 'archive_purpose': 'PPA',234 'archive_purpose': 'PPA',
235 'ogrecomponent': 'universe',235 'ogrecomponent': 'universe',
236 'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'236 'recipe_text': '# bzr-builder format 0.3 deb-version 0+{revno}\n'
237 'lp://dev/~joe/someapp/pkg\n',237 'lp://dev/~joe/someapp/pkg\n',
238 'archives': expected_archives,238 'archives': expected_archives,
239 'distroseries_name': job.build.distroseries.name,239 'distroseries_name': job.build.distroseries.name,
240240
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-09-22 21:03:48 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-10-26 15:43:30 +0000
@@ -221,7 +221,7 @@
221221
222 def test_rejects_run_command(self):222 def test_rejects_run_command(self):
223 recipe_text = '''\223 recipe_text = '''\
224 # bzr-builder format 0.2 deb-version 0.1-{revno}224 # bzr-builder format 0.3 deb-version 0.1-{revno}
225 %(base)s225 %(base)s
226 run touch test226 run touch test
227 ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)227 ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)
@@ -234,7 +234,7 @@
234 sp_recipe = self.factory.makeSourcePackageRecipe()234 sp_recipe = self.factory.makeSourcePackageRecipe()
235 old_branches = list(sp_recipe.getReferencedBranches())235 old_branches = list(sp_recipe.getReferencedBranches())
236 recipe_text = '''\236 recipe_text = '''\
237 # bzr-builder format 0.2 deb-version 0.1-{revno}237 # bzr-builder format 0.3 deb-version 0.1-{revno}
238 %(base)s238 %(base)s
239 run touch test239 run touch test
240 ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)240 ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)
@@ -246,6 +246,12 @@
246 self.assertEquals(246 self.assertEquals(
247 old_branches, list(sp_recipe.getReferencedBranches()))247 old_branches, list(sp_recipe.getReferencedBranches()))
248248
249 def test_accept_format_0_3(self):
250 """Recipe format 0.3 is accepted."""
251 builder_recipe = self.factory.makeRecipe()
252 builder_recipe.format = 0.3
253 self.makeSourcePackageRecipeFromBuilderRecipe(builder_recipe)
254
249 def test_reject_newer_formats(self):255 def test_reject_newer_formats(self):
250 with recipe_parser_newest_version(145.115):256 with recipe_parser_newest_version(145.115):
251 builder_recipe = self.factory.makeRecipe()257 builder_recipe = self.factory.makeRecipe()
@@ -564,7 +570,7 @@
564570
565 def test_builds_simplest_recipe(self):571 def test_builds_simplest_recipe(self):
566 recipe_text = '''\572 recipe_text = '''\
567 # bzr-builder format 0.2 deb-version 0.1-{revno}573 # bzr-builder format 0.3 deb-version 0.1-{revno}
568 %(base)s574 %(base)s
569 ''' % self.branch_identities575 ''' % self.branch_identities
570 base_branch = self.get_recipe(recipe_text)576 base_branch = self.get_recipe(recipe_text)
@@ -574,7 +580,7 @@
574580
575 def test_builds_recipe_with_merge(self):581 def test_builds_recipe_with_merge(self):
576 recipe_text = '''\582 recipe_text = '''\
577 # bzr-builder format 0.2 deb-version 0.1-{revno}583 # bzr-builder format 0.3 deb-version 0.1-{revno}
578 %(base)s584 %(base)s
579 merge bar %(merged)s585 merge bar %(merged)s
580 ''' % self.branch_identities586 ''' % self.branch_identities
@@ -589,7 +595,7 @@
589595
590 def test_builds_recipe_with_nest(self):596 def test_builds_recipe_with_nest(self):
591 recipe_text = '''\597 recipe_text = '''\
592 # bzr-builder format 0.2 deb-version 0.1-{revno}598 # bzr-builder format 0.3 deb-version 0.1-{revno}
593 %(base)s599 %(base)s
594 nest bar %(nested)s baz600 nest bar %(nested)s baz
595 ''' % self.branch_identities601 ''' % self.branch_identities
@@ -604,7 +610,7 @@
604610
605 def test_builds_recipe_with_nest_then_merge(self):611 def test_builds_recipe_with_nest_then_merge(self):
606 recipe_text = '''\612 recipe_text = '''\
607 # bzr-builder format 0.2 deb-version 0.1-{revno}613 # bzr-builder format 0.3 deb-version 0.1-{revno}
608 %(base)s614 %(base)s
609 nest bar %(nested)s baz615 nest bar %(nested)s baz
610 merge zam %(merged)s616 merge zam %(merged)s
@@ -624,7 +630,7 @@
624630
625 def test_builds_recipe_with_merge_then_nest(self):631 def test_builds_recipe_with_merge_then_nest(self):
626 recipe_text = '''\632 recipe_text = '''\
627 # bzr-builder format 0.2 deb-version 0.1-{revno}633 # bzr-builder format 0.3 deb-version 0.1-{revno}
628 %(base)s634 %(base)s
629 merge zam %(merged)s635 merge zam %(merged)s
630 nest bar %(nested)s baz636 nest bar %(nested)s baz
@@ -644,7 +650,7 @@
644650
645 def test_builds_a_merge_in_to_a_nest(self):651 def test_builds_a_merge_in_to_a_nest(self):
646 recipe_text = '''\652 recipe_text = '''\
647 # bzr-builder format 0.2 deb-version 0.1-{revno}653 # bzr-builder format 0.3 deb-version 0.1-{revno}
648 %(base)s654 %(base)s
649 nest bar %(nested)s baz655 nest bar %(nested)s baz
650 merge zam %(merged)s656 merge zam %(merged)s
@@ -667,7 +673,7 @@
667 nested2 = self.factory.makeAnyBranch()673 nested2 = self.factory.makeAnyBranch()
668 self.branch_identities['nested2'] = nested2.bzr_identity674 self.branch_identities['nested2'] = nested2.bzr_identity
669 recipe_text = '''\675 recipe_text = '''\
670 # bzr-builder format 0.2 deb-version 0.1-{revno}676 # bzr-builder format 0.3 deb-version 0.1-{revno}
671 %(base)s677 %(base)s
672 nest bar %(nested)s baz678 nest bar %(nested)s baz
673 nest zam %(nested2)s zoo679 nest zam %(nested2)s zoo
@@ -687,7 +693,7 @@
687693
688 def tests_builds_recipe_with_revspecs(self):694 def tests_builds_recipe_with_revspecs(self):
689 recipe_text = '''\695 recipe_text = '''\
690 # bzr-builder format 0.2 deb-version 0.1-{revno}696 # bzr-builder format 0.3 deb-version 0.1-{revno}
691 %(base)s revid:a697 %(base)s revid:a
692 nest bar %(nested)s baz tag:b698 nest bar %(nested)s baz tag:b
693 merge zam %(merged)s 2699 merge zam %(merged)s 2