http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84488

Revision: 84488
Author:   pdhanda
Date:     2011-03-21 21:24:25 +0000 (Mon, 21 Mar 2011)
Log Message:
-----------
Moved reporting stuff into WeeklyReporting. Added a Wikimedia extension that 
does only bug comment formatting for now.

Added Paths:
-----------
    trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/
    trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Config.pm
    trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Extension.pm
    trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/README.txt
    trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/lib/
    trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/sendReports.pl
    trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/template/
    trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/
    trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Config.pm
    trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Extension.pm

Removed Paths:
-------------
    trunk/tools/bugzilla/bugzilla-4.0/extensions/Config.pm
    trunk/tools/bugzilla/bugzilla-4.0/extensions/Extension.pm
    trunk/tools/bugzilla/bugzilla-4.0/extensions/README.txt
    trunk/tools/bugzilla/bugzilla-4.0/extensions/lib/
    trunk/tools/bugzilla/bugzilla-4.0/extensions/sendReports.pl
    trunk/tools/bugzilla/bugzilla-4.0/extensions/template/

Deleted: trunk/tools/bugzilla/bugzilla-4.0/extensions/Config.pm
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/Config.pm      2011-03-21 
21:22:39 UTC (rev 84487)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/Config.pm      2011-03-21 
21:24:25 UTC (rev 84488)
@@ -1,45 +0,0 @@
-# -*- 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 WeeklyReporting Bugzilla Extension.
-#
-# The Initial Developer of the Original Code is Chad Horohoe
-# Portions created by the Initial Developer are Copyright (C) 2010 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Chad Horohoe <[email protected]>
-
-package Bugzilla::Extension::WeeklyReporting;
-use strict;
-
-use constant NAME => 'WeeklyReporting';
-
-use constant REQUIRED_MODULES => [
-    {
-        package => 'DateTime',
-        module  => 'DateTime',
-    },
-    {
-        package => 'Getopt-Long',
-        module  => 'Getopt::Long',
-    },
-    {
-        package => 'Pod-Usage',
-        module  => 'Pod::Usage',
-    }
-];
-
-use constant OPTIONAL_MODULES => [
-];
-
-__PACKAGE__->NAME;

Deleted: trunk/tools/bugzilla/bugzilla-4.0/extensions/Extension.pm
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/Extension.pm   2011-03-21 
21:22:39 UTC (rev 84487)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/Extension.pm   2011-03-21 
21:24:25 UTC (rev 84488)
@@ -1,45 +0,0 @@
-# -*- 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 WeeklyReporting Bugzilla Extension.
-#
-# The Initial Developer of the Original Code is Chad Horohoe
-# Portions created by the Initial Developer are Copyright (C) 2010 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Chad Horohoe <[email protected]>
-
-package Bugzilla::Extension::WeeklyReporting;
-use strict;
-use base qw(Bugzilla::Extension);
-
-our $VERSION = '0.1';
-
-sub config_add_panels {
-       my ($self, $args) = @_;
-       my $modules = $args->{'panel_modules'};
-       $modules->{'WeeklyReporting'} = 
'Bugzilla::Extension::WeeklyReporting::Params';
-}
-
-# List of reports used below
-use Bugzilla::Extension::WeeklyReporting::WeekAtAGlance;
-
-# When adding a report module above, be sure to push it into the array below
-sub get_report_list {
-       my( $self, $begin, $end ) = @_;
-       my @reportList;
-#      push @reportList, new 
Bugzilla::Extension::WeeklyReporting::WeekAtAGlance( $begin, $end );
-       return @reportList;
-}
-
-__PACKAGE__->NAME;

Deleted: trunk/tools/bugzilla/bugzilla-4.0/extensions/README.txt
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/README.txt     2011-03-21 
21:22:39 UTC (rev 84487)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/README.txt     2011-03-21 
21:24:25 UTC (rev 84488)
@@ -1,44 +0,0 @@
-
-  WeeklyReporting, version 0.1
-
-  This Bugzilla extension provides a functionality to send weekly
-  reports to user(s) regarding the week's bug activity
-
-
-  WHAT YOU GET
-
-  After you set up everything as described below, you'll send weekly
-  status reports to the e-mail addresses specified.
-
-
-  OVERVIEW
-
-  This extension was created to replace the ad-hoc script used by
-  Wikimedia to generate weekly Bugzilla reports. Right now, the
-  original report is the only one. However, there could be more,
-  in theory.
-
-
-  INSTALLATION
-
-  Configuration of WeeklyReporting
-
-  - just store the module in the extension folder of your 3.6
-    Bugzilla installation. It will be activated automatically
-    and requires no further configuraiton.
-
-  Configuration of Bugzilla
-
-  - Use the Parameters interface or edit data/params directly to
-    set up the following values
-
-      # weeklyreporting_email - E-mail address (or more than one,
-      by comma-delimiting them
-
-  NOTES:
-  - Cannot currently configure reports to have different recipients
-
-
-Keywords: reporting, statistics
-
-

Copied: trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Config.pm 
(from rev 84480, trunk/tools/bugzilla/bugzilla-4.0/extensions/Config.pm)
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Config.pm      
                        (rev 0)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Config.pm      
2011-03-21 21:24:25 UTC (rev 84488)
@@ -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 WeeklyReporting Bugzilla Extension.
+#
+# The Initial Developer of the Original Code is Chad Horohoe
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Chad Horohoe <[email protected]>
+
+package Bugzilla::Extension::WeeklyReporting;
+use strict;
+
+use constant NAME => 'WeeklyReporting';
+
+use constant REQUIRED_MODULES => [
+    {
+        package => 'DateTime',
+        module  => 'DateTime',
+    },
+    {
+        package => 'Getopt-Long',
+        module  => 'Getopt::Long',
+    },
+    {
+        package => 'Pod-Usage',
+        module  => 'Pod::Usage',
+    }
+];
+
+use constant OPTIONAL_MODULES => [
+];
+
+__PACKAGE__->NAME;

Copied: 
trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Extension.pm (from 
rev 84480, trunk/tools/bugzilla/bugzilla-4.0/extensions/Extension.pm)
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Extension.pm   
                        (rev 0)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/Extension.pm   
2011-03-21 21:24:25 UTC (rev 84488)
@@ -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 WeeklyReporting Bugzilla Extension.
+#
+# The Initial Developer of the Original Code is Chad Horohoe
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Chad Horohoe <[email protected]>
+
+package Bugzilla::Extension::WeeklyReporting;
+use strict;
+use base qw(Bugzilla::Extension);
+
+our $VERSION = '0.1';
+
+sub config_add_panels {
+       my ($self, $args) = @_;
+       my $modules = $args->{'panel_modules'};
+       $modules->{'WeeklyReporting'} = 
'Bugzilla::Extension::WeeklyReporting::Params';
+}
+
+# List of reports used below
+use Bugzilla::Extension::WeeklyReporting::WeekAtAGlance;
+
+# When adding a report module above, be sure to push it into the array below
+sub get_report_list {
+       my( $self, $begin, $end ) = @_;
+       my @reportList;
+#      push @reportList, new 
Bugzilla::Extension::WeeklyReporting::WeekAtAGlance( $begin, $end );
+       return @reportList;
+}
+
+__PACKAGE__->NAME;

Copied: trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/README.txt 
(from rev 84480, trunk/tools/bugzilla/bugzilla-4.0/extensions/README.txt)
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/README.txt     
                        (rev 0)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/README.txt     
2011-03-21 21:24:25 UTC (rev 84488)
@@ -0,0 +1,44 @@
+
+  WeeklyReporting, version 0.1
+
+  This Bugzilla extension provides a functionality to send weekly
+  reports to user(s) regarding the week's bug activity
+
+
+  WHAT YOU GET
+
+  After you set up everything as described below, you'll send weekly
+  status reports to the e-mail addresses specified.
+
+
+  OVERVIEW
+
+  This extension was created to replace the ad-hoc script used by
+  Wikimedia to generate weekly Bugzilla reports. Right now, the
+  original report is the only one. However, there could be more,
+  in theory.
+
+
+  INSTALLATION
+
+  Configuration of WeeklyReporting
+
+  - just store the module in the extension folder of your 3.6
+    Bugzilla installation. It will be activated automatically
+    and requires no further configuraiton.
+
+  Configuration of Bugzilla
+
+  - Use the Parameters interface or edit data/params directly to
+    set up the following values
+
+      # weeklyreporting_email - E-mail address (or more than one,
+      by comma-delimiting them
+
+  NOTES:
+  - Cannot currently configure reports to have different recipients
+
+
+Keywords: reporting, statistics
+
+

Copied: 
trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/sendReports.pl 
(from rev 84480, trunk/tools/bugzilla/bugzilla-4.0/extensions/sendReports.pl)
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/sendReports.pl 
                        (rev 0)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/WeeklyReporting/sendReports.pl 
2011-03-21 21:24:25 UTC (rev 84488)
@@ -0,0 +1,74 @@
+#!/usr/bin/perl -w
+#
+# 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 VCS Bugzilla Extension.
+#
+# The Initial Developer of the Original Code is Red Hat, Inc.
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Max Kanat-Alexander <[email protected]>
+
+use strict;
+use diagnostics;
+use warnings;
+use lib qw(lib);
+use Getopt::Long;
+use Pod::Usage qq/pod2usage/;
+use DateTime;
+use Bugzilla;
+
+BEGIN { Bugzilla->extensions }
+
+my %switch;
+my $end_date = DateTime->now;
+my $begin_date = $end_date->clone();
+$begin_date = $begin_date->subtract( days => 7 );
+
+GetOptions(\%switch, 'help|h|?', 'noemail' ) || die $@;
+
+if ( $switch{'help'} ) {
+    pod2usage({-exitval => 1});
+}
+
+foreach my $report ( Bugzilla::Extension::WeeklyReporting->get_report_list( 
$begin_date, $end_date ) ) {
+       if( $switch{'noemail'} ) {
+               $report->printReport(); 
+       } else {
+               $report->emailReport();
+       }
+}
+
+__END__
+
+=head1 NAME
+
+ sendReports.pl - Send reports scheduled for dispatch
+
+=head1 SYNOPSIS
+
+ sendReports.pl --noemail
+
+=head1 OPTIONS
+
+=over
+
+=item B<--noemail>
+
+Just print the report, rather than sending the e-mail
+
+=back
+
+=head1 DESCRIPTION
+
+This script can be used to send reports on Bugzilla activity

Added: trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Config.pm
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Config.pm            
                (rev 0)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Config.pm    
2011-03-21 21:24:25 UTC (rev 84488)
@@ -0,0 +1,33 @@
+# -*- 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 Mediawiki Bugzilla Extension.
+#
+# The Initial Developer of the Original Code is Priyanka Dhanda.
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Priyanka Dhanda <[email protected]>
+
+package Bugzilla::Extension::Wikimedia;
+use strict;
+
+use constant NAME => 'Wikimedia';
+
+use constant REQUIRED_MODULES => [
+];
+
+use constant OPTIONAL_MODULES => [
+];
+
+__PACKAGE__->NAME;

Added: trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Extension.pm
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Extension.pm         
                (rev 0)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/Wikimedia/Extension.pm 
2011-03-21 21:24:25 UTC (rev 84488)
@@ -0,0 +1,70 @@
+# -*- 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 Mediawiki Bugzilla Extension.
+#
+# The Initial Developer of the Original Code is Priyanka Dhanda.
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Priyanka Dhanda <[email protected]>
+
+package Bugzilla::Extension::Wikimedia;
+use strict;
+use base qw(Bugzilla::Extension);
+
+use Bugzilla::Util;
+
+our $VERSION = '0.01';
+
+# See the documentation of Bugzilla::Hook ("perldoc Bugzilla::Hook" 
+# in the bugzilla directory) for a list of all available hooks.
+sub install_update_db {
+    my ($self, $args) = @_;
+
+}
+
+sub bug_format_comment {
+        my ($self, $args) = @_;
+        my $regexes = $args->{'regexes'};
+        my $text = $args->{'text'};
+        my $replacerWP = {
+                match => qr~\[\[([a-zA-Z0-9_ ,./'()!#%:\x80-\xff-]+)\]\]~,
+                replace => \&_createWikipediaLink
+        };
+       my $replacerCR = {
+                match => qr~r(\d+)~,
+                replace => \&_createCodeReviewLink
+        };
+         #~\br(\d+)\b
+         #      "<a href=\"http://www.mediawiki.org"; .
+         #       "/wiki/Special:Code/MediaWiki/$1\" " .
+         #       "title=\"revision $1 in SVN\">r$1</a>"
+ 
+        push( @$regexes, $replacerWP );
+       push( @$regexes, $replacerCR );
+}
+
+sub _createWikipediaLink {
+        my $match_str = $1;
+        my $tmp = html_quote($match_str);
+        my $wikipedia_link = "<a 
href=\"http://en.wikipedia.org/wiki/$tmp\";>$tmp</a>";
+       return $wikipedia_link;
+};  
+
+sub _createCodeReviewLink {
+        my $rev_link = "<a 
href=\"http://www.mediawiki.org/wiki/Special:Code/MediaWiki/$1\"; 
title=\"revision $1 in SVN\">r$1</a>";
+       return $rev_link;
+};
+ 
+__PACKAGE__->NAME;

Deleted: trunk/tools/bugzilla/bugzilla-4.0/extensions/sendReports.pl
===================================================================
--- trunk/tools/bugzilla/bugzilla-4.0/extensions/sendReports.pl 2011-03-21 
21:22:39 UTC (rev 84487)
+++ trunk/tools/bugzilla/bugzilla-4.0/extensions/sendReports.pl 2011-03-21 
21:24:25 UTC (rev 84488)
@@ -1,74 +0,0 @@
-#!/usr/bin/perl -w
-#
-# 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 VCS Bugzilla Extension.
-#
-# The Initial Developer of the Original Code is Red Hat, Inc.
-# Portions created by the Initial Developer are Copyright (C) 2010 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Max Kanat-Alexander <[email protected]>
-
-use strict;
-use diagnostics;
-use warnings;
-use lib qw(lib);
-use Getopt::Long;
-use Pod::Usage qq/pod2usage/;
-use DateTime;
-use Bugzilla;
-
-BEGIN { Bugzilla->extensions }
-
-my %switch;
-my $end_date = DateTime->now;
-my $begin_date = $end_date->clone();
-$begin_date = $begin_date->subtract( days => 7 );
-
-GetOptions(\%switch, 'help|h|?', 'noemail' ) || die $@;
-
-if ( $switch{'help'} ) {
-    pod2usage({-exitval => 1});
-}
-
-foreach my $report ( Bugzilla::Extension::WeeklyReporting->get_report_list( 
$begin_date, $end_date ) ) {
-       if( $switch{'noemail'} ) {
-               $report->printReport(); 
-       } else {
-               $report->emailReport();
-       }
-}
-
-__END__
-
-=head1 NAME
-
- sendReports.pl - Send reports scheduled for dispatch
-
-=head1 SYNOPSIS
-
- sendReports.pl --noemail
-
-=head1 OPTIONS
-
-=over
-
-=item B<--noemail>
-
-Just print the report, rather than sending the e-mail
-
-=back
-
-=head1 DESCRIPTION
-
-This script can be used to send reports on Bugzilla activity


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

Reply via email to