← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Robert Collins has proposed merging lp:~lifeless/python-oops-datedir-repo/timeline into lp:python-oops-datedir-repo.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lifeless/python-oops-datedir-repo/timeline/+merge/82344

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.
-- 
https://code.launchpad.net/~lifeless/python-oops-datedir-repo/timeline/+merge/82344
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/python-oops-datedir-repo/timeline into lp:python-oops-datedir-repo.
=== modified file 'NEWS'
--- NEWS	2011-11-15 21:47:32 +0000
+++ NEWS	2011-11-16 03:48:32 +0000
@@ -6,6 +6,9 @@
 NEXT
 ----
 
+0.0.12
+------
+
 * Repository has a simple generic config API. See the set_config and get_config
   methods. (Robert Collins)
 
@@ -17,6 +20,11 @@
   references to keep is supplied. See the prune_unreferenced method.
   (Robert Collins)
 
+* The RFC822 serializer can now handle 5-tuple timelines (which include
+  backtraces on actions) - the backtraces are skipped for backwards
+  compatibility; use a BSON serializer to have the backtraces captured into the
+  serialized report. (Robert Collins)
+
 * There is a new script bin/prune which will prune reports from a repository
   keeping only those referenced in a given Launchpad project or project group.
   This adds a dependency on launchpadlib, which should be pypi installable

=== modified file 'oops_datedir_repo/__init__.py'
--- oops_datedir_repo/__init__.py	2011-11-13 21:03:43 +0000
+++ oops_datedir_repo/__init__.py	2011-11-16 03:48:32 +0000
@@ -25,7 +25,7 @@
 # established at this point, and setup.py will use a version of next-$(revno).
 # If the releaselevel is 'final', then the tarball will be major.minor.micro.
 # Otherwise it is major.minor.micro~$(revno).
-__version__ = (0, 0, 11, 'beta', 0)
+__version__ = (0, 0, 12, 'beta', 0)
 
 __all__ = [
     'DateDirRepo',

=== modified file 'oops_datedir_repo/serializer_rfc822.py'
--- oops_datedir_repo/serializer_rfc822.py	2011-11-11 04:48:09 +0000
+++ oops_datedir_repo/serializer_rfc822.py	2011-11-16 03:48:32 +0000
@@ -206,7 +206,8 @@
                     urllib.quote(_safestr(value), safe_chars)))
         chunks.append('\n')
     if 'timeline' in report:
-        for (start, end, category, statement) in report['timeline']:
+        for row in report['timeline']:
+            (start, end, category, statement) = row[:4]
             chunks.append('%05d-%05d@%s %s\n' % (
                 start, end, _safestr(category),
                 _safestr(_normalise_whitespace(statement))))

=== modified file 'oops_datedir_repo/tests/test_serializer_rfc822.py'
--- oops_datedir_repo/tests/test_serializer_rfc822.py	2011-11-11 04:48:09 +0000
+++ oops_datedir_repo/tests/test_serializer_rfc822.py	2011-11-16 03:48:32 +0000
@@ -384,3 +384,21 @@
             "name%3Dfoo=hello%0Aworld\n",
             "\n",
             ], to_chunks(report))
+
+    def test_to_chunks_enhanced_timeline(self):
+        # New timeline will have 5-tuples with a backtrace. The rfc822 format
+        # doesn't have anywhere to put this, so its ignored, but the rest is
+        # saved.
+        report = {
+            'id': 'OOPS-1234',
+            'timeline': [
+                (0, 1, 'foo', 'bar', 'quux'),
+                ]
+            }
+        self.assertEqual([
+            "Oops-Id: OOPS-1234\n",
+            "\n",
+            "00000-00001@foo bar\n",
+            "\n",
+            ], to_chunks(report))
+

=== modified file 'setup.py'
--- setup.py	2011-11-15 21:47:32 +0000
+++ setup.py	2011-11-16 03:48:32 +0000
@@ -22,7 +22,7 @@
 description = file(os.path.join(os.path.dirname(__file__), 'README'), 'rb').read()
 
 setup(name="oops_datedir_repo",
-      version="0.0.11",
+      version="0.0.12",
       description="OOPS disk serialisation and repository management.",
       long_description=description,
       maintainer="Launchpad Developers",