]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1488292 - Remove MozReview extension from BMO code tree as MozReview is being...
authordklawren <dklawren@users.noreply.github.com>
Fri, 7 Sep 2018 10:04:50 +0000 (06:04 -0400)
committerDylan William Hardison <dylan@hardison.net>
Fri, 7 Sep 2018 10:04:50 +0000 (12:04 +0200)
29 files changed:
Bugzilla/CGI.pm
Makefile.PL
extensions/BMO/lib/Data.pm
extensions/MozReview/Config.pm [deleted file]
extensions/MozReview/Extension.pm [deleted file]
extensions/MozReview/bin/add-mozreview-children.pl [deleted file]
extensions/MozReview/lib/Config.pm [deleted file]
extensions/MozReview/lib/WebService.pm [deleted file]
extensions/MozReview/template/en/default/admin/params/mozreview.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/attachment/create-before_form.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/attachment/edit-view.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/global/header-start.html.tmpl [deleted file]
extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl [deleted file]
extensions/MozReview/template/en/default/moz_review/header.html.tmpl [deleted file]
extensions/MozReview/template/en/default/moz_review/table.html.tmpl [deleted file]
extensions/MozReview/web/js/mozreview.js [deleted file]
extensions/MozReview/web/style/attachment.css [deleted file]
extensions/MozReview/web/style/mozreview.css [deleted file]
extensions/Push/lib/Connector/ReviewBoard.pm [deleted file]
extensions/Push/t/ReviewBoard.t [deleted file]
scripts/issue-api-key.pl
template/en/default/account/prefs/apikey.html.tmpl
template/en/default/attachment/create.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/email/new-api-key.txt.tmpl

index 6236b015a90261e75ea6b5defcad99bdaacaa0f4..985e504f7d9f9510f2e145324a6b563488e6bef9 100644 (file)
@@ -89,12 +89,6 @@ sub SHOW_BUG_MODAL_CSP {
         push @{ $policy{img_src} }, $attach_base;
     }
 
-    # MozReview API calls
-    my $mozreview_url = Bugzilla->params->{mozreview_base_url};
-    if ($mozreview_url) {
-        push @{ $policy{connect_src} },  $mozreview_url . 'api/extensions/mozreview.extension.MozReviewExtension/summary/';
-    }
-
     return %policy;
 }
 
