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

Proposed by William Grant
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 12613
Proposed branch: lp:~wgrant/launchpad/bug-280068
Merge into: lp:launchpad
Diff against target: 74 lines (+18/-3)
4 files modified
lib/lp/bugs/doc/externalbugtracker-rt.txt (+10/-0)
lib/lp/bugs/externalbugtracker/rt.py (+6/-3)
lib/lp/services/database/bulk.py (+1/-0)
lib/lp/services/features/rulesource.py (+1/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-280068
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+53724@code.launchpad.net

Commit message

[r=lifeless][bug=280068][no-qa] Fix RequestTracker.convertRemoteImportance to return a BugTaskImportance.

Description of the change

ExternalBugTracker.convertRemoteImportance is meant to return a BugTaskImportance, but RequestTracker's implementation returns a string instead. This results in update failures like OOPS-1011CCW2811. This branch fixes it to return BugTaskImportance.UNKNOWN.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/doc/externalbugtracker-rt.txt'
2--- lib/lp/bugs/doc/externalbugtracker-rt.txt 2010-10-18 22:24:59 +0000
3+++ lib/lp/bugs/doc/externalbugtracker-rt.txt 2011-03-17 01:33:32 +0000
4@@ -88,6 +88,16 @@
5 UnknownRemoteStatusError: spam
6
7
8+== Importance Conversion ==
9+
10+There is no obvious mapping from ticket priorities to importances. They
11+are all imported as Unknown. No exception is raised, because they are
12+all unknown.
13+
14+ >>> rt.convertRemoteImportance('foo').title
15+ 'Unknown'
16+
17+
18 == Initialisation ==
19
20 Calling initializeRemoteBugDB() on our RequestTracker instance and
21
22=== modified file 'lib/lp/bugs/externalbugtracker/rt.py'
23--- lib/lp/bugs/externalbugtracker/rt.py 2011-03-11 03:19:07 +0000
24+++ lib/lp/bugs/externalbugtracker/rt.py 2011-03-17 01:33:32 +0000
25@@ -20,7 +20,10 @@
26 LookupTree,
27 UnknownRemoteStatusError,
28 )
29-from lp.bugs.interfaces.bugtask import BugTaskStatus
30+from lp.bugs.interfaces.bugtask import (
31+ BugTaskImportance,
32+ BugTaskStatus,
33+ )
34 from lp.bugs.interfaces.externalbugtracker import UNKNOWN_REMOTE_IMPORTANCE
35 from lp.services.database.isolation import ensure_no_transaction
36 from lp.services.propertycache import cachedproperty
37@@ -198,11 +201,11 @@
38
39 def getRemoteImportance(self, bug_id):
40 """See `IExternalBugTracker`."""
41- pass
42+ return UNKNOWN_REMOTE_IMPORTANCE
43
44 def convertRemoteImportance(self, remote_importance):
45 """See `IExternalBugTracker`."""
46- return UNKNOWN_REMOTE_IMPORTANCE
47+ return BugTaskImportance.UNKNOWN
48
49 _status_lookup_titles = 'RT status',
50 _status_lookup = LookupTree(
51
52=== modified file 'lib/lp/services/database/bulk.py'
53--- lib/lp/services/database/bulk.py 2011-03-16 10:54:07 +0000
54+++ lib/lp/services/database/bulk.py 2011-03-17 01:33:32 +0000
55@@ -5,6 +5,7 @@
56
57 __metaclass__ = type
58 __all__ = [
59+ 'load',
60 'reload',
61 ]
62
63
64=== modified file 'lib/lp/services/features/rulesource.py'
65--- lib/lp/services/features/rulesource.py 2011-03-16 06:17:35 +0000
66+++ lib/lp/services/features/rulesource.py 2011-03-17 01:33:32 +0000
67@@ -4,6 +4,7 @@
68 """Returns rules defining which features are active"""
69
70 __all__ = [
71+ 'DuplicatePriorityError',
72 'FeatureRuleSource',
73 'NullFeatureRuleSource',
74 'StormFeatureRuleSource',