← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~matsubara/oops-tools/bug-436640-info-flag into lp:~launchpad-pqm/oops-tools/trunk

 

Diogo Matsubara has proposed merging lp:~matsubara/oops-tools/bug-436640-info-flag into lp:~launchpad-pqm/oops-tools/trunk.

    Requested reviews:
    Diogo Matsubara (matsubara)


Adds support for oops-tools to identify informational only OOPSes and move them out of the main exceptions section. (Fix oops-tools part of bug 436640)

To QA this branch, check a oops summary and verify that the recent DisconnectionErrors are not in the Exceptions section. They should be in the User generated errors section. Open one of those OOPSes and check if the informational only flag is rendered in the LHS column.

-- 
https://code.launchpad.net/~matsubara/oops-tools/bug-436640-info-flag/+merge/13287
Your team Launchpad code reviewers is subscribed to branch lp:~launchpad-pqm/oops-tools/trunk.
=== modified file 'oopstools/oops/analyse_error_reports.py'
--- oopstools/oops/analyse_error_reports.py	2009-10-06 14:58:35 +0000
+++ oopstools/oops/analyse_error_reports.py	2009-10-13 16:05:20 +0000
@@ -72,7 +72,7 @@
 
     webapp_prefixes = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "EA",
         "EB", "EC", "ED", "BA", "BB", "BC", "DEMO", "XMLP", "S", "DF",
-        "CEMAIL", "SEMAIL"]
+        "CEMAIL", "SEMAIL", "X"]
     codehosting_prefixes = ["SMS", "SMPM", "SMPU", "SMPI", "SMI", "SMPSSH",
         "CIW", "CID"]
     jobs_prefixes = ["CMP", "MPCJ", "SMPCJ", "BM", "UPD", "UPDS", "SRSBR", 

=== modified file 'oopstools/oops/models.py'
--- oopstools/oops/models.py	2009-10-06 17:35:55 +0000
+++ oopstools/oops/models.py	2009-10-13 16:05:20 +0000
@@ -97,6 +97,7 @@
     referrer = models.URLField(null=True)
     user_agent = models.CharField(max_length=200, null=True)
     most_expensive_statement = models.CharField(max_length=200, null=True)
+    informational = models.NullBooleanField()
 
     @property
     def exception_type(self):
@@ -145,6 +146,7 @@
         self.duration = msg.getheader('duration')
         if self.duration is not None:
             self.duration = float(self.duration)
+        self.informational = msg.getheader('informational', False)
 
         # read request variables
         self.reqvars = []
@@ -221,7 +223,8 @@
                     statements_count=self.statements_count,
                     duration=self.duration, referrer=self.referrer,
                     user_agent=self.user_agent,
-                    most_expensive_statement=self.most_expensive_statement)
+                    most_expensive_statement=self.most_expensive_statement,
+                    informational=self.informational)
                 oops_meta_data.save()
                 return oops_meta_data
         else:
@@ -234,6 +237,7 @@
             oops_meta_data.referrer = self.referrer
             oops_meta_data.user_agent = self.user_agent
             oops_meta_data.most_expensive_statement = self.most_expensive_statement
+            oops_meta_data.informational = self.informational
             oops_meta_data.save()
             return oops_meta_data
 

=== modified file 'oopstools/oops/sections.py'
--- oopstools/oops/sections.py	2009-09-25 21:38:03 +0000
+++ oopstools/oops/sections.py	2009-10-13 16:05:20 +0000
@@ -21,7 +21,7 @@
 class ErrorSummarySection:
     """A section in the error summary."""
 
-    max_count = 10
+    max_count = 15
 
     def __init__(self, title):
         self.oops_groups = {}

=== modified file 'oopstools/oops/summaries.py'
--- oopstools/oops/summaries.py	2009-10-06 17:35:55 +0000
+++ oopstools/oops/summaries.py	2009-10-13 16:05:20 +0000
@@ -172,7 +172,7 @@
                                      'InvalidBatchSizeError',
                                      'UnsupportedFeedFormat',
                                      'UntrustedReturnURL',
