From b0ecd52c839cd8aba5b458c3fc6a3adf746ffa3c Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Sun, 5 Jul 2026 01:16:12 -0400 Subject: [PATCH 1/3] Bug 2052696: Fix 002goodperl test failures --- extensions/Example/template/en/default/setup/strings.txt.pl | 4 ++++ extensions/OldBugMove/Config.pm | 4 ++++ extensions/OldBugMove/Extension.pm | 4 ++++ extensions/OldBugMove/lib/Params.pm | 2 ++ extensions/ShadowBugs/Config.pm | 3 +++ extensions/ShadowBugs/Extension.pm | 2 ++ 6 files changed, 19 insertions(+) diff --git a/extensions/Example/template/en/default/setup/strings.txt.pl b/extensions/Example/template/en/default/setup/strings.txt.pl index 6ee4b5fdcc..d703aae8d4 100644 --- a/extensions/Example/template/en/default/setup/strings.txt.pl +++ b/extensions/Example/template/en/default/setup/strings.txt.pl @@ -17,6 +17,10 @@ # Contributor(s): # Max Kanat-Alexander +use 5.10.1; +use strict; +use warnings; + %strings = (feature_example_acme => 'Example Extension: Acme Feature',); 1; diff --git a/extensions/OldBugMove/Config.pm b/extensions/OldBugMove/Config.pm index e401260469..6e434bf203 100644 --- a/extensions/OldBugMove/Config.pm +++ b/extensions/OldBugMove/Config.pm @@ -20,6 +20,10 @@ # Max Kanat-Alexander package Bugzilla::Extension::OldBugMove; + +use 5.10.1; use strict; +use warnings; + use constant NAME => 'OldBugMove'; __PACKAGE__->NAME; diff --git a/extensions/OldBugMove/Extension.pm b/extensions/OldBugMove/Extension.pm index aa3d1aab0e..a54789d485 100644 --- a/extensions/OldBugMove/Extension.pm +++ b/extensions/OldBugMove/Extension.pm @@ -20,7 +20,11 @@ # Max Kanat-Alexander package Bugzilla::Extension::OldBugMove; + +use 5.10.1; use strict; +use warnings; + use base qw(Bugzilla::Extension); use Bugzilla::Constants; use Bugzilla::Error; diff --git a/extensions/OldBugMove/lib/Params.pm b/extensions/OldBugMove/lib/Params.pm index cea3fecf66..43db99358e 100644 --- a/extensions/OldBugMove/lib/Params.pm +++ b/extensions/OldBugMove/lib/Params.pm @@ -31,7 +31,9 @@ package Bugzilla::Extension::OldBugMove::Params; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/extensions/ShadowBugs/Config.pm b/extensions/ShadowBugs/Config.pm index a45948dd4a..6efa5fc165 100644 --- a/extensions/ShadowBugs/Config.pm +++ b/extensions/ShadowBugs/Config.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::ShadowBugs; + +use 5.10.1; use strict; +use warnings; use constant NAME => 'ShadowBugs'; use constant REQUIRED_MODULES => []; diff --git a/extensions/ShadowBugs/Extension.pm b/extensions/ShadowBugs/Extension.pm index a1eb4a8c10..07288e9e1f 100644 --- a/extensions/ShadowBugs/Extension.pm +++ b/extensions/ShadowBugs/Extension.pm @@ -7,7 +7,9 @@ package Bugzilla::Extension::ShadowBugs; +use 5.10.1; use strict; +use warnings; use base qw(Bugzilla::Extension); From 540354ef9a2b3c7a843798daf8fed19d724c35ca Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Thu, 9 Jul 2026 08:01:25 -0400 Subject: [PATCH 2/3] Avoid a conflict with #168 --- extensions/Example/template/en/default/setup/strings.txt.pl | 2 +- extensions/OldBugMove/Config.pm | 2 +- extensions/OldBugMove/Extension.pm | 2 +- extensions/OldBugMove/lib/Params.pm | 2 +- extensions/ShadowBugs/Config.pm | 2 +- extensions/ShadowBugs/Extension.pm | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/Example/template/en/default/setup/strings.txt.pl b/extensions/Example/template/en/default/setup/strings.txt.pl index d703aae8d4..452a814e95 100644 --- a/extensions/Example/template/en/default/setup/strings.txt.pl +++ b/extensions/Example/template/en/default/setup/strings.txt.pl @@ -17,7 +17,7 @@ # Contributor(s): # Max Kanat-Alexander -use 5.10.1; +use 5.14.0; use strict; use warnings; diff --git a/extensions/OldBugMove/Config.pm b/extensions/OldBugMove/Config.pm index 6e434bf203..d2ecc4d249 100644 --- a/extensions/OldBugMove/Config.pm +++ b/extensions/OldBugMove/Config.pm @@ -21,7 +21,7 @@ package Bugzilla::Extension::OldBugMove; -use 5.10.1; +use 5.14.0; use strict; use warnings; diff --git a/extensions/OldBugMove/Extension.pm b/extensions/OldBugMove/Extension.pm index a54789d485..fae5a4e5ed 100644 --- a/extensions/OldBugMove/Extension.pm +++ b/extensions/OldBugMove/Extension.pm @@ -21,7 +21,7 @@ package Bugzilla::Extension::OldBugMove; -use 5.10.1; +use 5.14.0; use strict; use warnings; diff --git a/extensions/OldBugMove/lib/Params.pm b/extensions/OldBugMove/lib/Params.pm index 43db99358e..46a9aea118 100644 --- a/extensions/OldBugMove/lib/Params.pm +++ b/extensions/OldBugMove/lib/Params.pm @@ -31,7 +31,7 @@ package Bugzilla::Extension::OldBugMove::Params; -use 5.10.1; +use 5.14.0; use strict; use warnings; diff --git a/extensions/ShadowBugs/Config.pm b/extensions/ShadowBugs/Config.pm index 6efa5fc165..9fa46988a8 100644 --- a/extensions/ShadowBugs/Config.pm +++ b/extensions/ShadowBugs/Config.pm @@ -7,7 +7,7 @@ package Bugzilla::Extension::ShadowBugs; -use 5.10.1; +use 5.14.0; use strict; use warnings; diff --git a/extensions/ShadowBugs/Extension.pm b/extensions/ShadowBugs/Extension.pm index 07288e9e1f..d1a508ec42 100644 --- a/extensions/ShadowBugs/Extension.pm +++ b/extensions/ShadowBugs/Extension.pm @@ -7,7 +7,7 @@ package Bugzilla::Extension::ShadowBugs; -use 5.10.1; +use 5.14.0; use strict; use warnings; From f97677a1e5be3bd8348948871a155308c289e53e Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Sat, 11 Jul 2026 21:44:33 -0400 Subject: [PATCH 3/3] Exclude perl files in templates from perl tests Perl files inside templates directories are data in Perl format and not actual Perl code. Adding `use strict` to them and declaring variables with `my` or `our` will break the loader. The core templates folder was already excluded from perl-related tests for this reason, but that exemption was not extended to the templates folder inside extensions. This commit adds comments to each of the currently-affected files explaining that, and extends the exemption to the templates folder in extensions in all of the tests. --- .../Example/template/en/default/setup/strings.txt.pl | 5 ++--- extensions/Push/template/en/default/setup/strings.txt.pl | 5 ++--- t/Support/Files.pm | 9 +++++++-- template/en/default/filterexceptions.pl | 3 +++ template/en/default/setup/strings.txt.pl | 3 +++ 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/extensions/Example/template/en/default/setup/strings.txt.pl b/extensions/Example/template/en/default/setup/strings.txt.pl index 452a814e95..01b3edd90b 100644 --- a/extensions/Example/template/en/default/setup/strings.txt.pl +++ b/extensions/Example/template/en/default/setup/strings.txt.pl @@ -17,9 +17,8 @@ # Contributor(s): # Max Kanat-Alexander -use 5.14.0; -use strict; -use warnings; +# This file is loaded inside a Safe compartment, so keep it as plain package +# data: do not add strict/warnings pragmas or lexical %strings declarations. %strings = (feature_example_acme => 'Example Extension: Acme Feature',); diff --git a/extensions/Push/template/en/default/setup/strings.txt.pl b/extensions/Push/template/en/default/setup/strings.txt.pl index a2a1a1a577..874b3c466b 100644 --- a/extensions/Push/template/en/default/setup/strings.txt.pl +++ b/extensions/Push/template/en/default/setup/strings.txt.pl @@ -5,9 +5,8 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; -use warnings; -use 5.14.0; +# This file is loaded inside a Safe compartment, so keep it as plain package +# data: do not add strict/warnings pragmas or lexical %strings declarations. %strings = ( feature_push_amqp => 'Push: AMQP Support', diff --git a/t/Support/Files.pm b/t/Support/Files.pm index 21f2786d08..626eedb437 100644 --- a/t/Support/Files.pm +++ b/t/Support/Files.pm @@ -30,8 +30,13 @@ our @extensions = grep { $_ ne 'extensions/create.pl' && !-e "$_/disabled" } glob('extensions/*'); foreach my $extension (@extensions) { - find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$|\.pl$/; }, - $extension); + find( + sub { + return if $File::Find::name =~ m{^extensions/.+/template/}; + push(@files, $File::Find::name) if $_ =~ /\.pm$|\.pl$/; + }, + $extension + ); } our @test_files = glob('t/*.t xt/*/*.t'); diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index b246fe7372..d118df6215 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -23,6 +23,9 @@ # and so do not need to be added here. Doing so will cause warnings. # See 008filter.t for more details. # +# This file is loaded by 008filter.t with do(), so keep it as plain package +# data and avoid strict/warnings pragmas or lexical variable declarations. +# # Comments - [%#... # Directives - [% IF|ELSE|UNLESS|FOREACH... # Assignments - [% foo = ... diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl index 54974aadb3..1627e1f70b 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -9,6 +9,9 @@ # installation code to display strings before Template-Toolkit can safely # be loaded. # +# This file is loaded inside a Safe compartment, so keep it as plain package +# data: do not add strict/warnings pragmas or lexical %strings declarations. +# # Each string supports a very simple substitution system, where you can # have variables named like ##this## and they'll be replaced by the string # variable with that name.