summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-12-17 06:05:20 +0100
committerByron Jones <bjones@mozilla.com>2013-12-17 06:05:20 +0100
commit265ab8e14b94e51a56a1bb16aa536cedbfe56ad6 (patch)
treeadca331bf0c66d8055c0bef719f9d360fc237a94
parent0f628400eae59b7394f3202306e48e64be76b273 (diff)
downloadbugzilla-265ab8e14b94e51a56a1bb16aa536cedbfe56ad6.tar.gz
bugzilla-265ab8e14b94e51a56a1bb16aa536cedbfe56ad6.tar.xz
Bug 908427: Once tracking flags are migrated, remove any unnecessary code in Bugzilla::Extension::BMO::Data used in the old tracking flags
-rw-r--r--extensions/BMO/Extension.pm4
-rw-r--r--extensions/BMO/lib/Data.pm325
-rw-r--r--extensions/BMO/lib/Util.pm7
3 files changed, 13 insertions, 323 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 0542b4485..da239dac8 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -358,9 +358,9 @@ sub bug_check_can_change_field {
if ($field =~ /^cf/ && !@$priv_results && $new_value ne '---') {
# "other" custom field setters restrictions
- if (exists $other_setters->{$field}) {
+ if (exists $cf_setters->{$field}) {
my $in_group = 0;
- foreach my $group (@{$other_setters->{$field}}) {
+ foreach my $group (@{$cf_setters->{$field}}) {
if ($user->in_group($group, $bug->product_id)) {
$in_group = 1;
last;
diff --git a/extensions/BMO/lib/Data.pm b/extensions/BMO/lib/Data.pm
index 2c8e0bcb4..05fb51e27 100644
--- a/extensions/BMO/lib/Data.pm
+++ b/extensions/BMO/lib/Data.pm
@@ -1,26 +1,9 @@
-# -*- Mode: perl; indent-tabs-mode: nil -*-
+# 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/.
#
-# 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 BMO Bugzilla Extension.
-#
-# The Initial Developer of the Original Code is the Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2010 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Gervase Markham <gerv@gerv.net>
-# Reed Loden <reed@reedloden.com>
-
-# XXX most of the data in this file is no longer used
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
package Bugzilla::Extension::BMO::Data;
use strict;
@@ -29,14 +12,8 @@ use base qw(Exporter);
use Tie::IxHash;
our @EXPORT = qw( $cf_visible_in_products
- $cf_flags $cf_project_flags
- $cf_disabled_flags
%group_change_notification
- $blocking_trusted_setters
- $blocking_trusted_requesters
- $status_trusted_wanters
- $status_trusted_setters
- $other_setters
+ $cf_setters
@always_fileable_groups
%group_auto_cc
%product_sec_groups
@@ -51,102 +28,13 @@ use constant RB_REQUEST_CONTENT_TYPE => 'text/x-review-board-request';
# Which custom fields are visible in which products and components.
#
# By default, custom fields are visible in all products. However, if the name
-# of the field matches any of these regexps, it is only visible if the
+# of the field matches any of these regexps, it is only visible if the
# product (and component if necessary) is a member of the attached hash. []
# for component means "all".
#
# IxHash keeps them in insertion order, and so we get regexp priorities right.
our $cf_visible_in_products;
tie(%$cf_visible_in_products, "Tie::IxHash",
- qw/^cf_blocking_kilimanjaro|cf_blocking_basecamp|cf_blocking_b2g/ => {
- "Firefox OS" => [],
- "Core" => [],
- "Fennec" => [],
- "Firefox" => [],
- "Firefox for Android" => [],
- "Firefox for Metro" => [],
- "Firefox Health Report" => [],
- "Marketplace" => [],
- "Mozilla Localizations" => [],
- "mozilla.org" => [],
- "Mozilla Services" => [],
- "NSPR" => [],
- "NSS" => [],
- "Release Engineering" => [],
- "Socorro" => [],
- "Tech Evangelism" => [],
- "Testing" => [],
- "Thunderbird" => [],
- "Toolkit" => [],
- "Tracking" => [],
- "Web Apps" => [],
- },
- qr/^cf_blocking_fennec/ => {
- "addons.mozilla.org" => [],
- "Android Background Services" => [],
- "AUS" => [],
- "Core" => [],
- "Fennec" => [],
- "Firefox for Android" => [],
- "Firefox Health Report" => [],
- "Marketing" => ["General"],
- "Mozilla Localizations" => [],
- "Mozilla Services" => [],
- "NSPR" => [],
- "Release Engineering" => [],
- "support.mozilla.org" => [],
- "Tech Evangelism" => [],
- "Testing" => ["General"],
- "Toolkit" => [],
- "Tracking" => []
- },
- qr/^cf_tracking_thunderbird|cf_blocking_thunderbird|cf_status_thunderbird/ => {
- "support.mozillamessaging.com" => [],
- "Thunderbird" => [],
- "MailNews Core" => [],
- "Mozilla Messaging" => [],
- "Websites" => ["www.mozillamessaging.com"],
- },
- qr/^(cf_(blocking|tracking)_seamonkey|cf_status_seamonkey)/ => {
- "Composer" => [],
- "MailNews Core" => [],
- "Mozilla Localizations" => [],
- "Other Applications" => [],
- "SeaMonkey" => [],
- },
- qr/^cf_blocking_|cf_tracking_|cf_status/ => {
- "Add-on SDK" => [],
- "addons.mozilla.org" => [],
- "AUS" => [],
- "Firefox OS" => [],
- "Core" => [],
- "Core Graveyard" => [],
- "Directory" => [],
- "Fennec" => [],
- "Firefox" => [],
- "Firefox for Android" => [],
- "Firefox for Metro" => [],
- "Firefox Health Report" => [],
- "MailNews Core" => [],
- "Mozilla Localizations" => [],
- "Mozilla QA" => ["Mozmill Tests"],
- "Mozilla Services" => [],
- "NSPR" => [],
- "NSS" => [],
- "Other Applications" => [],
- "Plugins" => [],
- "Release Engineering" => [],
- "SeaMonkey" => [],
- "Snippets" => [],
- "Socorro" => [],
- "support.mozilla.org" => [],
- "Tech Evangelism" => [],
- "Testing" => [],
- "Toolkit" => [],
- "Websites" => ["getpersonas.com"],
- "Webtools" => [],
- "www.mozilla.org" => [],
- },
qr/^cf_colo_site$/ => {
"mozilla.org" => [
"Server Operations",
@@ -214,161 +102,9 @@ tie(%$cf_visible_in_products, "Tie::IxHash",
},
);
-# Which custom fields are acting as flags (ie. custom flags)
-our $cf_flags = [
- qr/^cf_(?:blocking|tracking|status)_/,
-];
-
-our $cf_project_flags = [
- 'cf_blocking_kilimanjaro',
- 'cf_blocking_b2g',
- 'cf_blocking_basecamp',
-];
-
-# List of disabled fields.
-# Temp kludge until custom fields can be disabled correctly upstream.
-# Disabled fields are hidden unless they have a value set
-our $cf_disabled_flags = [
- 'cf_blocking_20',
- 'cf_status_20',
- 'cf_blocking_basecamp',
- 'cf_tracking_firefox5',
- 'cf_status_firefox5',
- 'cf_blocking_thunderbird32',
- 'cf_status_thunderbird32',
- 'cf_blocking_thunderbird30',
- 'cf_status_thunderbird30',
- 'cf_blocking_seamonkey21',
- 'cf_status_seamonkey21',
- 'cf_tracking_seamonkey22',
- 'cf_status_seamonkey22',
- 'cf_tracking_firefox6',
- 'cf_status_firefox6',
- 'cf_tracking_thunderbird6',
- 'cf_status_thunderbird6',
- 'cf_tracking_seamonkey23',
- 'cf_status_seamonkey23',
- 'cf_tracking_firefox7',
- 'cf_status_firefox7',
- 'cf_tracking_thunderbird7',
- 'cf_status_thunderbird7',
- 'cf_tracking_seamonkey24',
- 'cf_status_seamonkey24',
- 'cf_tracking_firefox8',
- 'cf_status_firefox8',
- 'cf_tracking_thunderbird8',
- 'cf_status_thunderbird8',
- 'cf_tracking_seamonkey25',
- 'cf_status_seamonkey25',
- 'cf_blocking_191',
- 'cf_status_191',
- 'cf_blocking_thunderbird33',
- 'cf_status_thunderbird33',
- 'cf_tracking_firefox9',
- 'cf_status_firefox9',
- 'cf_tracking_thunderbird9',
- 'cf_status_thunderbird9',
- 'cf_tracking_seamonkey26',
- 'cf_status_seamonkey26',
- 'cf_tracking_firefox10',
- 'cf_status_firefox10',
- 'cf_tracking_thunderbird10',
- 'cf_status_thunderbird10',
- 'cf_tracking_seamonkey27',
- 'cf_status_seamonkey27',
- 'cf_tracking_firefox11',
- 'cf_status_firefox11',
- 'cf_tracking_thunderbird11',
- 'cf_status_thunderbird11',
- 'cf_tracking_seamonkey28',
- 'cf_status_seamonkey28',
- 'cf_tracking_firefox12',
- 'cf_status_firefox12',
- 'cf_tracking_thunderbird12',
- 'cf_status_thunderbird12',
- 'cf_tracking_seamonkey29',
- 'cf_status_seamonkey29',
- 'cf_blocking_192',
- 'cf_status_192',
- 'cf_blocking_fennec10',
- 'cf_tracking_firefox13',
- 'cf_status_firefox13',
- 'cf_tracking_thunderbird13',
- 'cf_status_thunderbird13',
- 'cf_tracking_seamonkey210',
- 'cf_status_seamonkey210',
- 'cf_tracking_firefox14',
- 'cf_status_firefox14',
- 'cf_tracking_thunderbird14',
- 'cf_status_thunderbird14',
- 'cf_tracking_seamonkey211',
- 'cf_status_seamonkey211',
- 'cf_tracking_firefox15',
- 'cf_status_firefox15',
- 'cf_tracking_thunderbird15',
- 'cf_status_thunderbird15',
- 'cf_tracking_seamonkey212',
- 'cf_status_seamonkey212',
- 'cf_tracking_firefox16',
- 'cf_status_firefox16',
- 'cf_tracking_thunderbird16',
- 'cf_status_thunderbird16',
- 'cf_tracking_seamonkey213',
- 'cf_status_seamonkey213',
- 'cf_tracking_firefox17',
- 'cf_status_firefox17',
- 'cf_tracking_thunderbird17',
- 'cf_status_thunderbird17',
- 'cf_tracking_seamonkey214',
- 'cf_status_seamonkey214',
- 'cf_tracking_esr10',
- 'cf_status_esr10',
- 'cf_tracking_thunderbird_esr10',
- 'cf_status_thunderbird_esr10',
- 'cf_blocking_kilimanjaro',
- 'cf_tracking_firefox18',
- 'cf_status_firefox18',
- 'cf_tracking_thunderbird18',
- 'cf_status_thunderbird18',
- 'cf_tracking_seamonkey215',
- 'cf_status_seamonkey215',
- 'cf_tracking_firefox19',
- 'cf_status_firefox19',
- 'cf_tracking_thunderbird19',
- 'cf_status_thunderbird19',
- 'cf_tracking_seamonkey216',
- 'cf_status_seamonkey216',
- 'cf_tracking_firefox20',
- 'cf_status_firefox20',
- 'cf_tracking_thunderbird20',
- 'cf_status_thunderbird20',
- 'cf_tracking_seamonkey217',
- 'cf_status_seamonkey217',
- 'cf_tracking_firefox21',
- 'cf_status_firefox21',
- 'cf_tracking_thunderbird21',
- 'cf_status_thunderbird21',
- 'cf_tracking_seamonkey218',
- 'cf_status_seamonkey218',
- 'cf_tracking_firefox22',
- 'cf_status_firefox22',
- 'cf_tracking_thunderbird22',
- 'cf_status_thunderbird22',
- 'cf_tracking_seamonkey219',
- 'cf_status_seamonkey219',
- 'cf_tracking_firefox23',
- 'cf_status_firefox23',
- 'cf_tracking_thunderbird23',
- 'cf_status_thunderbird23',
- 'cf_tracking_seamonkey220',
- 'cf_status_seamonkey220',
- 'cf_status_b2g18_1_0_0',
- 'cf_status_b2g18_1_0_1',
-];
-
# Who to CC on particular bugmails when certain groups are added or removed.
our %group_change_notification = (
- 'addons-security' => ['amo-editors@mozilla.org'],
+ 'addons-security' => ['amo-editors@mozilla.org'],
'bugzilla-security' => ['security@bugzilla.org'],
'client-services-security' => ['amo-admins@mozilla.org', 'web-security@mozilla.org'],
'core-security' => ['security@mozilla.org'],
@@ -378,47 +114,8 @@ our %group_change_notification = (
'webtools-security' => ['web-security@mozilla.org'],
);
-# Only users in certain groups can change certain custom fields in
-# certain ways.
-#
-# Who can set cf_blocking_* or cf_tracking_* to +/-
-our $blocking_trusted_setters = {
- 'cf_blocking_fennec' => 'fennec-drivers',
- 'cf_blocking_20' => 'mozilla-next-drivers',
- qr/^cf_tracking_firefox/ => 'mozilla-next-drivers',
- qr/^cf_blocking_thunderbird/ => 'thunderbird-drivers',
- qr/^cf_tracking_thunderbird/ => 'thunderbird-drivers',
- qr/^cf_tracking_seamonkey/ => 'seamonkey-council',
- qr/^cf_blocking_seamonkey/ => 'seamonkey-council',
- qr/^cf_blocking_kilimanjaro/ => 'kilimanjaro-drivers',
- qr/^cf_blocking_basecamp/ => 'kilimanjaro-drivers',
- qr/^cf_tracking_b2g/ => 'kilimanjaro-drivers',
- qr/^cf_blocking_b2g/ => 'kilimanjaro-drivers',
- '_default' => 'mozilla-stable-branch-drivers',
-};
-
-# Who can request cf_blocking_* or cf_tracking_*
-our $blocking_trusted_requesters = {
- qr/^cf_blocking_thunderbird/ => 'thunderbird-trusted-requesters',
- '_default' => 'everyone',
-};
-
-# Who can set cf_status_* to "wanted"?
-our $status_trusted_wanters = {
- 'cf_status_20' => 'mozilla-next-drivers',
- qr/^cf_status_thunderbird/ => 'thunderbird-drivers',
- qr/^cf_status_seamonkey/ => 'seamonkey-council',
- '_default' => 'mozilla-stable-branch-drivers',
-};
-
-# Who can set cf_status_* to values other than "wanted"?
-our $status_trusted_setters = {
- qr/^cf_status_thunderbird/ => 'editbugs',
- '_default' => 'canconfirm',
-};
-
-# Who can set other custom flags (use full field names only, not regex's)
-our $other_setters = {
+# Who can set custom flags (use full field names only, not regex's)
+our $cf_setters = {
'cf_colo_site' => ['infra', 'build'],
};
@@ -508,7 +205,7 @@ our %group_auto_cc = (
);
# Force create-bug template by product
-# Users in 'include' group will be fored into using the form.
+# Users in 'include' group will be forced into using the form.
our %create_bug_formats = (
'Mozilla Developer Network' => {
'format' => 'mdn',
diff --git a/extensions/BMO/lib/Util.pm b/extensions/BMO/lib/Util.pm
index 4da02081e..df781b9d2 100644
--- a/extensions/BMO/lib/Util.pm
+++ b/extensions/BMO/lib/Util.pm
@@ -11,7 +11,6 @@ use warnings;
use Bugzilla::Constants;
use Bugzilla::Error;
-use Bugzilla::Extension::BMO::Data qw($cf_disabled_flags);
use Date::Parse;
use DateTime;
@@ -85,12 +84,6 @@ sub is_active_status_field {
return $field->is_active;
}
- if ($field->type != FIELD_TYPE_EXTENSION
- && $field->name =~ /^cf_status/
- ) {
- return !grep { $field->name eq $_ } @$cf_disabled_flags
- }
-
return 0;
}