index 3bf6926a55f1175f534a9b8471749ab94c06ceba..3c600bef63d325fed2b0275799fb7d6f251676ec 100755 (executable)
@@ -323,7 +323,7 @@ my %optional_features = (
         }
     },
     linux_pid => {
-        description => 'Linux::PID for MozReview',
+        description => 'Linux::PID',
         prereqs     => {
             runtime => {
                 requires => { 'Linux::Pid' => 0 },
index b444d6a24d59bf888726f386040acd7f587f8dfd..dc6a3894f63bd4d3518c9e56b3bcc62b9695c301 100644 (file)
@@ -27,21 +27,6 @@ our @EXPORT = qw( $cf_visible_in_products
 # will result in the user being redirected to that URL when viewing the
 # attachment.
 
-my $mozreview_url_re = qr{
-    # begins with mozreview hostname
-    ^
-    https?://reviewboard(?:-dev)?\.(?:allizom|mozilla)\.org
-
-    # followed by a review path
-    /r/\d+
-
-    # ends with optional suffix
-    (?: /
-      | /diff/\#index_header
-    )?
-    $
-}ix;
-
 sub phabricator_url_re {
     my $phab_uri = Bugzilla->params->{phabricator_base_uri} || 'https://example.com';
     return qr/^\Q${phab_uri}\ED\d+$/i;
@@ -54,12 +39,6 @@ our %autodetect_attach_urls = (
         content_type => 'text/x-github-pull-request',
         can_review   => 1,
     },
-    reviewboard => {
-        title        => 'MozReview',
-        regex        => $mozreview_url_re,
-        content_type => 'text/x-review-board-request',
-        can_review   => 1,
-    },
     Phabricator => {
         title        => 'Phabricator',
         regex        => \&phabricator_url_re,
diff --git a/extensions/MozReview/Config.pm b/extensions/MozReview/Config.pm
deleted file mode 100644 (file)
index 34d9890..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-package Bugzilla::Extension::MozReview;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use constant NAME => 'MozReview';
-
-__PACKAGE__->NAME;
diff --git a/extensions/MozReview/Extension.pm b/extensions/MozReview/Extension.pm
deleted file mode 100644 (file)
index 907f12e..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-package Bugzilla::Extension::MozReview;
-
-use 5.10.1;
-use strict;
-use warnings;
-use parent qw(Bugzilla::Extension);
-
-use Bugzilla::Attachment;
-use Bugzilla::Error;
-use Bugzilla::Extension::MozReview::WebService;
-use List::MoreUtils qw( any );
-
-our $VERSION = '0.01';
-
-my @METHOD_WHITELIST = (
-    'User.get',
-    'User.login',
-    'User.valid_login',
-    'Bug.add_comment',
-    'Bug.add_attachment',
-    'Bug.attachments',
-    'Bug.get',
-    'Bug.update_attachment',
-);
-
-BEGIN {
-    package Bugzilla::User::APIKey;
-
-    sub is_mozreview {
-        my ($self) = @_;
-        my $mozreview_app_id = Bugzilla->params->{mozreview_app_id};
-        return 0 unless $mozreview_app_id;
-
-        return 1 if $self->app_id && $self->app_id eq $mozreview_app_id;
-    }
-}
-
-sub template_before_process {
-    my ($self, $args) = @_;
-    my $file = $args->{'file'};
-    my $vars = $args->{'vars'};
-
-    return unless (($file =~ /bug\/(show-header|edit).html.tmpl$/ ||
-                    $file =~ /bug_modal\/(header|edit).html.tmpl$/ ||
-                    $file eq 'attachment/create.html.tmpl') &&
-                   Bugzilla->params->{mozreview_base_url});
-
-    my $bug = exists $vars->{'bugs'} ? $vars->{'bugs'}[0] : $vars->{'bug'};
-
-    if ($bug) {
-        if ($file eq 'attachment/create.html.tmpl') {
-            if ($bug->product eq 'Core' || $bug->product eq 'Firefox' ||
-                $bug->product eq 'Firefox for Android') {
-                $vars->{'mozreview_enabled'} = 1;
-            }
-        } else {
-            my $has_mozreview = 0;
-            my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bug);
-
-            foreach my $attachment (@$attachments) {
-                if ($attachment->contenttype eq 'text/x-review-board-request'
-                    && !$attachment->isobsolete) {
-                    $has_mozreview = 1;
-                    last;
-                }
-            }
-
-            if ($has_mozreview) {
-                $vars->{'mozreview'} = 1;
-            }
-        }
-    }
-}
-
-sub auth_delegation_confirm {
-    my ($self, $args) = @_;
-    my $mozreview_callback_url = Bugzilla->params->{mozreview_auth_callback_url};
-    my $mozreview_app_id       = Bugzilla->params->{mozreview_app_id};
-
-    return unless $mozreview_callback_url;
-    return unless $mozreview_app_id;
-
-    if (index($args->{callback}, $mozreview_callback_url) == 0 && $args->{app_id} eq $mozreview_app_id) {
-        ${$args->{skip_confirmation}} = 1;
-    }
-}
-
-sub config_add_panels {
-    my ($self, $args) = @_;
-    my $modules = $args->{panel_modules};
-    $modules->{MozReview} = "Bugzilla::Extension::MozReview::Config";
-}
-
-sub webservice {
-    my ($self,  $args) = @_;
-    my $dispatch = $args->{dispatch};
-    $dispatch->{MozReview} = "Bugzilla::Extension::MozReview::WebService";
-}
-
-sub webservice_before_call {
-    my ($self, $args) = @_;
-    my ($method, $full_method) = ($args->{method}, $args->{full_method});
-    my $mozreview_app_id = Bugzilla->params->{mozreview_app_id} // '';
-    my $user             = Bugzilla->user;
-    my $getter           = eval { $user->authorizer->successful_info_getter() } or return;
-    my $app_id           = $getter->can("app_id") ? $getter->app_id // '' : '';
-
-    $full_method =~ s/^Bugzilla::Extension::(\w+)::WebService\./$1./;
-
-    my $is_mozreview_method = $full_method =~ /^MozReview\./;
-
-    if ($is_mozreview_method && (!$mozreview_app_id || !$app_id || $mozreview_app_id ne $app_id)) {
-        ThrowUserError('forbidden_method', { method => $full_method });
-    }
-
-    return unless $mozreview_app_id && $app_id;
-
-    if ($app_id eq $mozreview_app_id && !$is_mozreview_method) {
-        unless (any { $full_method eq $_ } @METHOD_WHITELIST) {
-            ThrowUserError('forbidden_method', { method => $full_method });
-        }
-    }
-}
-
-__PACKAGE__->NAME;
diff --git a/extensions/MozReview/bin/add-mozreview-children.pl b/extensions/MozReview/bin/add-mozreview-children.pl
deleted file mode 100755 (executable)
index 9faa923..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-#!/usr/bin/perl
-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-# This script obsoletes attachments containing URLs to MozReview parent
-# review requests and adds attachments, with review flags, for MozReview
-# child (commit) review requests to match the new scheme.
-
-use strict;
-use warnings;
-use 5.10.1;
-
-use lib qw(. lib local/lib/perl5);
-
-BEGIN {
-    use Bugzilla;
-    Bugzilla->extensions;
-}
-use Bugzilla::Constants qw( USAGE_MODE_CMDLINE );
-Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
-
-use Bugzilla::Attachment;
-use Bugzilla::Bug;
-use Bugzilla::Constants;
-use Bugzilla::Flag;
-use Bugzilla::FlagType;
-use JSON;
-use LWP::Simple qw( get $ua );
-
-$Bugzilla::Flag::disable_flagmail = 1;
-
-if (my $proxy = Bugzilla->params->{proxy_url}) {
-    $ua->proxy('https', $proxy);
-}
-
-my $MOZREVIEW_MIMETYPE = 'text/x-review-board-request';
-
-# Disable the "cannot ask for review" so we can reassign their flags to
-# the new attachments.
-Bugzilla->params->{max_reviewer_last_seen} = 0;
-
-my $rb_host = shift or die "syntax: $0 review-board-url\n";
-$rb_host =~ s#/$##;
-
-sub rr_url {
-    my ($rrid) = @_;
-    return $rb_host . "/r/" . $rrid . "/";
-}
-
-sub set_review_flag {
-    my ($child_attach, $flag_type, $flag_status, $reviewer, $setter) = @_;
-
-    my %params = (
-        type_id => $flag_type->id,
-        status  => $flag_status
-    );
-
-    if ($flag_status eq "?") {
-        $params{'requestee'} = $reviewer->login;
-        $params{'setter'} = $setter;
-    } else {
-        $params{'setter'} = $reviewer;
-    }
-
-    return Bugzilla::Flag->set_flag($child_attach, \%params);
-}
-
-my $dbh = Bugzilla->dbh;
-
-my $bugs_query = "SELECT distinct bug_id FROM attachments WHERE mimetype='text/x-review-board-request' AND isobsolete=0";
-my $bug_ids = $dbh->selectcol_arrayref($bugs_query);
-my $total_bugs = scalar @$bug_ids;
-$total_bugs or die "No bugs were found.\n";
-my $bug_count = 0;
-
-print <<EOF;
-About to convert MozReview attachments for $total_bugs bugs.
-
-Press <Ctrl-C> to stop or <Enter> to continue...
-EOF
-getc();
-
-foreach my $bug_id (@$bug_ids) {
-    $dbh->bz_start_transaction();
-    my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
-    my $bug_changed = 0;
-    my $bug = Bugzilla::Bug->new($bug_id);
-    print "Bug " . $bug->id . " (" . ++$bug_count  . "/" . $total_bugs . ")\n";
-
-    my $url = $rb_host . "/api/extensions/mozreview.extension.MozReviewExtension/summary/?bug=" . $bug->id;
-    print "  Fetching reviews from $url...\n";
-    my $body = get($url);
-    die "Error fetching review requests for bug " . $bug->id
-        unless defined $body;
-
-    my $data = from_json($body);
-    my $summaries = $data->{"review_request_summaries"};
-    my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bug);
-    my %attach_map;
-
-    my $flag_types = Bugzilla::FlagType::match({
-        'target_type'  => 'attachment',
-        'product_id'   => $bug->product_id,
-        'component_id' => $bug->component_id,
-        'is_active'    => 1});
-    my $flag_type;
-
-    foreach my $ft (@$flag_types) {
-        if ($ft->is_active && $ft->name eq "review") {
-            $flag_type = $ft;
-            last;
-        }
-    }
-
-    if (!defined($flag_type)) {
-        print "      Couldn't find flag type for attachments on this bug!\n";
-        $dbh->bz_rollback_transaction();
-        next;
-    }
-
-    foreach my $attachment (@$attachments) {
-        next if ($attachment->isobsolete
-                 || $attachment->contenttype ne $MOZREVIEW_MIMETYPE);
-
-        print "  Attachment " . $attachment->id . ": " . $attachment->data . "\n";
-        my ($rrid) = $attachment->data =~ m#/r/(\d+)/?$#;
-        if (!defined($rrid)) {
-            print "    Malformed or missing reviewboard URL\n";
-            next;
-        }
-
-        $attach_map{$attachment->data} = $attachment;
-    }
-
-    foreach my $summary (@$summaries) {
-        my $parent = $summary->{"parent"};
-        my $attacher = Bugzilla::User->new({ id => $parent->{"submitter_bmo_id"},
-                                             cache => 1 });
-        Bugzilla->set_user($attacher);
-        print "  Parent review request " . $parent->{"id"} . "\n";
-
-        # %parent_flags is used to keep track of review flags related to
-        # reviewers.  It maps requestee => status if status is "?" or
-        # setter => status otherwise.
-        my %parent_flags;
-
-        my $parent_url = rr_url($parent->{"id"});
-        my $parent_attach = $attach_map{$parent_url};
-        if (defined($parent_attach)) {
-            print "    Parent attachment has ID " . $parent_attach->id . ". Obsoleting it.\n";
-            foreach my $flag (@{ $parent_attach->flags }) {
-                if ($flag->type->name eq "review") {
-                    if ($flag->status eq "?") {
-                        $parent_flags{$flag->requestee->id} = $flag;
-                    } else {
-                        $parent_flags{$flag->setter->id} = $flag;
-                    }
-                }
-            }
-            $parent_attach->set_is_obsolete(1);
-            $parent_attach->update($timestamp);
-            print "    Posting comment.\n";
-            $bug->add_comment('',
-                { isprivate  => 0,
-                  type       => CMT_ATTACHMENT_UPDATED,
-                  extra_data => $parent_attach->id });
-            $bug_changed = 1;
-        } else {
-            print "    Parent attachment not found.\n";
-        }
-
-        my @children = @{ $summary->{"children"} };
-        foreach my $child (@children) {
-            print "    Child review request " . $child->{"id"} . "\n";
-            my $child_url = rr_url($child->{"id"});
-            my $child_attach = $attach_map{$child_url};
-            if (defined($child_attach)) {
-                print "      Found attachment.\n";
-                next;
-            }
-
-            print "      No attachment found for child " . $child_url . "\n";
-            my %child_attach_params = (
-                bug => $bug,
-                data => $rb_host . "/r/" . $child->{"id"} . "/",
-                description => "MozReview Request: " . $child->{"summary"},
-                filename => "reviewboard-" . $child->{"id"} . "-url.txt",
-                mimetype => $MOZREVIEW_MIMETYPE,
-            );
-            $child_attach = Bugzilla::Attachment->create(\%child_attach_params);
-            print "      New attachment id: " . $child_attach->id . "\n";
-            $bug_changed = 1;
-
-            # Set flags.  If there was a parent, check it for flags by the
-            # requestee.  Otherwise, set an r? flag.
-
-            # Preserve the original flag hash since we need to modify it for
-            # every child to find extra reviewers (see below the 'foreach').
-            my %tmp_parent_flags = %parent_flags;
-
-            foreach my $reviewer_id (@{ $child->{"reviewers_bmo_ids"} }) {
-                my $reviewer = Bugzilla::User->new({ id => $reviewer_id,
-                                                     cache => 1 });
-                print "      Reviewer " . $reviewer->login . " (" . $reviewer->id . ")\n";
-                $reviewer->settings->{block_reviews}->{value} = 'off';
-                my $flag = $tmp_parent_flags{$reviewer->id};
-                if (defined($flag)) {
-                    print "      Flag for reviewer " . $reviewer->id . ": " . $flag->status . "\n";
-
-                    set_review_flag($child_attach, $flag_type, $flag->status,
-                                    $reviewer, $attacher);
-                    delete $tmp_parent_flags{$reviewer->id};
-                } else {
-                    # No flag on the parent; this probably means the reviewer
-                    # canceled the review, so don't set r?.
-                    print "      No review flag for reviewer " . $reviewer->id . "\n";
-                }
-            }
-
-            # Preserve flags that were set directly on the attachment
-            # from reviewers not listed in the review request.
-            foreach my $extra_reviewer_id (keys %tmp_parent_flags) {
-                my $extra_reviewer = Bugzilla::User->new({
-                    id => $extra_reviewer_id,
-                    cache => 1
-                });
-                my $flag = $tmp_parent_flags{$extra_reviewer_id};
-                print "     Extra flag set for reviewer " . $extra_reviewer->login . "\n";
-                set_review_flag($child_attach, $flag->type, $flag->status,
-                                $extra_reviewer, $flag->setter);
-            }
-
-            $child_attach->update($timestamp);
-            print "      Posting comment.\n";
-            $bug->add_comment('',
-                              { isprivate  => 0,
-                                type       => CMT_ATTACHMENT_CREATED,
-                                extra_data => $child_attach->id });
-        }
-    }
-
-    if ($bug_changed) {
-        print "    Updating bug.\n";
-        $bug->update($timestamp);
-        $dbh->do("UPDATE bugs SET lastdiffed = ?, delta_ts = ? WHERE bug_id = ?",
-                 undef, $timestamp, $timestamp, $bug_id);
-    }
-    $dbh->bz_commit_transaction();
-    Bugzilla->memcached->clear_all();
-}
-
-print "Done.\n";
diff --git a/extensions/MozReview/lib/Config.pm b/extensions/MozReview/lib/Config.pm
deleted file mode 100644 (file)
index e0d6377..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-package Bugzilla::Extension::MozReview::Config;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use Bugzilla::Config::Common;
-
-our $sortkey = 1300;
-
-sub get_param_list {
-    my ($class) = @_;
-
-    my @params = (
-        {
-            name    => 'mozreview_base_url',
-            type    => 't',
-            default => '',
-            checker => \&check_urlbase
-        },
-        {
-            name    => 'mozreview_auth_callback_url',
-            type    => 't',
-            default => '',
-            checker => sub {
-                my ($url) = (@_);
-
-                return 'must be an HTTP/HTTPS absolute URL' unless $url =~ m{^https?://};
-                return '';
-            }
-        },
-        {
-            name => 'mozreview_app_id',
-            type => 't',
-            default => '',
-            checker => sub {
-                my ($app_id) = (@_);
-
-                return 'must be a hex number' unless $app_id =~ /^[[:xdigit:]]+$/;
-                return '';
-            },
-        },
-    );
-
-    return @params;
-}
-
-1;
diff --git a/extensions/MozReview/lib/WebService.pm b/extensions/MozReview/lib/WebService.pm
deleted file mode 100644 (file)
index c6916d1..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-package Bugzilla::Extension::MozReview::WebService;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use base qw(Bugzilla::WebService);
-
-use Bugzilla::Attachment;
-use Bugzilla::Bug;
-use Bugzilla::Comment;
-use Bugzilla::Constants;
-use Bugzilla::Error;
-use Bugzilla::WebService::Constants;
-use Bugzilla::WebService::Util qw(extract_flags validate translate);
-use Bugzilla::Util qw(trim);
-
-use List::MoreUtils qw(uniq all);
-use List::Util qw(max);
-use Storable qw(dclone);
-
-use constant PUBLIC_METHODS => qw( attachments );
-
-BEGIN {
-    *_attachment_to_hash = \&Bugzilla::WebService::Bug::_attachment_to_hash;
-    *_flag_to_hash = \&Bugzilla::WebService::Bug::_flag_to_hash;
-}
-
-sub attachments {
-    my ($self, $params) = validate(@_, 'attachments');
-    my $dbh = Bugzilla->dbh;
-
-    # BMO: Don't allow updating of bugs if disabled
-    if (Bugzilla->params->{disable_bug_updates}) {
-        ThrowErrorPage('bug/process/updates-disabled.html.tmpl',
-            'Bug updates are currently disabled.');
-    }
-
-    my $user = Bugzilla->login(LOGIN_REQUIRED);
-
-    ThrowCodeError('param_required', { param => 'attachments' })
-      unless defined $params->{attachments};
-
-    my $bug = Bugzilla::Bug->check($params->{bug_id});
-
-    ThrowUserError("product_edit_denied", { product => $bug->product })
-      unless $user->can_edit_product($bug->product_id);
-
-    my (@modified, @created);
-    $dbh->bz_start_transaction();
-    my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
-
-    my $comment_tags = $params->{comment_tags};
-    my $attachments  = $params->{attachments};
-
-    if ($comment_tags) {
-        ThrowUserError('comment_tag_disabled')
-          unless Bugzilla->params->{comment_taggers_group};
-
-        my $all_mozreview_tags = all { /^mozreview-?/i } @$comment_tags;
-        if ($all_mozreview_tags || $user->can_tag_comments) {
-            # there should be a method of User that does this.
-            local $user->{can_tag_comments} = 1;
-            $bug->set_all({ comment_tags => $comment_tags });
-        }
-        else {
-            ThrowUserError('auth_failure',
-                           { group  => Bugzilla->params->{comment_taggers_group},
-                             action => 'update',
-                             object => 'comment_tags' })
-        }
-    }
-
-    foreach my $attachment (@$attachments) {
-        my $flags         = delete $attachment->{flags};
-        my $attachment_id = delete $attachment->{attachment_id};
-        my $comment       = delete $attachment->{comment};
-        my $attachment_obj;
-
-        if ($attachment_id) {
-            $attachment_obj = Bugzilla::Attachment->check({ id => $attachment_id });
-            ThrowUserError("mozreview_attachment_bug_mismatch", { bug => $bug, attachment => $attachment_obj })
-              if $attachment_obj->bug_id != $bug->id;
-
-            # HACK: preload same bug object.
-            $attachment_obj->{bug} = $bug;
-
-            $attachment = translate($attachment, Bugzilla::WebService::Bug::ATTACHMENT_MAPPED_SETTERS);
-
-            my ($update_flags, $new_flags) = $flags
-              ? extract_flags($flags, $bug, $attachment_obj)
-              : ([], []);
-            if ($attachment_obj->validate_can_edit) {
-                $attachment_obj->set_all($attachment);
-                $attachment_obj->set_flags($update_flags, $new_flags) if $flags;
-            }
-            elsif (scalar @$update_flags && !scalar(@$new_flags) && !scalar keys %$attachment) {
-                # Requestees can set flags targetted to them, even if they cannot
-                # edit the attachment. Flag setters can edit their own flags too.
-                my %flag_list = map { $_->{id} => $_ } @$update_flags;
-                my $flag_objs = Bugzilla::Flag->new_from_list([ keys %flag_list ]);
-                my @editable_flags;
-                foreach my $flag_obj (@$flag_objs) {
-                    if ($flag_obj->setter_id == $user->id
-                          || ($flag_obj->requestee_id && $flag_obj->requestee_id == $user->id))
-                      {
-                          push(@editable_flags, $flag_list{$flag_obj->id});
-                      }
-                }
-                if (!scalar @editable_flags) {
-                    ThrowUserError('illegal_attachment_edit', { attach_id => $attachment_obj->id });
-                }
-                $attachment_obj->set_flags(\@editable_flags, []);
-            }
-            else {
-                ThrowUserError('illegal_attachment_edit', { attach_id => $attachment_obj->id });
-            }
-
-            my $changes = $attachment_obj->update($timestamp);
-
-            if (my $comment_text = trim($comment)) {
-                $attachment_obj->bug->add_comment($comment_text,
-                                              { isprivate  => $attachment_obj->isprivate,
-                                                type       => CMT_ATTACHMENT_UPDATED,
-                                                extra_data => $attachment_obj->id });
-            }
-
-            $changes = translate($changes, Bugzilla::WebService::Bug::ATTACHMENT_MAPPED_RETURNS);
-
-            my %hash = (
-                id               => $self->type('int', $attachment_obj->id),
-                last_change_time => $self->type('dateTime', $attachment_obj->modification_time),
-                changes          => {},
-            );
-
-            foreach my $field (keys %$changes) {
-                my $change = $changes->{$field};
-
-                # We normalize undef to an empty string, so that the API
-                # stays consistent for things like Deadline that can become
-                # empty.
-                $hash{changes}->{$field} = {
-                    removed => $self->type('string', $change->[0] // ''),
-                    added   => $self->type('string', $change->[1] // '')
-                };
-            }
-
-            push(@modified, \%hash);
-        }
-        else {
-            $attachment_obj = Bugzilla::Attachment->create({
-                bug         => $bug,
-                creation_ts => $timestamp,
-                data        => $attachment->{data},
-                description => $attachment->{summary},
-                filename    => $attachment->{file_name},
-                mimetype    => $attachment->{content_type},
-                ispatch     => $attachment->{is_patch},
-                isprivate   => $attachment->{is_private},
-            });
-
-            if ($flags) {
-                my ($old_flags, $new_flags) = extract_flags($flags, $bug, $attachment_obj);
-                $attachment_obj->set_flags($old_flags, $new_flags);
-            }
-
-            push(@created, $attachment_obj);
-
-            $attachment_obj->update($timestamp);
-            $bug->add_comment($comment,
-                              { isprivate  => $attachment_obj->isprivate,
-                                type       => CMT_ATTACHMENT_CREATED,
-                                extra_data => $attachment_obj->id });
-
-        }
-    }
-
-    $bug->update($timestamp);
-
-    $dbh->bz_commit_transaction();
-    $bug->send_changes();
-
-    my %attachments_created = map { $_->id => $self->_attachment_to_hash($_, $params) } @created;
-    my %attachments_modified = map { (ref $_->{id} ? $_->{id}->value : $_->{id}) => $_ } @modified;
-
-    return { attachments_created => \%attachments_created, attachments_modified => \%attachments_modified };
-}
-
-sub rest_resources {
-    return [
-        qr{^/mozreview/(\d+)/attachments$}, {
-            POST => {
-                method => 'attachments',
-                params => sub {
-                    return { bug_id => $1 };
-                },
-            },
-        },
-    ];
-}
-
-1;
diff --git a/extensions/MozReview/template/en/default/admin/params/mozreview.html.tmpl b/extensions/MozReview/template/en/default/admin/params/mozreview.html.tmpl
deleted file mode 100644 (file)
index 4a35555..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[%
-   title = "MozReview"
-   desc = "Configure MozReview"
-%]
-
-[%
-   param_descs = {
-     mozreview_base_url          => 'MozReview Base URL',
-     mozreview_auth_callback_url => 'MozReview Auth Delegation URL',
-     mozreview_app_id            => 'app_id for API Keys delegated to MozReview',
-   }
-%]
diff --git a/extensions/MozReview/template/en/default/hook/attachment/create-before_form.html.tmpl b/extensions/MozReview/template/en/default/hook/attachment/create-before_form.html.tmpl
deleted file mode 100644 (file)
index bfa842c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[% RETURN UNLESS mozreview_enabled %]
-
-<div class="mozreview-ad">
-  Are you attaching a patch? Consider trying out
-  <a href="https://reviewboard.mozilla.org/">MozReview</a>, Mozilla's
-  new repository-based code-review tool.
-  <a href="https://mozilla-version-control-tools.readthedocs.io/en/latest/mozreview.html">Read
-    the docs</a> to get started.
-</div>
diff --git a/extensions/MozReview/template/en/default/hook/attachment/edit-view.html.tmpl b/extensions/MozReview/template/en/default/hook/attachment/edit-view.html.tmpl
deleted file mode 100644 (file)
index 044c36a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[%
-  RETURN UNLESS attachment.mimetype == "text/x-review-board-request" && attachment.external_redirect;
-  custom_attachment_viewer = 1;
-  url = attachment.data;
-%]
-<h3>
-  <a href="[% url FILTER html %]" title="[% url FILTER html %]">Show review on MozReview</a><br>
-</h3>
diff --git a/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl b/extensions/MozReview/template/en/default/hook/bug/edit-after_bug_data.html.tmpl
deleted file mode 100644 (file)
index b0e4ce6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[% RETURN UNLESS mozreview %]
-
-<table class="mozreview-table">
-  <thead>
-    <tr>
-      <th>MozReview Requests</th>
-    </tr>
-  </thead>
-
-  <tbody>
-    <tr>
-      <td>
-        [% INCLUDE moz_review/table.html.tmpl %]
-      </td>
-    </tr>
-  </tbody>
-
-  <tfoot>
-    <tr class="mozreview-hide-discarded-row bz_default_hidden">
-      <td class="mozreview-hide-discarded">
-        <a class="mozreview-hide-discarded-link"
-           href="#"><span class="mozreview-discarded-action">Show</span>
-          discarded requests</a>
-      </td>
-    </tr>
-  </tfoot>
-</table>
diff --git a/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl b/extensions/MozReview/template/en/default/hook/bug/show-header-end.html.tmpl
deleted file mode 100644 (file)
index d70e36b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[%
-  IF mozreview;
-    PROCESS moz_review/header.html.tmpl;
-  END;
-%]
diff --git a/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl b/extensions/MozReview/template/en/default/hook/bug_modal/edit-module.html.tmpl
deleted file mode 100644 (file)
index 9785fa0..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[% RETURN UNLESS mozreview %]
-
-[% WRAPPER bug_modal/module.html.tmpl
-    title = "MozReview Requests"
-    collapsed = 0
-%]
-  [% INCLUDE moz_review/table.html.tmpl %]
-  <div class="mozreview-hide-discarded-row bz_default_hidden">
-    <button type="button" class="minor mozreview-hide-discarded-link">
-      <span class="mozreview-discarded-action">Show</span> discarded requests
-    </button>
-  </div>
-[% END %]
diff --git a/extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl b/extensions/MozReview/template/en/default/hook/bug_modal/header-end.html.tmpl
deleted file mode 100644 (file)
index d70e36b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[%
-  IF mozreview;
-    PROCESS moz_review/header.html.tmpl;
-  END;
-%]
diff --git a/extensions/MozReview/template/en/default/hook/global/header-start.html.tmpl b/extensions/MozReview/template/en/default/hook/global/header-start.html.tmpl
deleted file mode 100644 (file)
index 6ad026d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[% IF template.name == 'attachment/create.html.tmpl' %]
-  [% style_urls.push('extensions/MozReview/web/style/attachment.css') %]
-[% END %]
diff --git a/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/MozReview/template/en/default/hook/global/user-error-errors.html.tmpl
deleted file mode 100644 (file)
index 151e63b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[% IF error == "forbidden_method" %]
-  The requested method '[% method FILTER html %]' is not allowed to be called using the current API Key.
-[% ELSIF error == "mozreview_attachment_bug_mismatch" %]
-  You tried to update attachment [% attachment.id FILTER html %]
-  as part of adding or updating attachments on [% bug.id FILTER html %].
-  That attachment actually belongs to [% terms.bug %] [% attachment.bug_id FILTER html %].
-[% END %]
diff --git a/extensions/MozReview/template/en/default/moz_review/header.html.tmpl b/extensions/MozReview/template/en/default/moz_review/header.html.tmpl
deleted file mode 100644 (file)
index 99fb81b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[% style_urls.push('extensions/MozReview/web/style/mozreview.css') %]
-[% javascript_urls.push('extensions/MozReview/web/js/mozreview.js') %]
diff --git a/extensions/MozReview/template/en/default/moz_review/table.html.tmpl b/extensions/MozReview/template/en/default/moz_review/table.html.tmpl
deleted file mode 100644 (file)
index 84b7add..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-<table class="mozreview-requests" data-mozreview-url="[% Bugzilla.params.mozreview_base_url FILTER html %]">
-  <thead>
-    <tr>
-      <th>Submitter</th>
-      <th>Diff</th>
-      <th>Changes</th>
-      <th>Open Issues</th>
-      <th>Last Updated</th>
-    </tr>
-  </thead>
-  <tbody class="mozreview-request">
-    <tr class="mozreview-loading-row">
-      <td colspan="4">Loading...</td>
-    </tr>
-    <tr class="mozreview-loading-error-row bz_default_hidden">
-      <td colspan="4">Error loading review requests:
-        <span class="mozreview-load-error-string"></span></td>
-    </tr>
-  </tbody>
-</table>
diff --git a/extensions/MozReview/web/js/mozreview.js b/extensions/MozReview/web/js/mozreview.js
deleted file mode 100644 (file)
index 6fe51f5..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This Source Code Form is "Incompatible With Secondary Licenses", as
- * defined by the Mozilla Public License, v. 2.0.
- */
-
-var MozReview = {};
-
-MozReview.getReviewRequest = function() {
-    var hostUrl = $('.mozreview-requests').data('mozreviewUrl');
-    var tr = $('<tr/>');
-    var td = $('<td/>');
-    var link = $('<a/>');
-
-    var rrSummaryApiUrl = hostUrl +
-        'api/extensions/mozreview.extension.MozReviewExtension/summary/?bug=' +
-        BUGZILLA.bug_id;
-    var rrUiBaseUrl = hostUrl + 'r/';
-
-    function rrUrl(rrId) {
-        return rrUiBaseUrl + rrId + '/';
-    }
-
-    function rrDiffUrl(rrId) {
-        return rrUrl(rrId) + 'diff/#index_header';
-    }
-
-    function humanizedInt(i) {
-        if (i > 1000) {
-            return (i / 1000).toFixed(1) + 'k';
-        } else {
-            return '' + i;
-        }
-    }
-
-    function rrCommitRow(rr, firstCommit) {
-        var trCommit = tr.clone();
-        var tdSubmitter = td.clone();
-        var tdSummary = td.clone();
-        var diffLink = link.clone();
-        var diffStat = '';
-
-        if (firstCommit) {
-            tdSubmitter.text(rr.submitter);
-        }
-
-        tdSummary.addClass('mozreview-summary');
-        diffLink.attr('href', rrDiffUrl(rr.id));
-        diffLink.text(rr.summary);
-        tdSummary.append(diffLink);
-
-        if (rr.diff.insert > 0) {
-            diffStat = '+' + humanizedInt(rr.diff.insert);
-        }
-
-        if (rr.diff.delete > 0) {
-            if (diffStat.length > 0) {
-                diffStat += ' / ';
-            }
-            diffStat += '-' + humanizedInt(rr.diff.delete);
-        }
-
-        trCommit.append(
-            tdSubmitter,
-            tdSummary,
-            td.clone().text(diffStat)
-                      .addClass('mozreview-diffstat'),
-            td.clone().text(rr.issue_open_count)
-                      .addClass('mozreview-open-issues'),
-            td.clone().text(timeAgo(new Date(rr.last_updated)))
-        );
-
-        if (rr.status == "discarded") {
-            $('.mozreview-hide-discarded-row').removeClass('bz_default_hidden');
-            trCommit.addClass('bz_default_hidden mozreview-discarded-request');
-        }
-
-        return trCommit;
-    }
-
-    $('.mozreview-hide-discarded-link').click(function(event) {
-        event.preventDefault();
-        if ($('.bz_default_hidden.mozreview-discarded-request').length) {
-            $('.mozreview-discarded-request').removeClass('bz_default_hidden');
-            $('.mozreview-discarded-action').text('Hide');
-        } else {
-            $('.mozreview-discarded-request').addClass('bz_default_hidden');
-            $('.mozreview-discarded-action').text('Show');
-        }
-    });
-
-    var tbody = $('tbody.mozreview-request');
-
-    function displayLoadError(errStr) {
-        var errRow = tbody.find('.mozreview-loading-error-row');
-        errRow.find('.mozreview-load-error-string').text(errStr);
-        errRow.removeClass('bz_default_hidden');
-    }
-
-    $.getJSON(rrSummaryApiUrl, function(data) {
-        var family, parent, i, j;
-
-        if (data.review_request_summaries.length === 0) {
-            displayLoadError('none returned from server');
-        } else {
-            for (i = 0; i < data.review_request_summaries.length; i++) {
-                family = data.review_request_summaries[i];
-                for (j = 0; j < family.children.length; j++) {
-                    tbody.append(rrCommitRow(family.children[j], j == 0));
-                }
-            }
-        }
-
-        tbody.find('.mozreview-loading-row').addClass('bz_default_hidden');
-    }).fail(function(jqXHR, textStatus, errorThrown) {
-        var errStr;
-        if (jqXHR.responseJSON && jqXHR.responseJSON.err &&
-            jqXHR.responseJSON.err.msg) {
-            errStr = jqXHR.responseJSON.err.msg;
-        } else if (errorThrown) {
-            errStr = errorThrown;
-        } else {
-            errStr = 'unknown';
-        }
-        displayLoadError(errStr);
-        tbody.find('.mozreview-loading-row').addClass('bz_default_hidden');
-    });
-};
-
-$().ready(function() {
-    MozReview.getReviewRequest();
-});
diff --git a/extensions/MozReview/web/style/attachment.css b/extensions/MozReview/web/style/attachment.css
deleted file mode 100644 (file)
index 474bf46..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This Source Code Form is "Incompatible With Secondary Licenses", as
- * defined by the Mozilla Public License, v. 2.0. */
-
-.mozreview-ad {
-    background-color: #fff9db;
-    color: #666458;
-    padding: 5px;
-    margin-bottom: 10px;
-}
diff --git a/extensions/MozReview/web/style/mozreview.css b/extensions/MozReview/web/style/mozreview.css
deleted file mode 100644 (file)
index a2263fc..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This Source Code Form is "Incompatible With Secondary Licenses", as
- * defined by the Mozilla Public License, v. 2.0. */
-
-.mozreview-table {
-    background: #fff;
-    border: none;
-    border-collapse: collapse;
-    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
-    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
-}
-
-.mozreview-table th {
-    text-align: left;
-    padding: 4px;
-}
-
-.mozreview-table td {
-    vertical-align: middle !important;
-    padding: 4px !important;
-}
-
-.mozreview-table thead, .mozreview-table tfoot {
-    background-color: #eee;
-    color: #404040;
-}
-
-.mozreview-requests {
-    background: #fff;
-    border: none;
-    border-collapse: collapse;
-}
-
-.mozreview-requests th {
-    padding: 2px;
-}
-
-.mozreview-requests td {
-    padding: 2px;
-}
-
-.mozreview-requests .mozreview-summary {
-    text-align: left;
-}
-
-.mozreview-requests .mozreview-open-issues {
-    text-align: center;
-}
-
-.mozreview-requests .mozreview-diffstat {
-    text-align: center;
-    white-space: nowrap;
-}
-
-/* bug-modal specific */
-
-#module-mozreview-requests .module-content {
-    padding: 0;
-}
-
-.bug_modal .mozreview-table {
-    width: 100%;
-}
-
-.bug_modal .mozreview-request td {
-    padding-left: 8px;
-}
-
-.bug_modal .mozreview-requests th {
-    text-align: left;
-    padding-left: 8px;
-}
-
-.bug_modal .mozreview-hide-discarded-row {
-    padding: 4px;
-}
diff --git a/extensions/Push/lib/Connector/ReviewBoard.pm b/extensions/Push/lib/Connector/ReviewBoard.pm
deleted file mode 100644 (file)
index 1c657a7..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-package Bugzilla::Extension::Push::Connector::ReviewBoard;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use base 'Bugzilla::Extension::Push::Connector::Base';
-
-use Bugzilla::Bug;
-use Bugzilla::BugMail;
-use Bugzilla::Component;
-use Bugzilla::Constants;
-use Bugzilla::Extension::Push::Constants;
-use Bugzilla::Extension::Push::Util;
-use Bugzilla::Group;
-use Bugzilla::Product;
-use Bugzilla::User;
-use Bugzilla::Util qw( trim );
-
-use constant RB_CONTENT_TYPE => 'text/x-review-board-request';
-use constant AUTOMATION_USER => 'automation@bmo.tld';
-
-sub options {
-    return (
-        {
-            name     => 'product',
-            label    => 'Product to create bugs in',
-            type     => 'string',
-            default  => 'Developer Services',
-            required => 1,
-            validate => sub {
-                Bugzilla::Product->new({ name => $_[0] })
-                    || die "Invalid Product ($_[0])\n";
-            },
-        },
-        {
-            name     => 'component',
-            label    => 'Component to create bugs in',
-            type     => 'string',
-            default  => 'MozReview',
-            required => 1,
-            validate => sub {
-                my ($component, $config) = @_;
-                    my $product = Bugzilla::Product->new({ name => $config->{product} })
-                        || die "Invalid Product (" . $config->{product} . ")\n";
-                    Bugzilla::Component->new({ product => $product, name => $component })
-                        || die "Invalid Component ($component)\n";
-            },
-        },
-        {
-            name     => 'version',
-            label    => "The bug's version",
-            type     => 'string',
-            default  => 'Production',
-            required => 1,
-            validate => sub {
-                my ($version, $config) = @_;
-                    my $product = Bugzilla::Product->new({ name => $config->{product} })
-                        || die "Invalid Product (" . $config->{product} . ")\n";
-                    Bugzilla::Version->new({ product => $product, name => $version })
-                        || die "Invalid Version ($version)\n";
-            },
-        },
-        {
-            name     => 'group',
-            label    => 'Security group',
-            type     => 'string',
-            default  => 'mozilla-employee-confidential',
-            required => 1,
-            validate => sub {
-                Bugzilla::Group->new({ name => $_[0] })
-                    || die "Invalid Group ($_[0])\n";
-            },
-        },
-        {
-            name     => 'cc',
-            label    => 'Comma separated list of users to CC',
-            type     => 'string',
-            default  => '',
-            required => 1,
-            validate => sub {
-                foreach my $login (map { trim($_) } split(',', $_[0])) {
-                    Bugzilla::User->new({ name => $login })
-                        || die "Invalid User ($login)\n";
-                }
-            },
-        },
-    );
-}
-
-sub should_send {
-    my ($self, $message) = @_;
-
-    if ($message->routing_key =~ /^(?:attachment|bug)\.modify:.*\bis_private\b/) {
-        my $payload = $message->payload_decoded();
-        my $target  = $payload->{event}->{target};
-
-        if ($target ne 'bug' && exists $payload->{$target}->{bug}) {
-            return 0 if $payload->{$target}->{bug}->{is_private};
-            return 0 if $payload->{$target}->{content_type} ne RB_CONTENT_TYPE;
-        }
-
-        return $payload->{$target}->{is_private} ? 1 : 0;
-    }
-    else {
-        # We're not interested in the message.
-        return 0;
-    }
-}
-
-sub send {
-    my ($self, $message) = @_;
-    my $logger = Bugzilla->push_ext->logger;
-    my $config = $self->config;
-
-    eval {
-        my $payload = $message->payload_decoded();
-        my $target  = $payload->{event}->{target};
-
-        # load attachments
-        my $bug_id = $target eq 'bug' ? $payload->{bug}->{id} : $payload->{attachment}->{bug}->{id};
-        my $attach_id = $target eq 'attachment' ? $payload->{attachment}->{id} : undef;
-        Bugzilla->set_user(Bugzilla::User->super_user);
-        my $bug = Bugzilla::Bug->new({ id => $bug_id, cache => 1 });
-        Bugzilla->logout;
-
-        # create a bug if there are any mozreview attachments
-        my @reviews = grep { $_->contenttype eq RB_CONTENT_TYPE } @{ $bug->attachments };
-        if (@reviews) {
-
-            # build comment
-            my $comment = $target eq 'bug'
-                ? "Bug $bug_id has MozReview reviews and is no longer public."
-                : "MozReview attachment $attach_id on Bug $bug_id is no longer public.";
-            $comment .= "\n\n";
-            foreach my $attachment (@reviews) {
-                $comment .= $attachment->data . "\n";
-            }
-
-            # create bug
-            my $user = Bugzilla::User->new({ name => AUTOMATION_USER, cache => 1 });
-            die "Invalid User: " . AUTOMATION_USER . "\n" unless $user;
-            Bugzilla->set_user($user);
-            my $new_bug = Bugzilla::Bug->create({
-                short_desc   => "[SECURITY] Bug $bug_id is no longer public",
-                product      => $config->{product},
-                component    => $config->{component},
-                bug_severity => 'normal',
-                groups       => [ map { trim($_) } split(',', $config->{group}) ],
-                op_sys       => 'Unspecified',
-                rep_platform => 'Unspecified',
-                version      => $config->{version},
-                cc           => [ map { trim($_) } split(',', $config->{cc}) ],
-                comment      => $comment,
-            });
-            Bugzilla::BugMail::Send($new_bug->id, { changer => Bugzilla->user });
-            Bugzilla->logout;
-
-            $logger->info("Created bug " . $new_bug->id);
-        }
-    };
-    my $error = $@;
-    Bugzilla->logout;
-    if ($error) {
-        return (PUSH_RESULT_TRANSIENT, clean_error($error));
-    }
-
-    return PUSH_RESULT_OK;
-}
-
-1;
diff --git a/extensions/Push/t/ReviewBoard.t b/extensions/Push/t/ReviewBoard.t
deleted file mode 100644 (file)
index c752e34..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/usr/bin/perl -T
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-use strict;
-use warnings;
-use lib qw( . lib local/lib/perl5 );
-
-use Test::More;
-use Bugzilla;
-use Bugzilla::Extension;
-use Bugzilla::Attachment;
-use Scalar::Util 'blessed';
-
-BEGIN {
-    eval {
-        require Test::LWP::UserAgent;
-        require Test::MockObject;
-    };
-    if ($@) {
-        plan skip_all =>
-          'Tests require Test::LWP::UserAgent and Test::MockObject';
-        exit;
-    }
-}
-
-BEGIN {
-    Bugzilla->extensions; # load all of them
-    use_ok 'Bugzilla::Extension::Push::Connector::ReviewBoard::Client';
-    use_ok 'Bugzilla::Extension::Push::Constants';
-}
-
-my ($push) = grep { blessed($_) eq 'Bugzilla::Extension::Push' } @{Bugzilla->extensions };
-my $connectors = $push->_get_instance->connectors;
-my $con = $connectors->by_name('ReviewBoard');
-
-my $ua_204 = Test::LWP::UserAgent->new;
-$ua_204->map_response(
-                  qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
-                  HTTP::Response->new('204'));
-
-my $ua_404 = Test::LWP::UserAgent->new;
-$ua_404->map_response(
-    qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
-    HTTP::Response->new('404', undef, undef, q[{ "err": { "code": 100, "msg": "Object does not exist" }, "stat": "fail" }]));
-
-# forbidden
-my $ua_403 = Test::LWP::UserAgent->new;
-$ua_403->map_response(
-    qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
-    HTTP::Response->new('403', undef, undef, q[ {"err":{"code":101,"msg":"You don't have permission for this"},"stat":"fail"}]));
-
-# not logged in
-my $ua_401 = Test::LWP::UserAgent->new;
-$ua_401->map_response(
-    qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
-    HTTP::Response->new('401', undef, undef, q[ { "err": { "code": 103, "msg": "You are not logged in" }, "stat": "fail" } ]));
-
-# not logged in
-my $ua_500 = Test::LWP::UserAgent->new;
-$ua_500->map_response(
-    qr{https://reviewboard-dev\.allizom\.org/api/review-requests/\d+},
-    HTTP::Response->new('500'));
-
-$con->client->{useragent} = $ua_204;
-$con->config->{base_uri} = 'https://reviewboard-dev.allizom.org';
-$con->client->{base_uri} = 'https://reviewboard-dev.allizom.org';
-
-{
-    my $msg = message(
-        event => {
-            routing_key => 'attachment.modify:is_private',
-            target => 'attachment',
-        },
-        attachment => {
-            is_private => 1,
-            content_type => 'text/plain',
-            bug => { id => 1, is_private => 0 },
-        },
-    );
-
-    ok(not($con->should_send($msg)), "text/plain message should not be sent");
-}
-
-my $data = slurp("extensions/Push/t/rblink.txt");
-Bugzilla::User::DEFAULT_USER->{userid} = 42;
-Bugzilla->set_user(Bugzilla::User->super_user);
-diag " " . Bugzilla::User->super_user->id;
-
-my $dbh = Bugzilla->dbh;
-$dbh->bz_start_transaction;
-my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
-my $bug = Bugzilla::Bug->new({id => 9000});
-my $attachment = Bugzilla::Attachment->create({
-    bug         => $bug,
-    creation_ts => $timestamp,
-    data        => $data,
-    attach_size => length($data),
-    description => "rblink.txt",
-    filename    => "rblink.txt",
-    isprivate   => 1,
-    ispatch     => 0,
-    mimetype    => 'text/x-review-board-request'
-});
-diag "".$attachment->id;
-$dbh->bz_commit_transaction;
-
-{
-    my $msg = message(
-        event => {
-            routing_key => 'attachment.modify:cc,is_private',
-            target => 'attachment',
-        },
-        attachment => {
-            id => $attachment->id,
-            is_private => 1,
-            content_type => 'text/x-review-board-request',
-            bug => { id => $bug->id, is_private => 0 },
-        },
-    );
-    ok($con->should_send($msg), "rb attachment should be sent");
-
-    {
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_OK, "good push result");
-        diag $err if $err;
-    }
-
-    {
-        local $con->client->{useragent} = $ua_404;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_OK, "good push result for 404");
-        diag $err if $err;
-    }
-
-
-    {
-        local $con->client->{useragent} = $ua_403;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_TRANSIENT, "transient error on 403");
-        diag $err if $err;
-    }
-
-
-    {
-        local $con->client->{useragent} = $ua_401;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_TRANSIENT, "transient error on 401");
-        diag $err if $err;
-    }
-
-    {
-        local $con->client->{useragent} = $ua_500;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_TRANSIENT, "transient error on 500");
-        diag $err if $err;
-    }
-}
-
-{
-    my $msg = message(
-        event => {
-            routing_key => 'bug.modify:is_private',
-            target => 'bug',
-        },
-        bug => {
-            is_private => 1,
-            id => $bug->id,
-        },
-    );
-
-    ok($con->should_send($msg), "rb attachment should be sent");
-    my ($rv, $err) = $con->send($msg);
-    is($rv, PUSH_RESULT_OK, "good push result");
-
-    {
-        local $con->client->{useragent} = $ua_404;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_OK, "good push result for 404");
-    }
-
-    {
-        local $con->client->{useragent} = $ua_403;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_TRANSIENT, "transient error on 404");
-        diag $err if $err;
-    }
-
-
-    {
-        local $con->client->{useragent} = $ua_401;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_TRANSIENT, "transient error on 401");
-        diag $err if $err;
-    }
-
-    {
-        local $con->client->{useragent} = $ua_401;
-        my ($rv, $err) = $con->send($msg);
-        is($rv, PUSH_RESULT_TRANSIENT, "transient error on 401");
-        diag $err if $err;
-    }
-}
-
-sub message {
-    my $msg_data = { @_ };
-
-    return Test::MockObject->new
-        ->set_always( routing_key => $msg_data->{event}{routing_key} )
-        ->set_always( payload_decoded => $msg_data );
-}
-
-sub slurp {
-    my $file = shift;
-    local $/ = undef;
-    open my $fh, '<', $file or die "unable to open $file";
-    my $s = readline $fh;
-    close $fh;
-    return $s;
-}
-
-done_testing;
index 810b7e17e4683147508bf9eeaaeaa051ad13cebd..e4cc1cdd09ac72aabb9f668927987e3cd2a4bea7 100755 (executable)
@@ -33,10 +33,6 @@ my $params = {
     api_key     => $given_api_key,
 };
 
