Aklapper has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59862


Change subject: Add support for Wikimedia Mingle URLs to Bugzilla's 'See Also' 
field.
......................................................................

Add support for Wikimedia Mingle URLs to Bugzilla's 'See Also' field.

bug: 45741
Change-Id: I7e86758b7de8984989621f9e9249c5ee98ddbc95
---
M bugzilla-4.2/Bugzilla/BugUrl.pm
A bugzilla-4.2/Bugzilla/BugUrl/Mingle.pm
M bugzilla-4.2/template/en/custom/global/user-error.html.tmpl
3 files changed, 47 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications 
refs/changes/62/59862/1

diff --git a/bugzilla-4.2/Bugzilla/BugUrl.pm b/bugzilla-4.2/Bugzilla/BugUrl.pm
index 7846009..05926fc 100644
--- a/bugzilla-4.2/Bugzilla/BugUrl.pm
+++ b/bugzilla-4.2/Bugzilla/BugUrl.pm
@@ -70,6 +70,7 @@
     Bugzilla::BugUrl::MantisBT
     Bugzilla::BugUrl::SourceForge
     Bugzilla::BugUrl::GitHub
+    Bugzilla::BugUrl::Mingle
 );
 
 ###############################
diff --git a/bugzilla-4.2/Bugzilla/BugUrl/Mingle.pm 
b/bugzilla-4.2/Bugzilla/BugUrl/Mingle.pm
new file mode 100644
index 0000000..641a824
--- /dev/null
+++ b/bugzilla-4.2/Bugzilla/BugUrl/Mingle.pm
@@ -0,0 +1,45 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# Contributor(s): Andre Klapper <[email protected]>
+
+package Bugzilla::BugUrl::Mingle;
+use strict;
+use base qw(Bugzilla::BugUrl);
+
+use Bugzilla::Error;
+use Bugzilla::Util;
+
+###############################
+####        Methods        ####
+###############################
+
+sub should_handle {
+    my ($class, $uri) = @_;
+    # Mingle URLs have this form:
+    #   https://mingle.corp.wikimedia.org/projects/*/cards/1234
+    return (lc($uri->authority) eq 'mingle.corp.wikimedia.org'
+           and $uri->path =~ m|^/projects/[0-9a-zA-Z_]+/cards/\d+$|) ? 1 : 0;
+}
+
+sub _check_value {
+    my $class = shift;
+
+    my $uri = $class->SUPER::_check_value(@_);
+    # Always make the link https:
+    $uri->scheme('https');
+    return $uri;
+}
+
+1;
diff --git a/bugzilla-4.2/template/en/custom/global/user-error.html.tmpl 
b/bugzilla-4.2/template/en/custom/global/user-error.html.tmpl
index fa605b9..8f1771a 100644
--- a/bugzilla-4.2/template/en/custom/global/user-error.html.tmpl
+++ b/bugzilla-4.2/template/en/custom/global/user-error.html.tmpl
@@ -271,6 +271,7 @@
         <li>A b[% %]ug in a MantisBT installation.</li>
         <li>A b[% %]ug on sourceforge.net.</li>
         <li>An issue on github.com.</li>
+        <li>A ticket in Wikimedia's Mingle installation.</li>
       </ul>
     [% ELSIF reason == 'id' %]
       There is no valid [% terms.bug %] id in that URL.

-- 
To view, visit https://gerrit.wikimedia.org/r/59862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e86758b7de8984989621f9e9249c5ee98ddbc95
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Aklapper <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to