Merge lp:~deryck/launchpad/populate-trac-bug-filing-form-667342 into lp:launchpad

Proposed by Deryck Hodge
Status: Merged
Approved by: Paul Hummer
Approved revision: no longer in the source branch.
Merged at revision: 11847
Proposed branch: lp:~deryck/launchpad/populate-trac-bug-filing-form-667342
Merge into: lp:launchpad
Diff against target: 48 lines (+7/-5)
3 files modified
lib/lp/bugs/browser/tests/bugtask-adding-views.txt (+1/-1)
lib/lp/bugs/doc/bugtracker.txt (+3/-3)
lib/lp/bugs/model/bugtracker.py (+3/-1)
To merge this branch: bzr merge lp:~deryck/launchpad/populate-trac-bug-filing-form-667342
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+39479@code.launchpad.net

Commit message

Bug filing form link will now fill in summary and description for Trac external bug trackers.

Description of the change

This is a simple fix to fill in the summary and description for Trac bug trackers when a user clicks the bug filing form link on the "affects another project" page. The doc test was corrected to allow these params and then the filing patterns updated. I confirmed on a trac instance that adding these params to the URL will indeed fill in the form.

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) :
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/browser/tests/bugtask-adding-views.txt'
2--- lib/lp/bugs/browser/tests/bugtask-adding-views.txt 2010-10-18 22:24:59 +0000
3+++ lib/lp/bugs/browser/tests/bugtask-adding-views.txt 2010-11-01 15:01:22 +0000
4@@ -646,5 +646,5 @@
5 >>> product.bugtracker = trac_bugtracker
6
7 >>> print_links(add_task_view.upstream_bugtracker_links)
8- bug_filing_url: http://trac.example.com/newticket
9+ bug_filing_url: http://trac.example.com/newticket?summary=Reflow%20...
10 bug_search_url: http://trac.example.com/search?ticket=on&q=Reflow%20...
11
12=== modified file 'lib/lp/bugs/doc/bugtracker.txt'
13--- lib/lp/bugs/doc/bugtracker.txt 2010-10-18 22:24:59 +0000
14+++ lib/lp/bugs/doc/bugtracker.txt 2010-11-01 15:01:22 +0000
15@@ -448,15 +448,15 @@
16 bug_filing_url: http://.../issues/entry?summary=Foo&comment=Bar
17 bug_search_url: http://.../issues/list?q=Foo
18
19-Trac's bug filing form doesn't accept data in the query string, so we don't
20-include it.
21+Trac's bug filing form also accepts data in the query string, so we include
22+it.
23
24 >>> example_trac = factory.makeBugTracker(
25 ... 'http://trac.example.com', BugTrackerType.TRAC)
26 >>> links = example_trac.getBugFilingAndSearchLinks(
27 ... remote_product='testproduct', summary="Foo", description="Bar")
28 >>> print_links(links)
29- bug_filing_url: http://trac.example.com/newticket
30+ bug_filing_url: http://trac.example.com/newticket?summary=Foo&description=Bar
31 bug_search_url: http://trac.example.com/search?ticket=on&q=Foo
32
33 >>> example_roundup = factory.makeBugTracker(
34
35=== modified file 'lib/lp/bugs/model/bugtracker.py'
36--- lib/lp/bugs/model/bugtracker.py 2010-10-06 17:09:42 +0000
37+++ lib/lp/bugs/model/bugtracker.py 2010-11-01 15:01:22 +0000
38@@ -233,7 +233,9 @@
39 BugTrackerType.SOURCEFORGE: (
40 "%(base_url)s/%(tracker)s/?func=add&"
41 "group_id=%(group_id)s&atid=%(at_id)s"),
42- BugTrackerType.TRAC: "%(base_url)s/newticket",
43+ BugTrackerType.TRAC: (
44+ "%(base_url)s/newticket?summary=%(summary)s&"
45+ "description=%(description)s"),
46 }
47
48 _search_url_patterns = {