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
1=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
2--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2010-10-04 19:50:45 +0000
3+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2010-10-26 15:43:30 +0000
4@@ -141,7 +141,7 @@
5 .*
6
7 Recipe contents
8- # bzr-builder format 0.2 deb-version 0\+\{revno\}
9+ # bzr-builder format 0.3 deb-version 0\+\{revno\}
10 lp://dev/~chef/ratatouille/veggies"""
11 main_text = extract_text(find_main_content(browser.contents))
12 self.assertTextMatchesExpressionIgnoreWhitespace(
13@@ -262,7 +262,7 @@
14
15 browser = self.createRecipe(
16 dedent('''
17- # bzr-builder format 0.2 deb-version 0+{revno}
18+ # bzr-builder format 0.3 deb-version 0+{revno}
19 %(branch)s
20 merge %(package_branch)s
21 ''' % {
22@@ -416,7 +416,7 @@
23 .*
24
25 Recipe contents
26- # bzr-builder format 0.2 deb-version 0\+\{revno\}
27+ # bzr-builder format 0.3 deb-version 0\+\{revno\}
28 lp://dev/~chef/ratatouille/meat"""
29 main_text = extract_text(find_main_content(browser.contents))
30 self.assertTextMatchesExpressionIgnoreWhitespace(
31@@ -556,7 +556,7 @@
32 .*
33
34 Recipe contents
35- # bzr-builder format 0.2 deb-version 0\+\{revno\}
36+ # bzr-builder format 0.3 deb-version 0\+\{revno\}
37 lp://dev/~chef/ratatouille/meat"""
38 main_text = extract_text(find_main_content(browser.contents))
39 self.assertTextMatchesExpressionIgnoreWhitespace(
40@@ -610,7 +610,7 @@
41 Request build\(s\)
42
43 Recipe contents
44- # bzr-builder format 0.2 deb-version 0\+\{revno\}
45+ # bzr-builder format 0.3 deb-version 0\+\{revno\}
46 lp://dev/~chef/chocolate/cake""", self.getMainText(recipe))
47
48 def test_index_no_builds(self):
49
50=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
51--- lib/lp/code/interfaces/sourcepackagerecipe.py 2010-09-08 15:29:51 +0000
52+++ lib/lp/code/interfaces/sourcepackagerecipe.py 2010-10-26 15:43:30 +0000
53@@ -59,7 +59,7 @@
54
55
56 MINIMAL_RECIPE_TEXT = dedent(u'''\
57- # bzr-builder format 0.2 deb-version 0+{revno}
58+ # bzr-builder format 0.3 deb-version 0+{revno}
59 %s
60 ''')
61
62
63=== modified file 'lib/lp/code/model/sourcepackagerecipedata.py'
64--- lib/lp/code/model/sourcepackagerecipedata.py 2010-09-02 14:28:57 +0000
65+++ lib/lp/code/model/sourcepackagerecipedata.py 2010-10-26 15:43:30 +0000
66@@ -255,8 +255,8 @@
67
68 def setRecipe(self, builder_recipe):
69 """Convert the BaseRecipeBranch `builder_recipe` to the db form."""
70- if builder_recipe.format > 0.2:
71- raise TooNewRecipeFormat(builder_recipe.format, 0.2)
72+ if builder_recipe.format > 0.3:
73+ raise TooNewRecipeFormat(builder_recipe.format, 0.3)
74 branch_map = self._scanInstructions(builder_recipe)
75 # If this object hasn't been added to a store yet, there can't be any
76 # instructions linking to us yet.
77
78=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
79--- lib/lp/code/model/tests/test_recipebuilder.py 2010-10-04 19:50:45 +0000
80+++ lib/lp/code/model/tests/test_recipebuilder.py 2010-10-26 15:43:30 +0000
81@@ -166,7 +166,7 @@
82 'author_name': u'Joe User',
83 'archive_purpose': 'PPA',
84 'ogrecomponent': 'universe',
85- 'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'
86+ 'recipe_text': '# bzr-builder format 0.3 deb-version 0+{revno}\n'
87 'lp://dev/~joe/someapp/pkg\n',
88 'archives': expected_archives,
89 'distroseries_name': job.build.distroseries.name,
90@@ -233,7 +233,7 @@
91 'author_name': u'Joe User',
92 'archive_purpose': 'PPA',
93 'ogrecomponent': 'universe',
94- 'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'
95+ 'recipe_text': '# bzr-builder format 0.3 deb-version 0+{revno}\n'
96 'lp://dev/~joe/someapp/pkg\n',
97 'archives': expected_archives,
98 'distroseries_name': job.build.distroseries.name,
99
100=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
101--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-09-22 21:03:48 +0000
102+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-10-26 15:43:30 +0000
103@@ -221,7 +221,7 @@
104
105 def test_rejects_run_command(self):
106 recipe_text = '''\
107- # bzr-builder format 0.2 deb-version 0.1-{revno}
108+ # bzr-builder format 0.3 deb-version 0.1-{revno}
109 %(base)s
110 run touch test
111 ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)
112@@ -234,7 +234,7 @@
113 sp_recipe = self.factory.makeSourcePackageRecipe()
114 old_branches = list(sp_recipe.getReferencedBranches())
115 recipe_text = '''\
116- # bzr-builder format 0.2 deb-version 0.1-{revno}
117+ # bzr-builder format 0.3 deb-version 0.1-{revno}
118 %(base)s
119 run touch test
120 ''' % dict(base=self.factory.makeAnyBranch().bzr_identity)
121@@ -246,6 +246,12 @@
122 self.assertEquals(
123 old_branches, list(sp_recipe.getReferencedBranches()))
124
125+ def test_accept_format_0_3(self):
126+ """Recipe format 0.3 is accepted."""
127+ builder_recipe = self.factory.makeRecipe()
128+ builder_recipe.format = 0.3
129+ self.makeSourcePackageRecipeFromBuilderRecipe(builder_recipe)
130+
131 def test_reject_newer_formats(self):
132 with recipe_parser_newest_version(145.115):
133 builder_recipe = self.factory.makeRecipe()
134@@ -564,7 +570,7 @@
135
136 def test_builds_simplest_recipe(self):
137 recipe_text = '''\
138- # bzr-builder format 0.2 deb-version 0.1-{revno}
139+ # bzr-builder format 0.3 deb-version 0.1-{revno}
140 %(base)s
141 ''' % self.branch_identities
142 base_branch = self.get_recipe(recipe_text)
143@@ -574,7 +580,7 @@
144
145 def test_builds_recipe_with_merge(self):
146 recipe_text = '''\
147- # bzr-builder format 0.2 deb-version 0.1-{revno}
148+ # bzr-builder format 0.3 deb-version 0.1-{revno}
149 %(base)s
150 merge bar %(merged)s
151 ''' % self.branch_identities
152@@ -589,7 +595,7 @@
153
154 def test_builds_recipe_with_nest(self):
155 recipe_text = '''\
156- # bzr-builder format 0.2 deb-version 0.1-{revno}
157+ # bzr-builder format 0.3 deb-version 0.1-{revno}
158 %(base)s
159 nest bar %(nested)s baz
160 ''' % self.branch_identities
161@@ -604,7 +610,7 @@
162
163 def test_builds_recipe_with_nest_then_merge(self):
164 recipe_text = '''\
165- # bzr-builder format 0.2 deb-version 0.1-{revno}
166+ # bzr-builder format 0.3 deb-version 0.1-{revno}
167 %(base)s
168 nest bar %(nested)s baz
169 merge zam %(merged)s
170@@ -624,7 +630,7 @@
171
172 def test_builds_recipe_with_merge_then_nest(self):
173 recipe_text = '''\
174- # bzr-builder format 0.2 deb-version 0.1-{revno}
175+ # bzr-builder format 0.3 deb-version 0.1-{revno}
176 %(base)s
177 merge zam %(merged)s
178 nest bar %(nested)s baz
179@@ -644,7 +650,7 @@
180
181 def test_builds_a_merge_in_to_a_nest(self):
182 recipe_text = '''\
183- # bzr-builder format 0.2 deb-version 0.1-{revno}
184+ # bzr-builder format 0.3 deb-version 0.1-{revno}
185 %(base)s
186 nest bar %(nested)s baz
187 merge zam %(merged)s
188@@ -667,7 +673,7 @@
189 nested2 = self.factory.makeAnyBranch()
190 self.branch_identities['nested2'] = nested2.bzr_identity
191 recipe_text = '''\
192- # bzr-builder format 0.2 deb-version 0.1-{revno}
193+ # bzr-builder format 0.3 deb-version 0.1-{revno}
194 %(base)s
195 nest bar %(nested)s baz
196 nest zam %(nested2)s zoo
197@@ -687,7 +693,7 @@
198
199 def tests_builds_recipe_with_revspecs(self):
200 recipe_text = '''\
201- # bzr-builder format 0.2 deb-version 0.1-{revno}
202+ # bzr-builder format 0.3 deb-version 0.1-{revno}
203 %(base)s revid:a
204 nest bar %(nested)s baz tag:b
205 merge zam %(merged)s 2