← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Deryck Hodge has proposed merging lp:~deryck/launchpad/populate-trac-bug-filing-form-667342 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #667342 Pre-fill bug reports for Trac
  https://bugs.launchpad.net/bugs/667342


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.
-- 
https://code.launchpad.net/~deryck/launchpad/populate-trac-bug-filing-form-667342/+merge/39479
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~deryck/launchpad/populate-trac-bug-filing-form-667342 into lp:launchpad/devel.
=== modified file 'lib/lp/bugs/doc/bugtracker.txt'
--- lib/lp/bugs/doc/bugtracker.txt	2010-10-18 22:24:59 +0000
+++ lib/lp/bugs/doc/bugtracker.txt	2010-10-27 20:35:12 +0000
@@ -448,15 +448,15 @@
     bug_filing_url: http://.../issues/entry?summary=Foo&comment=Bar
     bug_search_url: http://.../issues/list?q=Foo
 
-Trac's bug filing form doesn't accept data in the query string, so we don't
-include it.
+Trac's bug filing form also accepts data in the query string, so we include
+it.
 
     >>> example_trac = factory.makeBugTracker(
     ...     'http://trac.example.com', BugTrackerType.TRAC)
     >>> links = example_trac.getBugFilingAndSearchLinks(
     ...     remote_product='testproduct', summary="Foo", description="Bar")
     >>> print_links(links)
-    bug_filing_url: http://trac.example.com/newticket
+    bug_filing_url: http://trac.example.com/newticket?summary=Foo&description=Bar
     bug_search_url: http://trac.example.com/search?ticket=on&q=Foo
 
     >>> example_roundup = factory.makeBugTracker(

=== modified file 'lib/lp/bugs/model/bugtracker.py'
--- lib/lp/bugs/model/bugtracker.py	2010-10-06 17:09:42 +0000
+++ lib/lp/bugs/model/bugtracker.py	2010-10-27 20:35:12 +0000
@@ -233,7 +233,9 @@
         BugTrackerType.SOURCEFORGE: (
             "%(base_url)s/%(tracker)s/?func=add&"
             "group_id=%(group_id)s&atid=%(at_id)s"),
-        BugTrackerType.TRAC: "%(base_url)s/newticket",
+        BugTrackerType.TRAC: (
+            "%(base_url)s/newticket?summary=%(summary)s&"
+            "description=%(description)s"),
         }
 
     _search_url_patterns = {