← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~lifeless/launchpad/bug-885303 into lp:launchpad

 

Robert Collins has proposed merging lp:~lifeless/launchpad/bug-885303 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #885303 in Launchpad itself: "OOPS linkification is broken with the new long IDs"
  https://bugs.launchpad.net/launchpad/+bug/885303

For more details, see:
https://code.launchpad.net/~lifeless/launchpad/bug-885303/+merge/81106

New oopses look different but should still linkify.
-- 
https://code.launchpad.net/~lifeless/launchpad/bug-885303/+merge/81106
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/launchpad/bug-885303 into lp:launchpad.
=== modified file 'lib/lp/app/browser/stringformatter.py'
--- lib/lp/app/browser/stringformatter.py	2011-08-28 07:29:11 +0000
+++ lib/lp/app/browser/stringformatter.py	2011-11-03 03:00:46 +0000
@@ -395,7 +395,7 @@
                 return text
 
             root_url = config.launchpad.oops_root_url
-            url = root_url + match.group('oopscode')
+            url = root_url + "OOPS-" + match.group('oopscode')
             return '<a href="%s">%s</a>' % (url, text)
         elif match.group('lpbranchurl') is not None:
             lp_url = match.group('lpbranchurl')
@@ -561,7 +561,7 @@
       ) |
       (?P<oops>
         \boops\s*-?\s*
-        (?P<oopscode> \d* [a-z]+ \d+)
+        (?P<oopscode> \w+)
       ) |
       (?P<lpbranchurl>
         \blp:(?:///|/)?

=== modified file 'lib/lp/app/doc/displaying-paragraphs-of-text.txt'
--- lib/lp/app/doc/displaying-paragraphs-of-text.txt	2011-08-23 01:12:28 +0000
+++ lib/lp/app/doc/displaying-paragraphs-of-text.txt	2011-11-03 03:00:46 +0000
@@ -421,25 +421,33 @@
     True
 
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=38C23";>OOPS 38C23</a></p>
+    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-38C23";>OOPS 38C23</a></p>
 
 OOPS references can take a number of forms:
 
     >>> text = 'oops 38C23'
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=38C23";>oops 38C23</a></p>
+    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-38C23";>oops 38C23</a></p>
 
     >>> text = 'OOPS-38C23'
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=38C23";>OOPS-38C23</a></p>
+    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-38C23";>OOPS-38C23</a></p>
 
     >>> text = 'OOPS C3'
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=C3";>OOPS C3</a></p>
+    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-C3";>OOPS C3</a></p>
 
     >>> text = 'OOPS   38C23'
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=38C23";>OOPS   38C23</a></p>
+    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-38C23";>OOPS   38C23</a></p>
+
+    >>> text = 'OOPS-123abcdef'
+    >>> print test_tales('foo/fmt:text-to-html', foo=text)
+    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-123abcdef";>OOPS-123abcdef</a></p>
+
+    >>> text = 'OOPS-abcdef123'
+    >>> print test_tales('foo/fmt:text-to-html', foo=text)
+    <p><a href="https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-abcdef123";>OOPS-abcdef123</a></p>
 
 If the configuration value doesn't end with a slash, we won't add one. This
 lets us configure the URL to use query parameters.
@@ -452,15 +460,9 @@
     >>> config.push('oops_root_url', oops_root_url)
     >>> text = 'OOPS 38C23'
     >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p><a href="http://foo/bar38C23";>OOPS 38C23</a></p>
+    <p><a href="http://foo/barOOPS-38C23";>OOPS 38C23</a></p>
     >>> config_data = config.pop('oops_root_url')
 
-Check against false positives:
-
-    >>> text = 'OOPS code'
-    >>> print test_tales('foo/fmt:text-to-html', foo=text)
-    <p>OOPS code</p>
-
 Reset login information.
 
     >>> login('test@xxxxxxxxxxxxx')