← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/github-bugtracker-uppercase-in-names into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/github-bugtracker-uppercase-in-names into lp:launchpad.

Commit message:
Convert GitHub repository IDs to lower-case when making bugtracker names for them.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1606197 in Launchpad itself: "GitHub bug tracker skipping capital letters"
  https://bugs.launchpad.net/launchpad/+bug/1606197

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/github-bugtracker-uppercase-in-names/+merge/301053

Convert GitHub repository IDs to lower-case when making bugtracker names for them.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/github-bugtracker-uppercase-in-names into lp:launchpad.
=== modified file 'lib/lp/bugs/model/bugtracker.py'
--- lib/lp/bugs/model/bugtracker.py	2016-07-13 15:01:07 +0000
+++ lib/lp/bugs/model/bugtracker.py	2016-07-25 11:46:39 +0000
@@ -149,9 +149,8 @@
             raise AssertionError(
                 'Not a valid email address: %s' % base_uri.path)
     elif base_uri.host == 'github.com' and base_uri.path.endswith('/issues'):
-        base_name = (
-            'github-' +
-            base_uri.path[:-len('/issues')].lstrip('/').replace('/', '-'))
+        repository_id = base_uri.path[:-len('/issues')].lstrip('/')
+        base_name = 'github-' + repository_id.replace('/', '-').lower()
     else:
         base_name = base_uri.host
 

=== modified file 'lib/lp/bugs/tests/test_bugtracker.py'
--- lib/lp/bugs/tests/test_bugtracker.py	2016-07-13 15:01:07 +0000
+++ lib/lp/bugs/tests/test_bugtracker.py	2016-07-25 11:46:39 +0000
@@ -414,6 +414,9 @@
         self.assertEqual(
             'auto-github-user-repository',
             make_bugtracker_name('https://github.com/user/repository/issues'))
+        self.assertEqual(
+            'auto-github-user-repository',
+            make_bugtracker_name('https://github.com/user/Repository/issues'))
         # Invalid on the GitHub side, but let's make sure these don't blow up.
         self.assertEqual(
             'auto-github-user',


Follow ups