-if ($description && $description eq 'mozreview') {
-    $params->{app_id} = Bugzilla->params->{mozreview_app_id} // '';
-}
-
 if ($given_api_key) {
     $api_key = Bugzilla::User::APIKey->create_special($params);
 } else {
index cdbee848bc6b2a00cc9376e6b799c89e7dc9aa5c..c4b4074c1bc0e93ff64d180806cba5706c78a7c2 100644 (file)
@@ -34,25 +34,15 @@ here.</p>
     <th>Revoked</th>
   </tr>
 
-  [%# because mozreview api-keys only work for the mozreview api, we hide the
-    # key and prevent renaming #%]
   [% FOREACH api_key IN api_keys %]
     <tr[% IF api_key.revoked %] class="apikey_revoked bz_tui_hidden" style="display:none"[% END %]>
       <td>
-        [% IF api_key.is_mozreview %]
-          <i>hidden</i>
-        [% ELSE %]
-          [% api_key.api_key FILTER html %]
-        [% END %]
+        [% api_key.api_key FILTER html %]
       </td>
       <td>
-        [% IF api_key.is_mozreview %]
-            MozReview
-        [% ELSE %]
-          <input name="description_[% api_key.id FILTER html %]"
-            id="description_[% api_key.id FILTER html %]"
-            value="[% api_key.description FILTER html %]">
-        [% END %]
+        <input name="description_[% api_key.id FILTER html %]"
+          id="description_[% api_key.id FILTER html %]"
+          value="[% api_key.description FILTER html %]">
       </td>
       [% IF api_key.last_used %]
         <td>[% api_key.last_used FILTER time %]
index f83a9f83af5ddac300b87fec59c7375cbe85ee97..5e996041c33177d66d937a63a0fc20608930878f 100644 (file)
@@ -39,7 +39,6 @@
   doc_section = "attachments.html"
 %]
 
-[%# BMO hook for displaying MozReview message %]
 [% Hook.process('before_form') %]
 
 <form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data">
index 445e5fe0d1dd66e88a15abb19e9da1fcf84026fe..6a1edc163d314090d175c3ca9e4fb9551fc3e5f5 100644 (file)
   <table class="edit_form">
     <tr>
       [%# 1st Column %]
-      <td id="bz_show_bug_column_1" class="bz_show_bug_column">     
+      <td id="bz_show_bug_column_1" class="bz_show_bug_column">
         <table>
           [%# *** ID, product, component, status, resolution, Hardware, and  OS *** %]
           [% PROCESS section_status %]
-          
+
           [% PROCESS section_spacer %]
-          
+
           [% PROCESS section_details1 %]
-          
+
           [% PROCESS section_spacer %]
-          
+
           [%# *** severity, priority, version and milestone *** %]
-          [% PROCESS section_details2 %]            
-          
+          [% PROCESS section_details2 %]
+
           [%# *** assigned to and qa contact *** %]
           [% PROCESS section_people %]
-          
+
           [% PROCESS section_spacer %]
-          
+
           [% PROCESS section_url_keyword_whiteboard %]
-          
+
           [% PROCESS section_spacer %]
 
           [%# *** Dependencies and duplicates *** %]
 
           [% PROCESS section_dependson_blocks %]
 
-          [% IF user.id %]          
+          [% IF user.id %]
             <tr>
               <td colspan="2">
                 <span style="float:left">
 
   <table id="bz_big_form_parts" cellspacing="0" cellpadding="0"><tr>
   <td>
-    [%# BMO hook for adding MozReview table %]
     [% Hook.process("after_bug_data") %]
 
     [% IF user.is_timetracker %]
   [% ELSE %]
     [% PROCESS summon_comment_box %]
   [% END %]
-  
+
 
 </form>
 
   [%# That's the main table, which contains all editable fields. %]
   <div class="bz_alias_short_desc_container edit_form">
      <span class="last_comment_link">
-       <a href="#c[% bug.comments.size - 1 %]" 
+       <a href="#c[% bug.comments.size - 1 %]"
           accesskey="l"><b>L</b>ast Comment</a>
-     </span>      
+     </span>
      <a href="show_bug.cgi?id=[% bug.bug_id %]">
         [%-# %]<b>[% terms.Bug %]&nbsp;[% bug.bug_id FILTER html %]</b>
-     [%-# %]</a> -<span id="summary_alias_container" class="bz_default_hidden"> 
+     [%-# %]</a> -<span id="summary_alias_container" class="bz_default_hidden">
       [% IF Param("usebugaliases") %]
         [% IF bug.alias != "" %]
-          (<span id="alias_nonedit_display">[% bug.alias FILTER html %]</span>) 
+          (<span id="alias_nonedit_display">[% bug.alias FILTER html %]</span>)
         [% END %]
       [% END %]
       <span role="heading" aria-level="1" id="short_desc_nonedit_display">[% bug.short_desc FILTER quoteUrls(bug) FILTER wbr %]</span>
-      [% IF bug.check_can_change_field('short_desc', 0, 1) || 
+      [% IF bug.check_can_change_field('short_desc', 0, 1) ||
             bug.check_can_change_field('alias', 0, 1)  %]
         <small class="editme">(<a href="#" id="editme_action">edit</a>)</small>
       [% END %]
      </span>
-  
-       
+
+
     <div id="summary_alias_input">
-      <table id="summary"> 
+      <table id="summary">
         [% IF Param("usebugaliases") %]
           <tr>
-          [% IF bug.check_can_change_field('alias', 0, 1) %]      
+          [% IF bug.check_can_change_field('alias', 0, 1) %]
             <td>
-              <label 
-                for="alias" 
-                title="a name for the 
-                       [% terms.bug %] that can be used in place of its ID number, 
+              <label
+                for="alias"
+                title="a name for the
+                       [% terms.bug %] that can be used in place of its ID number,
                        [%%] e.g. when adding it to a list of dependencies"
                 >Alias</label>:</td><td>
           [% ELSIF bug.alias %]
           [% INCLUDE input inputname => "alias"
                      size => "40"
                      maxlength => "40"
-                     no_td => 1 
-                     %][% ")" IF NOT bug.check_can_change_field('alias', 0, 1) 
+                     no_td => 1
+                     %][% ")" IF NOT bug.check_can_change_field('alias', 0, 1)
                                   && bug.alias %]
           </td>
         </tr>
-        [% END %] 
+        [% END %]
         [%# *** Summary *** %]
         <tr>
           <td>
             value = bug.classification
             editable = bug.check_can_change_field('product', 0, 1) %]
     </tr>
-    [%###############%]    
+    [%###############%]
     [%#  Component  #%]
     [%###############%]
     <tr>
 
       [% PROCESS select selname => "version" %]
     </tr>
-    [%############%]    
+    [%############%]
     [%# PLATFORM #%]
-    [%############%]    
+    [%############%]
     <tr>
       <th class="field_label">
         <label for="rep_platform" accesskey="h">Platform</label>:
             bug = bug, field = bug_fields.rep_platform,
             no_tds = 1, value = bug.rep_platform
             editable = bug.check_can_change_field('rep_platform', 0, 1) %]
-       [%+ INCLUDE bug/field.html.tmpl 
-            bug = bug, field = bug_fields.op_sys, 
+       [%+ INCLUDE bug/field.html.tmpl
+            bug = bug, field = bug_fields.op_sys,
             no_tds = 1, value = bug.op_sys
             editable = bug.check_can_change_field('op_sys', 0, 1) %]
         [%# BMO - hook for hw/os detection from reporter %]
           [% END %]
         [% END %]
         [% IF bug.user.canedit || bug.user.isreporter %]
-          (<a href="#add_comment" 
+          (<a href="#add_comment"
               onclick="window.setTimeout(function() { document.getElementById('bug_status').focus(); }, 10)">edit</a>)
         [% END %]
       </span>
       [% INCLUDE input inputname => "status_whiteboard" size => "40" colspan => 2 %]
     </tr>
   [% END %]
-  
+
   [% IF use_keywords %]
     <tr>
       <th class="field_label">
         [% PROCESS select selname = "target_milestone" %]
       </tr>
     [% END %]
-  
+
 [% END %]
 
 [%############################################################################%]
               [% INCLUDE global/user.html.tmpl who = bug.assigned_to %]
               (<a href="#" id="bz_assignee_edit_action">edit</a>)
               [% IF bug.assigned_to.id != user.id %]
-                (<a title="Reassign to yourself" 
+                (<a title="Reassign to yourself"
                     href="#" id="bz_assignee_take_action">take</a>)
               [% END %]
             </span>
             <label id="set_default_assignee_label" for="set_default_assignee">Reset Assignee to default</label>
           </div>
           <script>
-           hideEditableField('bz_assignee_edit_container', 
-                             'bz_assignee_input', 
-                             'bz_assignee_edit_action', 
-                             'assigned_to', 
+           hideEditableField('bz_assignee_edit_container',
+                             'bz_assignee_input',
+                             'bz_assignee_edit_action',
+                             'assigned_to',
                              '[% bug.assigned_to.login FILTER js %]' );
            hideEditableField('bz_assignee_edit_container',
                              'bz_assignee_input',
                              'assigned_to',
                              '[% bug.assigned_to.login FILTER js %]',
                              '[% user.login FILTER js %]' );
-           initDefaultCheckbox('assignee');                  
+           initDefaultCheckbox('assignee');
           </script>
         [% ELSE %]
           [% INCLUDE global/user.html.tmpl who = bug.assigned_to %]
               [% INCLUDE global/user.html.tmpl who = bug.qa_contact %]
               (<a href="#" id="bz_qa_contact_edit_action">edit</a>)
               [% IF bug.qa_contact.id != user.id %]
-                (<a title="Change QA contact to yourself" 
+                (<a title="Change QA contact to yourself"
                     href="#" id="bz_qa_contact_take_action">take</a>)
               [% END %]
             </span>
             <label for="set_default_qa_contact" id="set_default_qa_contact_label">Reset QA Contact to default</label>
           </div>
           <script>
-            hideEditableField('bz_qa_contact_edit_container', 
-                              'bz_qa_contact_input', 
-                              'bz_qa_contact_edit_action', 
-                              'qa_contact', 
+            hideEditableField('bz_qa_contact_edit_container',
+                              'bz_qa_contact_input',
+                              'bz_qa_contact_edit_action',
+                              'qa_contact',
                               '[% bug.qa_contact.login FILTER js %]');
-            hideEditableField('bz_qa_contact_edit_container', 
-                              'bz_qa_contact_input', 
-                              'bz_qa_contact_take_action', 
-                              'qa_contact', 
+            hideEditableField('bz_qa_contact_edit_container',
+                              'bz_qa_contact_input',
+                              'bz_qa_contact_take_action',
+                              'qa_contact',
                               '[% bug.qa_contact.login FILTER js %]',
                               '[% user.login FILTER js %]');
             initDefaultCheckbox('qa_contact');
     %]
     <td>
       [% IF bug.check_can_change_field("bug_file_loc", 0, 1) %]
-        <span id="bz_url_edit_container" class="bz_default_hidden"> 
+        <span id="bz_url_edit_container" class="bz_default_hidden">
           <a href="[% bug.bug_file_loc FILTER html %]" target="_blank"
             rel="noreferrer" title="[% bug.bug_file_loc FILTER html %]"
             [% IF NOT is_safe_url(bug.bug_file_loc) %]
       </span>
       [% IF bug.check_can_change_field("bug_file_loc", 0, 1) %]
         <script>
-          hideEditableField('bz_url_edit_container', 
-                            'bz_url_input_area', 
-                            'bz_url_edit_action', 
-                            'bug_file_loc', 
+          hideEditableField('bz_url_edit_container',
+                            'bz_url_input_area',
+                            'bz_url_edit_action',
+                            'bug_file_loc',
                             "[% bug.bug_file_loc FILTER js %]");
         </script>
       [% END %]
 
 [% BLOCK section_dependson_blocks %]
   <tr>
-    [% INCLUDE dependencies 
+    [% INCLUDE dependencies
          field = bug_fields.dependson deps = bug.depends_on_obj %]
   </tr>
-  
+
   <tr>
-    [% INCLUDE dependencies 
+    [% INCLUDE dependencies
          field = bug_fields.blocked deps = bug.blocks_obj %]
-  
+
   <tr>
     <th>&nbsp;</th>
-  
+
     <td colspan="2" align="left" id="show_dependency_tree_or_graph">
       Show dependency <a href="showdependencytree.cgi?id=[% bug.bug_id %]&amp;hide_resolved=1">tree</a>
-  
+
       [% IF Param('webdotbase') %]
         /&nbsp;<a href="showdependencygraph.cgi?id=[% bug.bug_id %]">graph</a>
       [% END %]
       [% IF NOT emitted_description %]
         [% emitted_description = 1 %]
           <div id="bz_restrict_group_visibility_help">
-            <b>Only users in all of the selected groups can view this 
+            <b>Only users in all of the selected groups can view this
               [%+ terms.bug %]:</b>
              <p class="instructions">
                Unchecking all boxes makes this a more public [% terms.bug %].
       [% END %]
 
       [% IF group.ingroup %]
-        <input type="hidden" name="defined_groups" 
+        <input type="hidden" name="defined_groups"
                value="[% group.name FILTER html %]">
       [% END %]
 
 
     [% IF emitted_description %]
       [% IF NOT inallgroups %]
-        <p class="instructions">Only members of a group can change the 
+        <p class="instructions">Only members of a group can change the
           visibility of [% terms.abug %] for that group.</p>
       [% END %]
     [% END %]
 
     [% IF inagroup %]
       <div id="bz_enable_role_visibility_help">
-        <b>Users in the roles selected below can always view 
+        <b>Users in the roles selected below can always view
           this [% terms.bug %]:</b>
       </div>
       <div id="bz_enable_role_visibility">
         <div>
-          [% user_can_edit_accessible = 
-            bug.check_can_change_field("reporter_accessible", 0, 1) 
+          [% user_can_edit_accessible =
+            bug.check_can_change_field("reporter_accessible", 0, 1)
           %]
           [% IF user_can_edit_accessible %]
             <input type="hidden" name="defined_reporter_accessible" value="1">
           <label for="reporter_accessible">Reporter</label>
         </div>
         <div>
-          [% user_can_edit_accessible = 
-            bug.check_can_change_field("cclist_accessible", 0, 1) 
+          [% user_can_edit_accessible =
+            bug.check_can_change_field("cclist_accessible", 0, 1)
           %]
           [% IF user_can_edit_accessible %]
             <input type="hidden" name="defined_cclist_accessible" value="1">
      [% bug.creation_ts FILTER time("%Y-%m-%d %H:%M %Z") %] by [% INCLUDE global/user.html.tmpl who = bug.reporter %]
     </td>
   </tr>
-  
+
   <tr>
     <th class="field_label">
       Modified:
       [% bug.delta_ts FILTER time("%Y-%m-%d %H:%M %Z") %]
       (<a href="show_activity.cgi?id=[% bug.bug_id %]">[%# terms.Bug %]History</a>)
     </td>
-  
+
   </tr>
 [% END %]
 
                       || (!has_role
                           && user.settings.state_addselfcc.value == 'cc_unless_role') %]>
             <label for="addselfcc">Add me to CC list</label>
-            <br> 
+            <br>
           [% END %]
         [% END %]
-        [% bug.cc.size || 0  FILTER html %] 
+        [% bug.cc.size || 0  FILTER html %]
         [% IF bug.cc.size == 1 %]
           user
         [% ELSE %]
             (<a href="#" id="cc_edit_area_showhide">[% IF user.id %]edit[% ELSE %]show[% END %]</a>)
           [% IF user.id && bug.cc.size %]
             <br>
-            <ul class="cc_list_display"> 
+            <ul class="cc_list_display">
               [% FOREACH c = bug.cc %]
                 <li>[% c FILTER email FILTER html %]</li>
               [% END %]
         </div>
         [% IF user.id || bug.cc.size %]
           <script>
-            hideEditableField( 'cc_edit_area_showhide_container', 
-                               'cc_edit_area', 
-                               'cc_edit_area_showhide', 
-                               '', 
-                               '');  
+            hideEditableField( 'cc_edit_area_showhide_container',
+                               'cc_edit_area',
+                               'cc_edit_area_showhide',
+                               '',
+                               '');
           </script>
         [% END %]
       </td>
 [% BLOCK section_see_also %]
   [% IF Param('use_see_also') || bug.see_also.size %]
     <tr>
-      [% INCLUDE bug/field.html.tmpl 
+      [% INCLUDE bug/field.html.tmpl
            field    = bug_fields.see_also
            value    = bug.see_also
            editable = bug.check_can_change_field('see_also', 0, 1)
                     YAHOO.util.Dom.removeClass(rows[i], 'bz_default_hidden');
                 }
                 YAHOO.util.Event.preventDefault(e);
-            }); 
+            });
           </script>
         [% END %]
       </td>
   <td>
     <span id="[% field.name FILTER html %]_input_area">
       [% IF bug.check_can_change_field(field.name, 0, 1) %]
-        <input name="[% field.name FILTER html %]" 
+        <input name="[% field.name FILTER html %]"
                id="[% field.name FILTER html %]" class="text_input"
                value="[% bug.${field.name}.join(', ') FILTER html %]">
       [% END %]
     </span>
-    
+
     [% FOREACH dep_bug = deps %]
       [% dep_bug.id FILTER bug_link(dep_bug, use_alias => 1)
                     FILTER none %][% " " %]
     [% END %]
     [% IF bug.check_can_change_field(field.name, 0, 1) %]
-      <span id="[% field.name FILTER html %]_edit_container" 
+      <span id="[% field.name FILTER html %]_edit_container"
             class="edit_me bz_default_hidden">
         (<a href="#" id="[% field.name FILTER html %]_edit_action">edit</a>)
       </span>
       <script>
-        hideEditableField('[% field.name FILTER js %]_edit_container', 
-                          '[% field.name FILTER js %]_input_area', 
-                          '[% field.name FILTER js %]_edit_action', 
-                          '[% field.name FILTER js %]', 
+        hideEditableField('[% field.name FILTER js %]_edit_container',
+                          '[% field.name FILTER js %]_input_area',
+                          '[% field.name FILTER js %]_edit_action',
+                          '[% field.name FILTER js %]',
                           '[% bug.${field.name}.join(', ') FILTER js %]');
       </script>
     [% END %]
   </td>
-  
+
 [% END %]
 
 [%############################################################################%]
          [% INCLUDE bug/field.html.tmpl
            field = bug_fields.deadline, value = bug.deadline, no_tds = 1
            editable = bug.check_can_change_field('deadline', 0, 1) %]
-      </td>        
+      </td>
     </tr>
     <tr>
       <td colspan="7" class="bz_summarize_time">
         blocking this [% terms.bug %])</a>
       </td>
     </tr>
-  </table> 
+  </table>
 [% END %]
 
 [%############################################################################%]
 [% BLOCK comment_box %]
   <div id="add_comment" class="bz_section_additional_comments">
     [% IF user.id %]
-      <label for="comment" accesskey="c"><b>Additional 
+      <label for="comment" accesskey="c"><b>Additional
         <u>C</u>omments</b></label>:
 
       [% IF user.is_insider && bug.check_can_change_field('longdesc', 0, 1) %]
               before you can comment on or make changes to this [% terms.bug %].
             </fieldset>
           </td>
-        </tr> 
+        </tr>
       </table>
     [% END %]
   </div>
 
 [% BLOCK select %]
   <td>
-    [% IF bug.check_can_change_field(selname, 0, 1) 
+    [% IF bug.check_can_change_field(selname, 0, 1)
           AND bug.choices.${selname}.size > 1 %]
       <input type="hidden" id="[% selname %]_dirty">
       <select id="[% selname %]" name="[% selname %]">
         [% val FILTER html %]
       [% END %]
     [% END %]
-  [% IF no_td != 1 %]  
+  [% IF no_td != 1 %]
   </td>
   [% END %]
 [% END %]
 [% BLOCK commit_button %]
   [% IF user.id %]
     <div class="knob-buttons">
-      <input type="submit" value="Save Changes" 
+      <input type="submit" value="Save Changes"
              id="commit[% id FILTER css_class_quote %]">
     </div>
   [% END %]
index aed904def96f8287801fd939f866e97795d199af..9ab13d90b55eac64ff6933eedc7c28061e94ec97 100644 (file)
@@ -26,10 +26,7 @@ or update the key at the following URL:
 
 [%+ urlbase %]userprefs.cgi?tab=apikey
 
-[% IF new_key.app_id == Param('mozreview_app_id') %]
-This API key was automatically created by MozReview. If you did not recently log in to
-MozReview, please disable the key at the above URL, and change your password immediately.
-[% ELSIF new_key.app_id == Param('phabricator_app_id') %]
+[% IF new_key.app_id == Param('phabricator_app_id') %]
 This API key was automatically created by Mozilla's Phabricator instance. If you did not recently
 log in to Phabricator, please disable the key at the above URL, and change your password immediately.
 [% ELSE %]