-                                     'UserRequestOops']:
+                                     'UserRequestOops'] or oops.informational:
             self.addOopsToSection(oops, section_id='user-generated-errors')
         elif oops.exception_type in ['UnicodeEncodeError', 'TypeError',
                                      'ProgrammingError'] and ('@@' in oops.url

=== modified file 'oopstools/oops/templates/oops.html'
--- oopstools/oops/templates/oops.html	2009-08-03 20:30:49 +0000
+++ oopstools/oops/templates/oops.html	2009-10-13 16:05:20 +0000
@@ -17,6 +17,7 @@
   <div id="oops">
     <li>OOPS: <span py:content="oops.oopsid">OOPS-666AB12</span></li>
     <li>Filename: <span py:content="oops.pathname">/x/srv-launchpad.net-logs/foo/bar</span></li>
+    <li>Informational: <span py:content="oops.informational">False</span></li>
     <li py:if="oops.bug">Bug: <a py:attrs="{'href': 'https://launchpad.net/bugs/%s' % oops.bug}" py:content="oops.bug">#123</a></li>
     <form py:if="not oops.bug" action="meta" method="POST">
       <input type="text" size="8" name="bug_number" />

=== added directory 'oopstools/oops/test/files/oops-sample/development/2009-10-07'
=== added file 'oopstools/oops/test/files/oops-sample/development/2009-10-07/68350.X1'
--- oopstools/oops/test/files/oops-sample/development/2009-10-07/68350.X1	1970-01-01 00:00:00 +0000
+++ oopstools/oops/test/files/oops-sample/development/2009-10-07/68350.X1	2009-10-13 16:05:20 +0000
@@ -0,0 +1,67 @@
+Oops-Id: OOPS-1376X1
+Exception-Type: UserRequestOops
+Exception-Value: 
+Date: 2009-10-07T18:59:10.563701+00:00
+Page-Id: RootObject:index.html
+Branch: bug-436640
+Revision: 9649
+User: unauthenticated, Anonymous, Anonymous, Anonymous User
+URL: https://launchpad.dev/++oops++/index.html
+Duration: 0.0851130485535
+Informational: True
+
+CHANNEL_CREATION_TIME=1254941946.38
+CONNECTION_TYPE=Keep-Alive
+GATEWAY_INTERFACE=CGI/1.1
+HTTPS=on
+HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q%3D0.9,*/*;q%3D0.8
+HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q%3D0.7,*;q%3D0.7
+HTTP_ACCEPT_ENCODING=gzip,deflate
+HTTP_ACCEPT_LANGUAGE=en-us,en;q%3D0.5
+HTTP_HOST=launchpad.dev
+HTTP_USER_AGENT=Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090924 Ubuntu/9.10 (karmic) Firefox/3.5.3
+HTTP_VIA=1.1 launchpad.dev
+HTTP_X_FORWARDED_FOR=127.0.0.88
+HTTP_X_FORWARDED_HOST=launchpad.dev
+HTTP_X_FORWARDED_SERVER=launchpad.dev
+PATH_INFO=/++oops++
+QUERY_STRING=
+REMOTE_ADDR=127.0.0.1
+REQUEST_METHOD=GET
+SCRIPT_NAME=
+SERVER_NAME=tancho
+SERVER_PORT=8086
+SERVER_PROTOCOL=HTTP/1.1
+SERVER_SOFTWARE=zope.server.http (DebugLayerHTTP)
+wsgi.input=%3Chidden%3E
+zc.zservertracelog.interfaces.ITraceLog=%3Chidden%3E
+
+00000-00000@launchpad-main-slave SELECT getlocalnodeid()
+00001-00002@session UPDATE SessionData SET last_accessed = CURRENT_TIMESTAMP WHERE client_id = %s AND last_accessed < CURRENT_TIMESTAMP - '540 seconds'::interval
+00002-00002@session SELECT key, pickle FROM SessionPkgData WHERE client_id = %s AND product_id = %s
+00005-00006@launchpad-main-slave SELECT PillarName.active, PillarName.alias_for, PillarName.distribution, PillarName.id, PillarName.name, PillarName.product, PillarName.project FROM FeaturedProject, PillarName WHERE PillarName.id = FeaturedProject.pillar_name AND (1=1) ORDER BY PillarName.name
+00009-00010@launchpad-main-slave SELECT Product.owner, Product.active, Product.autoupdate, Product.bug_reporting_guidelines, Product.bug_supervisor, Product.bugtracker, Product.datecreated, Product.description, Product.development_focus, Product.displayname, Product.downloadurl, Product.driver, Product.enable_bug_expiration, Product.freshmeatproject, Product.homepage_content, Product.homepageurl, Product.icon, Product.id, Product.lastdoap, Product.license_approved, Product.license_info, Product.reviewed, Product.logo, Product.mugshot, Product.name, Product.official_answers, Product.official_blueprints, Product.official_codehosting, Product.official_malone, Product.official_rosetta, Product.private_bugs, Product.programminglang, Product.project, Product.registrant, Product.remote_product, Product.reviewer_whiteboard, Product.screenshotsurl, Product.security_contact, Product.sourceforgeproject, Product.summary, Product.title, Product.translationgroup, Product.translationpermission, Product.wikiurl FROM Product WHERE Product.id = %s LIMIT 1
+00013-00015@launchpad-main-slave SELECT Product.owner, Product.active, Product.autoupdate, Product.bug_reporting_guidelines, Product.bug_supervisor, Product.bugtracker, Product.datecreated, Product.description, Product.development_focus, Product.displayname, Product.downloadurl, Product.driver, Product.enable_bug_expiration, Product.freshmeatproject, Product.homepage_content, Product.homepageurl, Product.icon, Product.id, Product.lastdoap, Product.license_approved, Product.license_info, Product.reviewed, Product.logo, Product.mugshot, Product.name, Product.official_answers, Product.official_blueprints, Product.official_codehosting, Product.official_malone, Product.official_rosetta, Product.private_bugs, Product.programminglang, Product.project, Product.registrant, Product.remote_product, Product.reviewer_whiteboard, Product.screenshotsurl, Product.security_contact, Product.sourceforgeproject, Product.summary, Product.title, Product.translationgroup, Product.translationpermission, Product.wikiurl FROM Product WHERE Product.id = %s LIMIT 1
+00019-00020@launchpad-main-slave SELECT Product.owner, Product.active, Product.autoupdate, Product.bug_reporting_guidelines, Product.bug_supervisor, Product.bugtracker, Product.datecreated, Product.description, Product.development_focus, Product.displayname, Product.downloadurl, Product.driver, Product.enable_bug_expiration, Product.freshmeatproject, Product.homepage_content, Product.homepageurl, Product.icon, Product.id, Product.lastdoap, Product.license_approved, Product.license_info, Product.reviewed, Product.logo, Product.mugshot, Product.name, Product.official_answers, Product.official_blueprints, Product.official_codehosting, Product.official_malone, Product.official_rosetta, Product.private_bugs, Product.programminglang, Product.project, Product.registrant, Product.remote_product, Product.reviewer_whiteboard, Product.screenshotsurl, Product.security_contact, Product.sourceforgeproject, Product.summary, Product.title, Product.translationgroup, Product.translationpermission, Product.wikiurl FROM Product WHERE Product.id = %s LIMIT 1
+00023-00024@launchpad-main-slave SELECT Distribution.bug_reporting_guidelines, Distribution.bug_supervisor, Distribution.date_created, Distribution.description, Distribution.displayname, Distribution.domainname, Distribution.driver, Distribution.enable_bug_expiration, Distribution.homepage_content, Distribution.icon, Distribution.id, Distribution.language_pack_admin, Distribution.logo, Distribution.lucilleconfig, Distribution.members, Distribution.mirror_admin, Distribution.mugshot, Distribution.name, Distribution.official_answers, Distribution.official_blueprints, Distribution.official_malone, Distribution.official_rosetta, Distribution.owner, Distribution.security_contact, Distribution.summary, Distribution.title, Distribution.translation_focus, Distribution.translationgroup, Distribution.translationpermission FROM Distribution WHERE Distribution.id = %s LIMIT 1
+00026-00027@launchpad-main-slave SELECT Distribution.bug_reporting_guidelines, Distribution.bug_supervisor, Distribution.date_created, Distribution.description, Distribution.displayname, Distribution.domainname, Distribution.driver, Distribution.enable_bug_expiration, Distribution.homepage_content, Distribution.icon, Distribution.id, Distribution.language_pack_admin, Distribution.logo, Distribution.lucilleconfig, Distribution.members, Distribution.mirror_admin, Distribution.mugshot, Distribution.name, Distribution.official_answers, Distribution.official_blueprints, Distribution.official_malone, Distribution.official_rosetta, Distribution.owner, Distribution.security_contact, Distribution.summary, Distribution.title, Distribution.translation_focus, Distribution.translationgroup, Distribution.translationpermission FROM Distribution WHERE Distribution.id = %s LIMIT 1
+00030-00031@launchpad-main-slave SELECT Project.active, Project.bug_reporting_guidelines, Project.bugtracker, Project.datecreated, Project.description, Project.displayname, Project.driver, Project.freshmeatproject, Project.homepage_content, Project.homepageurl, Project.icon, Project.id, Project.lastdoap, Project.logo, Project.mugshot, Project.name, Project.owner, Project.registrant, Project.reviewed, Project.sourceforgeproject, Project.summary, Project.title, Project.translationgroup, Project.translationpermission, Project.wikiurl FROM Project WHERE Project.id = %s LIMIT 1
+00034-00035@launchpad-main-slave SELECT Product.owner, Product.active, Product.autoupdate, Product.bug_reporting_guidelines, Product.bug_supervisor, Product.bugtracker, Product.datecreated, Product.description, Product.development_focus, Product.displayname, Product.downloadurl, Product.driver, Product.enable_bug_expiration, Product.freshmeatproject, Product.homepage_content, Product.homepageurl, Product.icon, Product.id, Product.lastdoap, Product.license_approved, Product.license_info, Product.reviewed, Product.logo, Product.mugshot, Product.name, Product.official_answers, Product.official_blueprints, Product.official_codehosting, Product.official_malone, Product.official_rosetta, Product.private_bugs, Product.programminglang, Product.project, Product.registrant, Product.remote_product, Product.reviewer_whiteboard, Product.screenshotsurl, Product.security_contact, Product.sourceforgeproject, Product.summary, Product.title, Product.translationgroup, Product.translationpermission, Product.wikiurl FROM Product WHERE Product.id = %s LIMIT 1
+00037-00038@launchpad-main-slave SELECT Project.active, Project.bug_reporting_guidelines, Project.bugtracker, Project.datecreated, Project.description, Project.displayname, Project.driver, Project.freshmeatproject, Project.homepage_content, Project.homepageurl, Project.icon, Project.id, Project.lastdoap, Project.logo, Project.mugshot, Project.name, Project.owner, Project.registrant, Project.reviewed, Project.sourceforgeproject, Project.summary, Project.title, Project.translationgroup, Project.translationpermission, Project.wikiurl FROM Project WHERE Project.id = %s LIMIT 1
+00041-00042@launchpad-main-slave SELECT Product.owner, Product.active, Product.autoupdate, Product.bug_reporting_guidelines, Product.bug_supervisor, Product.bugtracker, Product.datecreated, Product.description, Product.development_focus, Product.displayname, Product.downloadurl, Product.driver, Product.enable_bug_expiration, Product.freshmeatproject, Product.homepage_content, Product.homepageurl, Product.icon, Product.id, Product.lastdoap, Product.license_approved, Product.license_info, Product.reviewed, Product.logo, Product.mugshot, Product.name, Product.official_answers, Product.official_blueprints, Product.official_codehosting, Product.official_malone, Product.official_rosetta, Product.private_bugs, Product.programminglang, Product.project, Product.registrant, Product.remote_product, Product.reviewer_whiteboard, Product.screenshotsurl, Product.security_contact, Product.sourceforgeproject, Product.summary, Product.title, Product.translationgroup, Product.translationpermission, Product.wikiurl FROM Product WHERE Product.id = %s LIMIT 1
+00057-00057@session UPDATE SessionData SET last_accessed = CURRENT_TIMESTAMP WHERE client_id = %s AND last_accessed < CURRENT_TIMESTAMP - '540 seconds'::interval
+00057-00058@session SELECT key, pickle FROM SessionPkgData WHERE client_id = %s AND product_id = %s
+00061-00062@launchpad-main-slave SELECT LaunchpadStatistic.dateupdated, LaunchpadStatistic.id, LaunchpadStatistic.name, LaunchpadStatistic."value" FROM LaunchpadStatistic WHERE LaunchpadStatistic.name = %s ORDER BY LaunchpadStatistic.name
+00063-00063@launchpad-main-slave SELECT LaunchpadStatistic.dateupdated, LaunchpadStatistic.id, LaunchpadStatistic.name, LaunchpadStatistic."value" FROM LaunchpadStatistic WHERE LaunchpadStatistic.name = %s ORDER BY LaunchpadStatistic.name
+00064-00065@launchpad-main-slave SELECT COUNT(*) FROM Branch WHERE Branch.private = %s
+00065-00066@launchpad-main-slave SELECT LaunchpadStatistic.dateupdated, LaunchpadStatistic.id, LaunchpadStatistic.name, LaunchpadStatistic."value" FROM LaunchpadStatistic WHERE LaunchpadStatistic.name = %s ORDER BY LaunchpadStatistic.name
+00067-00067@launchpad-main-slave SELECT LaunchpadStatistic.dateupdated, LaunchpadStatistic.id, LaunchpadStatistic.name, LaunchpadStatistic."value" FROM LaunchpadStatistic WHERE LaunchpadStatistic.name = %s ORDER BY LaunchpadStatistic.name
+00068-00068@launchpad-main-slave SELECT COUNT(*) FROM Specification WHERE (Specification.product IS NULL OR Specification.product NOT IN (SELECT Product.id FROM Product WHERE Product.active IS FALSE))
+00071-00071@launchpad-main-slave SELECT ProductLicense.id, ProductLicense.license, ProductLicense.product FROM ProductLicense WHERE ProductLicense.product = %s ORDER BY ProductLicense.license
+00073-00074@launchpad-main-slave SELECT ProductLicense.id, ProductLicense.license, ProductLicense.product FROM ProductLicense WHERE ProductLicense.product = %s ORDER BY ProductLicense.license
+00076-00077@launchpad-main-slave SELECT ProductLicense.id, ProductLicense.license, ProductLicense.product FROM ProductLicense WHERE ProductLicense.product = %s ORDER BY ProductLicense.license
+00079-00079@launchpad-main-slave SELECT ProductLicense.id, ProductLicense.license, ProductLicense.product FROM ProductLicense WHERE ProductLicense.product = %s ORDER BY ProductLicense.license
+00081-00081@launchpad-main-slave SELECT LaunchpadStatistic.dateupdated, LaunchpadStatistic.id, LaunchpadStatistic.name, LaunchpadStatistic."value" FROM LaunchpadStatistic WHERE LaunchpadStatistic.name = %s ORDER BY LaunchpadStatistic.name
+
+Traceback (most recent call last):
+UserRequestOops

=== added directory 'oopstools/oops/test/files/oops-sample/production/gandwana/2009-10-11'
=== added file 'oopstools/oops/test/files/oops-sample/production/gandwana/2009-10-11/03074.I16'
--- oopstools/oops/test/files/oops-sample/production/gandwana/2009-10-11/03074.I16	1970-01-01 00:00:00 +0000
+++ oopstools/oops/test/files/oops-sample/production/gandwana/2009-10-11/03074.I16	2009-10-13 16:05:20 +0000
@@ -0,0 +1,84 @@
+Oops-Id: OOPS-1380I16
+Exception-Type: DisconnectionError
+Exception-Value: terminating connection due to administrator command server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
+Date: 2009-10-11T00:51:14.860743+00:00
+Page-Id: 
+Branch: launchpad-rev-8530
+Revision: 8530
+User: None
+URL: https://login.launchpad.net
+Duration: 0.0065450668335
+Informational: True
+
+CHANNEL_CREATION_TIME=1255222274.85
+CONTENT_LENGTH=722
+CONTENT_TYPE=multipart/form-data; boundary%3D---------------------------20185609861777389445597214565
+GATEWAY_INTERFACE=CGI/1.1
+HTTPS=on
+HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q%3D0.9,*/*;q%3D0.8
+HTTP_ACCEPT_CHARSET=UTF-8,*
+HTTP_ACCEPT_ENCODING=gzip,deflate
+HTTP_ACCEPT_LANGUAGE=ro-ro,ro;q%3D0.8,en-us;q%3D0.6,en-gb;q%3D0.4,en;q%3D0.2
+HTTP_COOKIE=%3Chidden%3E
+HTTP_HOST=login.launchpad.net
+HTTP_REFERER=https://login.launchpad.net/token/ZXxDGLRmGp9Qn5plHZgG/+newaccount
+HTTP_USER_AGENT=Mozilla/5.0 (X11; U; Linux i686; ro; rv:1.9.1.3) Gecko/20090924 Ubuntu/9.10 (karmic) Firefox/3.5.3
+HTTP_VIA=1.1 login.launchpad.net
+HTTP_X_FORWARDED_FOR=89.47.107.176
+HTTP_X_FORWARDED_HOST=login.launchpad.net
+HTTP_X_FORWARDED_SERVER=login.launchpad.net
+PATH_INFO=/token/ZXxDGLRmGp9Qn5plHZgG/+newaccount
+QUERY_STRING=
+REMOTE_ADDR=91.189.90.211
+REQUEST_METHOD=POST
+SCRIPT_NAME=
+SERVER_NAME=gandwana
+SERVER_PORT=9039
+SERVER_PROTOCOL=HTTP/1.0
+SERVER_SOFTWARE=zope.server.http (HTTP)
+field.actions.continue=Continue
+field.displayname=cristi76
+field.hide_email_addresses.used=
+field.password=%3Chidden%3E
+field.password_dupe=%3Chidden%3E
+lp=%3Chidden%3E
+openid_referer=%3Chidden%3E
+wsgi.input=%3Chidden%3E
+zc.zservertracelog.interfaces.ITraceLog=%3Chidden%3E
+
+00001-00002@session UPDATE SessionData SET last_accessed = CURRENT_TIMESTAMP WHERE client_id = %s AND last_accessed < CURRENT_TIMESTAMP - '540 seconds'::interval
+00002-00002@session SELECT key, pickle FROM SessionPkgData WHERE client_id = %s AND product_id = %s
+00003-00004@sso-auth-master SELECT Account.creation_rationale, Account.date_created, Account.date_status_set, Account.displayname, Account.id, Account.openid_identifier, Account.status, Account.status_comment FROM Account WHERE Account.id = %s LIMIT 1
+
+Traceback (most recent call last):
+  Module zope.publisher.publish, line 127, in publish
+    publication.beforeTraversal(request)
+  Module canonical.launchpad.webapp.publication, line 181, in beforeTraversal
+    principal = self.getPrincipal(request)
+  Module canonical.launchpad.webapp.servers, line 1073, in getPrincipal
+    principal = auth_utility.authenticate(request)
+  Module canonical.launchpad.webapp.authentication, line 125, in authenticate
+    return self._authenticateUsingCookieAuth(request)
+  Module canonical.launchpad.webapp.authentication, line 88, in _authenticateUsingCookieAuth
+    principal = login_src.getPrincipal(id)
+  Module canonical.launchpad.webapp.authentication, line 222, in getPrincipal
+    account = getUtility(IAccountSet).get(id)
+  Module canonical.launchpad.database.account, line 240, in get
+    account = IStore(Account).get(Account, id)
+  Module storm.store, line 179, in get
+    result = self._connection.execute(select)
+  Module storm.databases.postgres, line 249, in execute
+    return Connection.execute(self, statement, params, noresult)
+  Module storm.database, line 217, in execute
+    raw_cursor = self.raw_execute(statement, params)
+  Module storm.databases.postgres, line 259, in raw_execute
+    return Connection.raw_execute(self, statement, params)
+  Module storm.database, line 299, in raw_execute
+    self._check_disconnect(raw_cursor.execute, *args)
+  Module storm.database, line 347, in _check_disconnect
+    raise DisconnectionError(str(exc))
+DisconnectionError: terminating connection due to administrator command
+server closed the connection unexpectedly
+	This probably means the server terminated abnormally
+	before or while processing the request.
+

=== modified file 'oopstools/oops/test/test_oopsreport.txt'
--- oopstools/oops/test/test_oopsreport.txt	2009-09-25 21:39:43 +0000
+++ oopstools/oops/test/test_oopsreport.txt	2009-10-13 16:05:20 +0000
@@ -1,9 +1,3 @@
-= oopsreport.py =
-
-oopsreport.py is the library responsible for finding and parsing OOPS files.
-The code is shared between the analyse_error_reports.py script and the
-oops.cgi script.
-
 == OopsReport ==
 
 Let's get a store first, in order to pull out some oopses:
@@ -91,6 +85,15 @@
     >>> print oops.duration
     0.0894320011139
 
+Flag that indicates if an oops is informational only or not.
+
+    >>> print oops.informational
+    False
+
+    >>> info_oops = store.find_oops('OOPS-1376X1')
+    >>> print info_oops.informational
+    True
+
 The http method that generated the error.
 
     >>> print oops.http_method

=== modified file 'oopstools/oops/test/test_summary.txt'
--- oopstools/oops/test/test_summary.txt	2009-09-02 16:37:45 +0000
+++ oopstools/oops/test/test_summary.txt	2009-10-13 16:05:20 +0000
@@ -89,9 +89,9 @@
 And now with all the parameters given correctly, generate a summary:
 
     >>> prefixes = ["A", "B", "C", "D", "E", "F", "G",
-    ...     "H", "XMLP", "S", "EA", "EB", "EC"]
+    ...     "H", "I", "J", "XMLP", "S", "EA", "EB", "EC", "X"]
     >>> webapp_summary = generate_summary(
-    ...     prefixes, from_date="2007-02-22", to_date="2009-08-04")
+    ...     prefixes, from_date="2007-02-22", to_date="2009-10-12")
 
 
 Let's define a helper function..
@@ -99,6 +99,8 @@
     >>> def get_section_contents(title, text):
     ...     pattern = "=== %s ===" % title
     ...     pos = text.find(pattern)
+    ...     if pos < 0:
+    ...         return "Pattern: '%s' not found" % pattern
     ...     return text[pos+len(pattern):].split("===")[0].strip()
 
 ..and print out the contents of a few of our sections:
@@ -106,15 +108,15 @@
     >>> print get_section_contents("Statistics", webapp_summary)
      * Log starts: ...
      * Analyzed period: ...
-     * Total OOPSes: 30
+     * Total OOPSes: 33
      * Average OOPSes per day: ...
     <BLANKLINE>
      * 2 Exceptions
      * 5 Time Outs
      * 8 Soft Time Outs
-     * 9 User Generated Errors
+     * 11 User Generated Errors
      * 1 Unauthorized Errors
-     * 5 Pages Not Found
+     * 6 Pages Not Found
 
     >>> print get_section_contents("Top 10 Durations", webapp_summary)
     73.25s  OOPS-689S1      https://staging.launchpad.net/favicon.ico
@@ -218,6 +220,11 @@
            1 https://code.../launchpad/++oops+++/+code-index (Product:+code-index)
             OOPS-1311EC295
     <BLANKLINE>
+       1 UserRequestOops:
+        GET: 1  Robots: 0  Local: 0
+           1 https://launchpad.dev/++oops++/index.html (RootObject:index.html)
+            OOPS-1376X1
+    <BLANKLINE>
        1 UntrustedReturnURL: ...
         POST: 1  Robots: 0  Local: 0
            1 https://login.launchpad.net/+openid (OpenIDApplication:+openid)
@@ -258,6 +265,10 @@
            1 https://edge.launchpad.net/projects/+all (ProductSet:+all)
             OOPS-863EA56
     <BLANKLINE>
+       1 DisconnectionError: terminating connection due to administrator...
+        POST: 1  Robots: 0  Local: 1
+            1 https://login.launchpad.net (Unknown)
+             OOPS-1380I16
     <BLANKLINE>
 
     >>> print get_section_contents("All Unauthorized Errors", webapp_summary)
@@ -286,6 +297,11 @@
     <BLANKLINE>
        1 NotFound: Object: ...
         GET: 1  Robots: 0  Local: 0
+           1 https://launchpad.dev/foobar (Unknown)
+            OOPS-1308X1
+    <BLANKLINE>
+       1 NotFound: Object: ...
+        GET: 1  Robots: 0  Local: 0
            1 https://staging.launchpad.net/chuck-audio (Unknown)
             OOPS-689S2
 
