Merge lp:~abentley/launchpad/version-revno into lp:launchpad

Proposed by Aaron Bentley on 2010-06-10
Status: Merged
Approved by: Aaron Bentley on 2010-06-16
Approved revision: no longer in the source branch.
Merged at revision: 11023
Proposed branch: lp:~abentley/launchpad/version-revno
Merge into: lp:launchpad
Diff against target: 101 lines (+11/-11)
3 files modified
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+8/-8)
lib/lp/code/interfaces/sourcepackagerecipe.py (+1/-1)
lib/lp/code/model/tests/test_recipebuilder.py (+2/-2)
To merge this branch: bzr merge lp:~abentley/launchpad/version-revno
Reviewer Review Type Date Requested Status
Paul Hummer (community) code 2010-06-10 Approve on 2010-06-10
Review via email: mp+27308@code.launchpad.net

Commit Message

Better default recipe.

Description of the Change

= Summary =
Provide a default recipe whose debian version is different for different
builds.

== Proposed fix ==
Use 0+{revno} as the default debian version template. This will cause the
debversion to change every time the base branch is updated. Using 0 as the
version number guarantees it won't interfere with legitimate packages.

Users can (and will be encouraged to) supply their own version instead.

== Pre-implementation notes ==
Discussed possible template strings with james westby

== Implementation details ==
The tests have lots of slashes because they're using regular expresions, and
+, { and } are special characters in regular expressions.

== Tests ==
bin/test sourcepackagerecipe

== Demo and Q/A ==
Create a new recipe. Its version string should be 0+{revno}.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/code/browser/tests/test_sourcepackagerecipe.py
  lib/lp/code/interfaces/sourcepackagerecipe.py

== Pyflakes notices ==

lib/lp/code/browser/tests/test_sourcepackagerecipe.py
    258: local variable 'recipe_fings' is assigned to but never used

== Pylint notices ==

lib/lp/code/interfaces/sourcepackagerecipe.py
    164: [C0322, ISourcePackageRecipe.requestBuild] Operator not preceded by a space
    distroseries=Reference(schema=IDistroSeries),
    ^
    )
    @export_write_operation()
    def requestBuild(archive, distroseries, requester, pocket):

To post a comment you must log in.
Paul Hummer (rockstar) wrote :

<rockstar> abentley, is {revno} special to bzr-builder?
<abentley> rockstar, yes.
<rockstar> abentley, ah great, so we don't need the MANIFEST at all.
<abentley> rockstar, huh?
<rockstar> abentley, we were talking about doing this ourselves, but we needed access to the MANIFEST to get to the bzr revno.
<abentley> rockstar, we'll still need manifests to abort duplicate builds, because {revno} is only evaluated once the build has started.
<rockstar> abentley, ah, okay.

review: Approve (code)

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-06-17 01:56:33 +0000
3+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2010-06-17 13:19:26 +0000
4@@ -110,12 +110,12 @@
5 Recipe information
6 Owner: Master Chef
7 Base branch: lp://dev/~chef/ratatouille/veggies
8- Debian version: 1.0
9+ Debian version: 0\+\{revno\}
10 Distribution series: Secret Squirrel
11 .*
12
13 Recipe contents
14- # bzr-builder format 0.2 deb-version 1.0
15+ # bzr-builder format 0.2 deb-version 0\+\{revno\}
16 lp://dev/~chef/ratatouille/veggies"""
17 main_text = extract_text(find_main_content(browser.contents))
18 self.assertTextMatchesExpressionIgnoreWhitespace(
19@@ -276,12 +276,12 @@
20 Recipe information
21 Owner: Master Chef
22 Base branch: lp://dev/~chef/ratatouille/meat
23- Debian version: 1.0
24+ Debian version: 0\+\{revno\}
25 Distribution series: Mumbly Midget
26 .*
27
28 Recipe contents
29- # bzr-builder format 0.2 deb-version 1.0
30+ # bzr-builder format 0.2 deb-version 0\+\{revno\}
31 lp://dev/~chef/ratatouille/meat"""
32 main_text = extract_text(find_main_content(browser.contents))
33 self.assertTextMatchesExpressionIgnoreWhitespace(
34@@ -383,12 +383,12 @@
35 Recipe information
36 Owner: Master Chef
37 Base branch: lp://dev/~chef/ratatouille/meat
38- Debian version: 1.0
39+ Debian version: 0\+\{revno\}
40 Distribution series: Mumbly Midget
41 .*
42
43 Recipe contents
44- # bzr-builder format 0.2 deb-version 1.0
45+ # bzr-builder format 0.2 deb-version 0\+\{revno\}
46 lp://dev/~chef/ratatouille/meat"""
47 main_text = extract_text(find_main_content(browser.contents))
48 self.assertTextMatchesExpressionIgnoreWhitespace(
49@@ -415,7 +415,7 @@
50 Recipe information
51 Owner: Master Chef
52 Base branch: lp://dev/~chef/chocolate/cake
53- Debian version: 1.0
54+ Debian version: 0\+\{revno\}
55 Distribution series: Secret Squirrel
56
57 Build records
58@@ -424,7 +424,7 @@
59 Request build\(s\)
60
61 Recipe contents
62- # bzr-builder format 0.2 deb-version 1.0
63+ # bzr-builder format 0.2 deb-version 0\+\{revno\}
64 lp://dev/~chef/chocolate/cake""", self.getMainText(recipe))
65
66 def test_index_no_builds(self):
67
68=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
69--- lib/lp/code/interfaces/sourcepackagerecipe.py 2010-06-11 05:05:52 +0000
70+++ lib/lp/code/interfaces/sourcepackagerecipe.py 2010-06-17 13:19:26 +0000
71@@ -40,7 +40,7 @@
72
73
74 MINIMAL_RECIPE_TEXT = dedent(u'''\
75- # bzr-builder format 0.2 deb-version 1.0
76+ # bzr-builder format 0.2 deb-version 0+{revno}
77 %s
78 ''')
79
80
81=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
82--- lib/lp/code/model/tests/test_recipebuilder.py 2010-05-27 17:55:16 +0000
83+++ lib/lp/code/model/tests/test_recipebuilder.py 2010-06-17 13:19:26 +0000
84@@ -145,7 +145,7 @@
85 'author_name': u'Joe User',
86 'archive_purpose': 'PPA',
87 'ogrecomponent': 'universe',
88- 'recipe_text': '# bzr-builder format 0.2 deb-version 1.0\n'
89+ 'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'
90 'lp://dev/~joe/someapp/pkg\n',
91 'archives': expected_archives,
92 'distroseries_name': job.build.distroseries.name,
93@@ -174,7 +174,7 @@
94 'author_name': u'Joe User',
95 'archive_purpose': 'PPA',
96 'ogrecomponent': 'universe',
97- 'recipe_text': '# bzr-builder format 0.2 deb-version 1.0\n'
98+ 'recipe_text': '# bzr-builder format 0.2 deb-version 0+{revno}\n'
99 'lp://dev/~joe/someapp/pkg\n',
100 'archives': expected_archives,
101 'distroseries_name': job.build.distroseries.name,