Merge lp:~lifeless/python-oops-datedir-repo/timeline into lp:python-oops-datedir-repo

Proposed by Robert Collins
Status: Merged
Merged at revision: 26
Proposed branch: lp:~lifeless/python-oops-datedir-repo/timeline
Merge into: lp:python-oops-datedir-repo
Diff against target: 91 lines (+30/-3)
5 files modified
NEWS (+8/-0)
oops_datedir_repo/__init__.py (+1/-1)
oops_datedir_repo/serializer_rfc822.py (+2/-1)
oops_datedir_repo/tests/test_serializer_rfc822.py (+18/-0)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~lifeless/python-oops-datedir-repo/timeline
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+82344@code.launchpad.net

Description of the change

Prepare for backtraces in timelines. The serializer for rfc822 oopses would fail, because its very manual. Rather than write a parser as well, I've just dropped the extra data.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2011-11-15 21:47:32 +0000
3+++ NEWS 2011-11-16 03:48:32 +0000
4@@ -6,6 +6,9 @@
5 NEXT
6 ----
7
8+0.0.12
9+------
10+
11 * Repository has a simple generic config API. See the set_config and get_config
12 methods. (Robert Collins)
13
14@@ -17,6 +20,11 @@
15 references to keep is supplied. See the prune_unreferenced method.
16 (Robert Collins)
17
18+* The RFC822 serializer can now handle 5-tuple timelines (which include
19+ backtraces on actions) - the backtraces are skipped for backwards
20+ compatibility; use a BSON serializer to have the backtraces captured into the
21+ serialized report. (Robert Collins)
22+
23 * There is a new script bin/prune which will prune reports from a repository
24 keeping only those referenced in a given Launchpad project or project group.
25 This adds a dependency on launchpadlib, which should be pypi installable
26
27=== modified file 'oops_datedir_repo/__init__.py'
28--- oops_datedir_repo/__init__.py 2011-11-13 21:03:43 +0000
29+++ oops_datedir_repo/__init__.py 2011-11-16 03:48:32 +0000
30@@ -25,7 +25,7 @@
31 # established at this point, and setup.py will use a version of next-$(revno).
32 # If the releaselevel is 'final', then the tarball will be major.minor.micro.
33 # Otherwise it is major.minor.micro~$(revno).
34-__version__ = (0, 0, 11, 'beta', 0)
35+__version__ = (0, 0, 12, 'beta', 0)
36
37 __all__ = [
38 'DateDirRepo',
39
40=== modified file 'oops_datedir_repo/serializer_rfc822.py'
41--- oops_datedir_repo/serializer_rfc822.py 2011-11-11 04:48:09 +0000
42+++ oops_datedir_repo/serializer_rfc822.py 2011-11-16 03:48:32 +0000
43@@ -206,7 +206,8 @@
44 urllib.quote(_safestr(value), safe_chars)))
45 chunks.append('\n')
46 if 'timeline' in report:
47- for (start, end, category, statement) in report['timeline']:
48+ for row in report['timeline']:
49+ (start, end, category, statement) = row[:4]
50 chunks.append('%05d-%05d@%s %s\n' % (
51 start, end, _safestr(category),
52 _safestr(_normalise_whitespace(statement))))
53
54=== modified file 'oops_datedir_repo/tests/test_serializer_rfc822.py'
55--- oops_datedir_repo/tests/test_serializer_rfc822.py 2011-11-11 04:48:09 +0000
56+++ oops_datedir_repo/tests/test_serializer_rfc822.py 2011-11-16 03:48:32 +0000
57@@ -384,3 +384,21 @@
58 "name%3Dfoo=hello%0Aworld\n",
59 "\n",
60 ], to_chunks(report))
61+
62+ def test_to_chunks_enhanced_timeline(self):
63+ # New timeline will have 5-tuples with a backtrace. The rfc822 format
64+ # doesn't have anywhere to put this, so its ignored, but the rest is
65+ # saved.
66+ report = {
67+ 'id': 'OOPS-1234',
68+ 'timeline': [
69+ (0, 1, 'foo', 'bar', 'quux'),
70+ ]
71+ }
72+ self.assertEqual([
73+ "Oops-Id: OOPS-1234\n",
74+ "\n",
75+ "00000-00001@foo bar\n",
76+ "\n",
77+ ], to_chunks(report))
78+
79
80=== modified file 'setup.py'
81--- setup.py 2011-11-15 21:47:32 +0000
82+++ setup.py 2011-11-16 03:48:32 +0000
83@@ -22,7 +22,7 @@
84 description = file(os.path.join(os.path.dirname(__file__), 'README'), 'rb').read()
85
86 setup(name="oops_datedir_repo",
87- version="0.0.11",
88+ version="0.0.12",
89 description="OOPS disk serialisation and repository management.",
90 long_description=description,
91 maintainer="Launchpad Developers",

Subscribers

People subscribed via source and target branches

to all changes: