← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~bryce/launchpad/component-bug-filing-links into lp:launchpad

 

Bryce Harrington has proposed merging lp:~bryce/launchpad/component-bug-filing-links into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~bryce/launchpad/component-bug-filing-links/+merge/67784

This adds an optional remote_component to getBugFilingAndSearchLinks()

Preliminary implementation of support for including bugtracker components in bug filing links. Nothing actually uses its value just yet.


-- 
https://code.launchpad.net/~bryce/launchpad/component-bug-filing-links/+merge/67784
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~bryce/launchpad/component-bug-filing-links into lp:launchpad.
=== modified file 'lib/lp/bugs/interfaces/bugtracker.py'
--- lib/lp/bugs/interfaces/bugtracker.py	2011-06-11 05:04:04 +0000
+++ lib/lp/bugs/interfaces/bugtracker.py	2011-07-13 03:17:26 +0000
@@ -308,7 +308,7 @@
         "The set of bug watches that need updating.")
 
     def getBugFilingAndSearchLinks(remote_product, summary=None,
-                                   description=None):
+                                   description=None, remote_component=None):
         """Return the bug filing and search links for the tracker.
 
         :param remote_product: The name of the product on which the bug
@@ -317,6 +317,8 @@
             field of the upstream bug tracker's search and bug filing forms.
         :param description: The string with which to pre-filly the description
             field of the upstream bug tracker's bug filing form.
+        :param remote_component: The name of the component on which the bug
+            is to be filed or search for.
         :return: A dict of the absolute URL of the bug filing form and
             the search form for `remote_product` on the remote tracker,
             in the form {'bug_filing_url': foo, 'search_url': bar}. If

=== modified file 'lib/lp/bugs/model/bugtracker.py'
--- lib/lp/bugs/model/bugtracker.py	2011-06-15 02:36:35 +0000
+++ lib/lp/bugs/model/bugtracker.py	2011-07-13 03:17:26 +0000
@@ -411,7 +411,7 @@
             return False
 
     def getBugFilingAndSearchLinks(self, remote_product, summary=None,
-                                   description=None):
+                                   description=None, remote_component=None):
         """See `IBugTracker`."""
         bugtracker_urls = {'bug_filing_url': None, 'bug_search_url': None}
 
@@ -425,6 +425,10 @@
             # quote() doesn't blow up later on.
             remote_product = ''
 
+        if remote_component is None:
+            # Ditto for remote component.
+            remote_component = ''
+
         if self in self._custom_filing_url_patterns:
             # Some bugtrackers are customised to accept different
             # querystring parameters from the default. We special-case
@@ -487,6 +491,7 @@
             url_components = {
                 'base_url': base_url,
                 'remote_product': quote(remote_product),
+                'remote_component': quote(remote_component),
                 'summary': quote(summary),
                 'description': quote(description),
                 }


Follow ups