← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~brian-murray/apport/recoverable-problem-issues into lp:apport

 

Brian Murray has proposed merging lp:~brian-murray/apport/recoverable-problem-issues into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)
Related bugs:
  Bug #1316763 in Daisy: "bucketing of recoverable problems is done poorly"
  https://bugs.launchpad.net/daisy/+bug/1316763
  Bug #1319099 in apport (Ubuntu): "whoopsie-upload-all does not upload RecoverableProblem reports"
  https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1319099

For more details, see:
https://code.launchpad.net/~brian-murray/apport/recoverable-problem-issues/+merge/219597

This modifies how a duplicate signature is created for recoverable problems and adds a test for it. It also fixes an issue with whoopsie-upload-all not uploading recoverable problems.
-- 
https://code.launchpad.net/~brian-murray/apport/recoverable-problem-issues/+merge/219597
Your team Apport upstream developers is requested to review the proposed merge of lp:~brian-murray/apport/recoverable-problem-issues into lp:apport.
=== modified file 'NEWS'
--- NEWS	2014-05-12 14:27:33 +0000
+++ NEWS	2014-05-14 21:02:54 +0000
@@ -1,5 +1,5 @@
 This file summarizes the major and interesting changes for each release. For a
-detailled list of changes, please see ChangeLog.
+detailed list of changes, please see ChangeLog.
 
 2.14.3 (UNRELEASED)
 -------------------
@@ -7,6 +7,10 @@
    Murray. (LP: #1316845)
  * Add a duplicate signature to suspend resume failures. Thanks Brian Murray.
    (LP: #1316841)
+ * Use package name in duplicate signature for recoverable problems. Thanks Brian
+   Murray. (LP: #1316763)
+ * Have whoopsie-upload-all upload recoverable problems. Thanks Brian Murray.
+   (LP: #1319099)
 
 2.14.2 (2014-04-30)
 -------------------

=== modified file 'data/recoverable_problem'
--- data/recoverable_problem	2013-07-23 04:58:15 +0000
+++ data/recoverable_problem	2014-05-14 21:02:54 +0000
@@ -56,6 +56,12 @@
     report.add_os_info()
     report.add_user_info()
 
+    ds = report.get('DuplicateSignature', '')
+    package = report.get('Package', '')
+    if package and ds:
+        package = package.split()[0]
+        report['DuplicateSignature'] = '%s:%s' % (package, ds)
+
     # Write the final report
     with open(apport.fileutils.make_report_path(report), 'wb') as fp:
         report.write(fp)

=== modified file 'data/whoopsie-upload-all'
--- data/whoopsie-upload-all	2014-01-09 11:44:29 +0000
+++ data/whoopsie-upload-all	2014-05-14 21:02:54 +0000
@@ -44,7 +44,7 @@
     except Exception as e:
         sys.stderr.write('ERROR: cannot load %s: %s\n' % (report, str(e)))
         return None
-    if r.get('ProblemType', '') != 'Crash' or 'ExecutablePath' not in r:
+    if r.get('ProblemType', '') != 'Crash' and 'ExecutablePath' not in r:
         print('  skipping, not a crash')
         return None
     if 'Dependencies' in r:

=== modified file 'test/test_recoverable_problem.py'
--- test/test_recoverable_problem.py	2012-07-23 05:05:04 +0000
+++ test/test_recoverable_problem.py	2014-05-14 21:02:54 +0000
@@ -58,6 +58,17 @@
             self.assertEqual(report['hello'], 'there')
             self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])
 
+    def test_recoverable_problem_dupe_sig(self):
+        '''recoverable_problem duplicate signature includes package'''
+
+        self.call_recoverable_problem('Package\0test\0DuplicateSignature\0ds')
+        path = self.wait_for_report()
+        with open(path, 'rb') as report_path:
+            report = apport.report.Report()
+            report.load(report_path)
+            self.assertEqual(report['DuplicateSignature'], 'test:ds')
+            self.assertTrue('Pid:\t%d' % os.getpid() in report['ProcStatus'])
+
     def test_invalid_data(self):
         '''recoverable_problem with invalid data'''