Merge lp:~wgrant/launchpad/bug-911520 into lp:launchpad

Proposed by William Grant on 2012-01-25
Status: Merged
Approved by: William Grant on 2012-01-25
Approved revision: no longer in the source branch.
Merged at revision: 14723
Proposed branch: lp:~wgrant/launchpad/bug-911520
Merge into: lp:launchpad
Diff against target: 122 lines (+12/-12)
4 files modified
lib/lp/registry/model/oopsreferences.py (+1/-1)
lib/lp/registry/tests/test_distribution.py (+1/-1)
lib/lp/registry/tests/test_oopsreferences.py (+9/-9)
lib/lp/registry/tests/test_product.py (+1/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-911520
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code 2012-01-25 Approve on 2012-01-25
Review via email: mp+90040@code.launchpad.net

Commit Message

[r=stevenk][bug=911520] Stop upper()ing OOPS IDs in findReferencedOOPS. python-oops-tools now treats them sensitively.

Description of the Change

14:18:30 < lifeless> wgrant: I'm curious what is mangling the case in the first place; is it just fimble-fingered copy-pastes ?
14:18:37 < wgrant> lifeless: Hmm?
14:18:47 < wgrant> lifeless: Your LP API upper()s them before they're returned.
14:18:59 < lifeless> wgrant: it does? Ok, so I am stupid.
14:19:26 < lifeless> I have -no- idea what I was thinking.
14:19:50 < lifeless> just checking the schema
14:20:04 < wgrant> oops-tools was already upper()ing them in parts.
14:20:26 < StevenK> wgrant: So I guess I write a IBugTag and then a tales adapter?
14:20:45 < lifeless> wgrant: that was eliminated a while ago
14:20:50 < wgrant> StevenK: No. There's no sensible way to do a fmt:url here.
14:21:00 < lifeless> wgrant: it does that on input only, for old-style oopses
14:21:12 < lifeless> wgrant: the db is case sensitive, and indexed case sensitively
14:21:13 < wgrant> lifeless: Ah, right, I remember that now.
14:21:28 < lifeless> wgrant: I'd fix the API TBH
14:21:48 < wgrant> I only didn't fix it because I presumed you had your reasons :)
14:21:58 < wgrant> I'll not land the datedir-repo fix, then.
14:22:04 * lifeless is apparently a camel toenail smoking crackhead
14:22:06 < wgrant> Just cowboy it and prune to get us out of immediate peril..
14:22:17 < wgrant> And fix the API this afternoon :)
14:22:28 < lifeless> which is another way to say I have -no- idea why I did that. Probably to make some test pass or something

