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

add new basic00 implementation #1040

Merged
merged 26 commits into from
Nov 28, 2022

Conversation

hannaeko
Copy link
Member

@hannaeko hannaeko commented Feb 21, 2022

Purpose

Implement new Basic00. I implemented the updated "test case" as sanitization methods, it is not used anywhere yet, I am waiting for design validation before using it.

Context

zonemaster/zonemaster#942

Changes

  • Add Zonemaster::Engine::Normalization::normalize_name that follow the procedure described in RequirementsAndNormalizationOfDomainNames.
    • The method return a list of error and the normalized domain name if it is valid.
    • If the domain is invalid, the domain is undef, if it is valid the list of error is empty.
    • Errors are object of type Zonemaster::Engine::Normalization::Errors. Those have a tag and a localized error message (translated when called to allow changes of the locale between calls)
  • Documentation (waiting for design validation)

How to test this PR

  • A new test file "t/normalization.t" is testing the method.

@hannaeko hannaeko added this to the v2022.1 milestone Feb 21, 2022
@hannaeko hannaeko requested review from mattias-p, matsduf, a user and tgreenx February 21, 2022 15:42
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.

In general this looks good to me but I have a bunch of comments.

lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
t/sanitization.t Outdated Show resolved Hide resolved
t/sanitization.t Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization/Errors.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization/Errors.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization/Errors.pm Outdated Show resolved Hide resolved
Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

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

Please add POD documentation of all methods that explains what they do (what they are supposed to do), what the expected input is and what the output will be.

lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization/Errors.pm Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
t/sanitization.t Outdated Show resolved Hide resolved
lib/Zonemaster/Engine/Sanitization.pm Outdated Show resolved Hide resolved
t/sanitization.t Outdated Show resolved Hide resolved
@matsduf matsduf modified the milestones: v2022.1, v2022.2 May 4, 2022
@hannaeko hannaeko marked this pull request as draft August 19, 2022 14:04
@hannaeko
Copy link
Member Author

hannaeko commented Sep 21, 2022

I have added the NFC conversion tests and updated the documentation.

matsduf
matsduf previously approved these changes Sep 21, 2022
Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

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

This looks fine. I have not run any tests on it though.

Copy link
Contributor

@tgreenx tgreenx left a comment

Choose a reason for hiding this comment

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

LGTM, tested and it works as expected.
One thing though, overall I think the code could benefit from an editorial pass on the spacing in every conditional blocks (e.g. if ( ... ) everywhere) to improve readability but I won't be blocking the PR if it is not done.


=item string

Returns a string representation of the error object, equivalent to message.
Copy link
Contributor

Choose a reason for hiding this comment

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

error object, equivalent to message. -> error object. Equivalent to message().

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed


=item tag

Returns the message tag asscociated to the error.
Copy link
Contributor

Choose a reason for hiding this comment

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

asscociated -> associated

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@tgreenx tgreenx linked an issue Nov 3, 2022 that may be closed by this pull request
ghost
ghost previously approved these changes Nov 4, 2022
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

lgtm

use Readonly;
use Try::Tiny;
use Zonemaster::LDNS;
use Data::Dumper;
Copy link

Choose a reason for hiding this comment

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

Might be safely removed

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@hannaeko hannaeko dismissed stale reviews from ghost and matsduf via f9095e1 November 21, 2022 10:59
@hannaeko hannaeko added the V-Minor Versioning: The change gives an update of minor in version. label Nov 21, 2022
matsduf
matsduf previously approved these changes Nov 21, 2022
Copy link
Contributor

@tgreenx tgreenx left a comment

Choose a reason for hiding this comment

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

One typo else ready to approve

@@ -129,7 +129,7 @@ sub tag {

=item string

Returns a string representation of the error object, equivalent to message.
Returns a string representation of the error object. Euivalent to message().
Copy link
Contributor

Choose a reason for hiding this comment

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

Euivalent -> Equivalent

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@hannaeko hannaeko merged commit e224292 into zonemaster:develop Nov 28, 2022
@matsduf
Copy link
Contributor

matsduf commented Dec 13, 2022

Updated by #1157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V-Minor Versioning: The change gives an update of minor in version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undelegated tests crash when the domain has a trailing dot
4 participants