]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1277863 - Add crash signature field for "External Software Affecting Firefox...
authorDylan Hardison <dylan@mozilla.com>
Fri, 3 Jun 2016 20:51:40 +0000 (16:51 -0400)
committerDylan Hardison <dylan@mozilla.com>
Fri, 3 Jun 2016 20:52:00 +0000 (16:52 -0400)
extensions/BMO/Extension.pm
extensions/BMO/lib/Data.pm
extensions/BMO/template/en/default/hook/admin/sanitycheck/messages-statuses.html.tmpl [new file with mode: 0644]
sanitycheck.cgi

index 75b8df456606cdc87b7198122ebf29d67972aa10..5a9f8c4fad6189430e909d663a5bdba3129f76c0 100644 (file)
@@ -965,6 +965,22 @@ sub bug_end_of_create {
     }
 }
 
+sub sanitycheck_check {
+    my ($self, $args) = @_;
+
+    my $dbh = Bugzilla->dbh;
+    my $status = $args->{'status'};
+    $status->('bmo_check_cf_visible_in_products');
+
+    my $products = $dbh->selectcol_arrayref('SELECT name FROM products');
+    my %product = map { $_ => 1 } @$products;
+    my @cf_products = map { keys %$_ } values %$cf_visible_in_products;
+    foreach my $cf_product (@cf_products) {
+        $status->('bmo_check_cf_visible_in_products_missing',
+                  { cf_product => $cf_product }, 'alert') unless $product{$cf_product};
+    }
+}
+
 sub db_sanitize {
     print "deleting reporter's user-agents...\n";
     Bugzilla->dbh->do("TRUNCATE TABLE bug_user_agent");
index 348755d22161ca3eba737f418a47b743be0f3c76..d075cd515f7101f2e6c7527365db5f1ca3e74a66 100644 (file)
@@ -77,11 +77,10 @@ tie(%$cf_visible_in_products, "Tie::IxHash",
         "Android Background Services" => [],
         "B2GDroid"                    => [],
         "Calendar"                    => [],
-        "Camino"                      => [],
         "Composer"                    => [],
         "Core"                        => [],
         "Directory"                   => [],
-        "Fennec"                      => [],
+        "External Software Affecting Firefox" => [],
         "Firefox"                     => [],
         "Firefox for Android"         => [],
         "Firefox for Metro"           => [],
@@ -96,7 +95,6 @@ tie(%$cf_visible_in_products, "Tie::IxHash",
         "NSS"                         => [],
         "Other Applications"          => [],
         "Penelope"                    => [],
-        "Plugins"                     => [],
         "Release Engineering"         => [],
         "Rhino"                       => [],
         "SeaMonkey"                   => [],
diff --git a/extensions/BMO/template/en/default/hook/admin/sanitycheck/messages-statuses.html.tmpl b/extensions/BMO/template/en/default/hook/admin/sanitycheck/messages-statuses.html.tmpl
new file mode 100644 (file)
index 0000000..dddfb1c
--- /dev/null
@@ -0,0 +1,15 @@
+[%# 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 san_tag == "bmo_check_cf_visible_in_products" %]
+  Checking $cf_visibile_in_products for missing product names.
+
+[% ELSIF san_tag == "bmo_check_cf_visible_in_products_missing" %]
+  ... there are custom fields for [% cf_product FILTER html %] but it does not exist!
+
+[% END %]
\ No newline at end of file
index f718312f4bf6a19f66f196ec112512964e1a6e28..5acf79f069c56d9dba6056350193978f8baad187 100755 (executable)
@@ -72,6 +72,7 @@ my $user = Bugzilla->login(LOGIN_REQUIRED);
 
 my $cgi = Bugzilla->cgi;
 my $dbh = Bugzilla->dbh;
+my $hooks_only = $cgi->param('hooks_only');
 # If the result of the sanity check is sent per email, then we have to
 # take the user prefs into account rather than querying the web browser.
 my $template;
@@ -84,7 +85,7 @@ else {
     # Only check the token if we are running this script from the
     # web browser and a parameter is passed to the script.
     # XXX - Maybe these two parameters should be deleted once logged in?
-    $cgi->delete('GoAheadAndLogIn', 'Bugzilla_restrictlogin');
+    $cgi->delete('GoAheadAndLogIn', 'Bugzilla_restrictlogin', 'hooks_only');
     if (scalar($cgi->param())) {
         my $token = $cgi->param('token');
         check_hash_token($token, ['sanitycheck']);
@@ -108,6 +109,8 @@ unless (Bugzilla->usage_mode == USAGE_MODE_CMDLINE) {
       || ThrowTemplateError($template->error());
 }
 
+goto REPAIR_HOOKS if $hooks_only;
+
 ###########################################################################
 # Create missing group_control_map entries
 ###########################################################################
@@ -379,8 +382,11 @@ Bugzilla->memcached->clear_all() if $clear_memcached;
 # Repair hook
 ###########################################################################
 
+REPAIR_HOOKS:
+
 Bugzilla::Hook::process('sanitycheck_repair', { status => \&Status });
 
+goto CHECK_HOOKS if $hooks_only;
 ###########################################################################
 # Checks
 ###########################################################################
@@ -924,7 +930,7 @@ Status('whines_obsolete_target_fix') if $display_repair_whines_link;
 ###########################################################################
 # Check hook
 ###########################################################################
-
+CHECK_HOOKS:
 Bugzilla::Hook::process('sanitycheck_check', { status => \&Status });
 
 ###########################################################################