To post a comment you must log in.
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 'lib/lp/registry/model/oopsreferences.py'
2--- lib/lp/registry/model/oopsreferences.py 2011-12-30 06:14:56 +0000
3+++ lib/lp/registry/model/oopsreferences.py 2012-01-25 04:14:29 +0000
4@@ -76,6 +76,6 @@
5 cur.execute(query)
6 for content in (row[0] for row in cur.fetchall()):
7 for oops in oops_re.findall(content):
8- referenced_codes.add(oops.upper())
9+ referenced_codes.add(oops)
10
11 return referenced_codes
12
13=== modified file 'lib/lp/registry/tests/test_distribution.py'
14--- lib/lp/registry/tests/test_distribution.py 2011-12-30 06:14:56 +0000
15+++ lib/lp/registry/tests/test_distribution.py 2012-01-25 04:14:29 +0000
16@@ -595,7 +595,7 @@
17 now = datetime.datetime.now(tz=pytz.utc)
18 day = datetime.timedelta(days=1)
19 self.failUnlessEqual(
20- [oopsid.upper()],
21+ [oopsid],
22 ws_distro.findReferencedOOPS(start_date=now - day, end_date=now))
23 self.failUnlessEqual(
24 [],
25
26=== modified file 'lib/lp/registry/tests/test_oopsreferences.py'
27--- lib/lp/registry/tests/test_oopsreferences.py 2012-01-01 02:58:52 +0000
28+++ lib/lp/registry/tests/test_oopsreferences.py 2012-01-25 04:14:29 +0000
29@@ -40,7 +40,7 @@
30 now = datetime.now(tz=utc)
31 day = timedelta(days=1)
32 self.failUnlessEqual(
33- set([oopsid.upper()]),
34+ set([oopsid]),
35 referenced_oops(now - day, now, "product=1", {}))
36 self.failUnlessEqual(
37 set(),
38@@ -54,7 +54,7 @@
39 now = datetime.now(tz=utc)
40 day = timedelta(days=1)
41 self.failUnlessEqual(
42- set([oopsid.upper()]),
43+ set([oopsid]),
44 referenced_oops(now - day, now, "product=1", {}))
45 self.failUnlessEqual(
46 set(),
47@@ -69,7 +69,7 @@
48 now = datetime.now(tz=utc)
49 day = timedelta(days=1)
50 self.failUnlessEqual(
51- set([oopsid.upper()]),
52+ set([oopsid]),
53 referenced_oops(now - day, now, "product=1", {}))
54 self.failUnlessEqual(
55 set(),
56@@ -84,7 +84,7 @@
57 now = datetime.now(tz=utc)
58 day = timedelta(days=1)
59 self.failUnlessEqual(
60- set([oopsid.upper()]),
61+ set([oopsid]),
62 referenced_oops(now - day, now, "product=1", {}))
63 self.failUnlessEqual(
64 set(),
65@@ -97,7 +97,7 @@
66 now = datetime.now(tz=utc)
67 day = timedelta(days=1)
68 self.failUnlessEqual(
69- set([oopsid.upper()]),
70+ set([oopsid]),
71 referenced_oops(now - day, now, "product=%(product)s",
72 {'product': question.product.id}))
73 self.failUnlessEqual(
74@@ -125,7 +125,7 @@
75 now = datetime.now(tz=utc)
76 day = timedelta(days=1)
77 self.failUnlessEqual(
78- set([oopsid.upper()]),
79+ set([oopsid]),
80 referenced_oops(now - day, now, "product=%(product)s",
81 {'product': question.product.id}))
82 self.failUnlessEqual(
83@@ -142,7 +142,7 @@
84 now = datetime.now(tz=utc)
85 day = timedelta(days=1)
86 self.failUnlessEqual(
87- set([oopsid.upper()]),
88+ set([oopsid]),
89 referenced_oops(now - day, now, "product=%(product)s",
90 {'product': question.product.id}))
91 self.failUnlessEqual(
92@@ -160,7 +160,7 @@
93 now = datetime.now(tz=utc)
94 day = timedelta(days=1)
95 self.failUnlessEqual(
96- set([oopsid.upper()]),
97+ set([oopsid]),
98 referenced_oops(now - day, now, "distribution=%(distribution)s",
99 {'distribution': distro.id}))
100 self.failUnlessEqual(
101@@ -183,7 +183,7 @@
102 now = datetime.now(tz=utc)
103 day = timedelta(days=1)
104 self.failUnlessEqual(
105- set([oopsid.upper()]),
106+ set([oopsid]),
107 referenced_oops(now - day, now, "product=1", {}))
108 self.failUnlessEqual(
109 set([]),
110
111=== modified file 'lib/lp/registry/tests/test_product.py'
112--- lib/lp/registry/tests/test_product.py 2012-01-01 02:58:52 +0000
113+++ lib/lp/registry/tests/test_product.py 2012-01-25 04:14:29 +0000
114@@ -488,7 +488,7 @@
115 now = datetime.datetime.now(tz=pytz.utc)
116 day = datetime.timedelta(days=1)
117 self.failUnlessEqual(
118- [oopsid.upper()],
119+ [oopsid],
120 ws_product.findReferencedOOPS(start_date=now - day, end_date=now))
121 self.failUnlessEqual(
122 [],