@@ -299,7 +315,7 @@
     >>> file, filename = tempfile.mkstemp()
 
     >>> output = generate_summary(
-    ...     prefixes, from_date="2007-02-22", to_date="2009-08-04",
+    ...     prefixes, from_date="2007-02-22", to_date="2009-10-12",
     ...     html_filename=filename)
 
     >>> html_summary = open(filename).read()
@@ -312,7 +328,7 @@
     >>> print extract_text(soup.find('ul', {'id':'period'}))
     Log starts: ...
     Analyzed period: ... days
-    Total exceptions: 30
+    Total exceptions: 33
     Average exceptions per day: ...
 
     >>> print extract_text(soup.find('ul', {'id':'stats'}))
@@ -322,9 +338,9 @@
     2 Exceptions
     5 Time Outs
     8 Soft Time Outs
-    9 User Generated Errors
+    11 User Generated Errors
     1 Unauthorized Errors
-    5 Pages Not Found
+    6 Pages Not Found
 
     >>> statement_counts = soup.find('div', {'id':'statement-counts'})
     >>> print extract_text(statement_counts)
@@ -439,6 +455,10 @@
     GET: 1  Robots: 0  Local: 0
     1 https://code.../launchpad/++oops+++/+code-index (Product:+code-index)
     OOPS-1311EC295
