Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update minimum Perl version to 5.16.0 and add missing 'warnings' #1342

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

tgreenx
Copy link
Contributor

@tgreenx tgreenx commented May 7, 2024

Purpose

This PR updates Zonemaster-Engine modules which were missing either a minimum Perl version or the warnings Perl library.

Moreover, the minimum Perl version is raised from 5.14.2 to 5.16.0 to match our current documentation.

As a drive-by change, this also fixes a variable declaration error from #1341.

Context

Spotted while fixing #1341

How to test this PR

Check that no Zonemaster-Engine Perl modules are missing these libraries:

cd zonemaster-engine/
find lib -type f -name '*.pm' \( -exec grep -q '^use warnings;$' '{}' \; -or -print \)
find lib -type f -name '*.pm' \( -exec grep -q '^use v5.16.0;$' '{}' \; -or -print \)

Note that with this change, other errors have started to show and will be fixed in another PR: #1343

@tgreenx tgreenx added the V-Patch Versioning: The change gives an update of patch in version. label May 7, 2024
@tgreenx tgreenx added this to the v2024.1 milestone May 7, 2024
@tgreenx tgreenx linked an issue May 7, 2024 that may be closed by this pull request
matsduf
matsduf previously approved these changes May 8, 2024
mattias-p
mattias-p previously approved these changes May 8, 2024
lib/Zonemaster/Engine.pm Outdated Show resolved Hide resolved
- Use the preferred version format: vMAJOR.MINOR.PATCH
- Removes unecessary 'use strict'

See https://perldoc.perl.org/functions/use#use-VERSION
@tgreenx tgreenx dismissed stale reviews from mattias-p and matsduf via 0b117b7 May 14, 2024 12:33
@tgreenx tgreenx changed the title Use strict and warnings in all modules Update minimum Perl version to 5.16.0 and add missing 'warnings' May 14, 2024
@tgreenx tgreenx requested review from mattias-p and matsduf May 14, 2024 12:39
@marc-vanderwal
Copy link
Contributor

I suggest an alternative test procedure:

In the root of Zonemaster::Engine’s code repository, run the following command:

find lib -type f -name '*.pm' \( -exec grep -q '^use warnings;$' '{}' \; -or -print \)

Expect no output. Files that appear are missing a use warnings; line.

@marc-vanderwal
Copy link
Contributor

I see that a test in t/Test.t is now failing, but this definitely seems to be a bug uncovered by the use of use warnings;. Not a regression, but simply a latent problem waiting to be fixed.

@tgreenx
Copy link
Contributor Author

tgreenx commented May 16, 2024

I suggest an alternative test procedure:

In the root of Zonemaster::Engine’s code repository, run the following command:

find lib -type f -name '*.pm' \( -exec grep -q '^use warnings;$' '{}' \; -or -print \)

Expect no output. Files that appear are missing a use warnings; line.

Thanks. I added it to the test procedure.

I see that a test in t/Test.t is now failing, but this definitely seems to be a bug uncovered by the use of use warnings;. Not a regression, but simply a latent problem waiting to be fixed.

Yes, this is fixed in another PR: #1343

Copy link
Member

@mattias-p mattias-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked https://perldoc.perl.org/feature#FEATURE-BUNDLES and AFAICT the bump from 5.14 to 5.16 shouldn't break anything.

@matsduf
Copy link
Contributor

matsduf commented Jun 13, 2024

@tgreenx, can you check this? Will rebasing solve the test issue?

@tgreenx
Copy link
Contributor Author

tgreenx commented Jun 13, 2024

As previously stated, the errors generated by this PR are fixed in #1343. We decided to merge them together.

@tgreenx tgreenx merged commit bc6c94d into zonemaster:develop Jun 17, 2024
0 of 3 checks passed
@tgreenx tgreenx deleted the fix-strict-warnings branch June 17, 2024 09:28
@matsduf
Copy link
Contributor

matsduf commented Jun 27, 2024

Release testing for v2024.1

I have verified in the code, but I have no installation of Perl v5.15 or lower to test with, but I do not think it is needed.

@matsduf matsduf added the S-ReleaseTested Status: The PR has been successfully tested in release testing label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-ReleaseTested Status: The PR has been successfully tested in release testing V-Patch Versioning: The change gives an update of patch in version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"my" variable $p masks earlier declaration in same scope
4 participants