+    1 UserRequestOops:
+    GET: 1  Robots: 0  Local: 0
+    1 https://launchpad.dev/++oops++/index.html (RootObject:index.html)
+    OOPS-1376X1
     1 UntrustedReturnURL: ...
     POST: 1  Robots: 0  Local: 0
     1 https://login.launchpad.net/+openid (OpenIDApplication:+openid)
@@ -471,6 +491,10 @@
     GET: 1  Robots: 0  Local: 0
     1 https://edge.launchpad.net/projects/+all (ProductSet:+all)
     OOPS-863EA56
+    1 DisconnectionError: terminating connection due to administrator...
+    POST: 1  Robots: 0  Local: 1
+    1 https://login.launchpad.net (Unknown)
+    OOPS-1380I16
 
     >>> print extract_text(soup.find('div', {'id':'unauthorized-errors'}))
     All Unauthorized Errors
@@ -495,6 +519,10 @@
     OOPS-680EB1
     1 NotFound: Object: ...
     GET: 1  Robots: 0  Local: 0
+    1 https://launchpad.dev/foobar (Unknown)
+    OOPS-1308X1
+    1 NotFound: Object: ...
+    GET: 1  Robots: 0  Local: 0
     1 https://staging.launchpad.net/chuck-audio (Unknown)
     OOPS-689S2
 

=== modified file 'update_db.py'
--- update_db.py	2009-09-25 21:41:18 +0000
+++ update_db.py	2009-10-13 16:05:20 +0000
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 
-# This script updates the DB data when the OopsMetaData model changes.
-# XXX matsubara: need to check the old schema and alter it with the new schema
+# This script reloads the DB data when the OopsMetaData model changes.
+# XXX matsubara: Need to check the old schema and alter it with the new schema
+#                in the future this will be handled using South
 # ALTER TABLE oops_oopsmetadata ADD COLUMN url VARCHAR(200);
 # ALTER TABLE oops_oopsmetadata ADD COLUMN http_method VARCHAR(10);
 # ALTER TABLE oops_oopsmetadata ADD COLUMN statements_count INTEGER UNSIGNED;