Skip to content

First implementation of MethodsV2#1050

Merged
tgreenx merged 1 commit intozonemaster:developfrom
tgreenx:methodsNT
May 10, 2023
Merged

First implementation of MethodsV2#1050
tgreenx merged 1 commit intozonemaster:developfrom
tgreenx:methodsNT

Conversation

@tgreenx
Copy link
Contributor

@tgreenx tgreenx commented Apr 13, 2022

Purpose

This PR proposes a first implementation of the new methods "MethodsV2" to be used by Test modules of Zonemaster::Engine.

Those methods are not yet used anywhere (i.e., by any Test Case). This is planned for 2023.2 (at the earliest).

Context

Fixes #571 , #891

Changes

lib/Zonemaster/Engine/TestMethodsV2.pm

  • Full implementation of MethodsV2
  • Documentation

How to test this PR

In any Test module (e.g, Basic) where the new methods are to be tested, import them using:
use Zonemaster::Engine::TestMethodsV2;

As with the current Methods implementations, you can call each method using:
my @results = Zonemaster::Engine::TestMethodsV2->get_parent_ns_ips( $zone );

@matsduf
Copy link
Contributor

matsduf commented Aug 2, 2022

Maybe rename this PR to "First implementation of MethodsV2"?

@tgreenx tgreenx changed the title First implementation of MethodsNT First implementation of MethodsV2 Aug 2, 2022
@tgreenx
Copy link
Contributor Author

tgreenx commented Sep 15, 2022

Implementation updated to follow latest changes in specification from zonemaster#1059.

Comment on lines 60 to 62
for my $ns ( @{$ns_ref} ){
if ( not $zone->name->is_in_bailiwick( $ns->name ) ){
if ( $is_undelegated and Zonemaster::Engine::Recursor->get_fake_addresses( $zone->name->string, $ns->name->string ) ){
Copy link
Contributor

Choose a reason for hiding this comment

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

The last line should be indented, shouldn't it?

Comment on lines 358 to 386
=item get_parent_ns_ips($zone)
External method.

=item _get_oob_ips($zone, $ns_names_ref)
Interal method.

=item _get_delegation($zone)
Internal method.

=item get_del_ns_names_and_ips($zone)
External method.

=item get_del_ns_names($zone)
External method.

=item get_del_ns_ips($zone)
External method.

=item get_zone_ns_names($zone)
External method.

=item _get_ib_addr_in_zone($zone)
Internal method.

=item get_zone_ns_names_and_ips($zone)
External method.

=item get_zone_ns_ips($zone)
External method.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the plan to provide more information here? It is good to at least see what each subroutine returns.

Have you considered putting the documentation for the subroutines just before each subroutine instead of at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the plan to provide more information here? It is good to at least see what each subroutine returns.

Yes, more documentation to come.

Have you considered putting the documentation for the subroutines just before each subroutine instead of at the end?

Sure, I will do that as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have just provided an update which adds documentation and put it next to each subroutine. See 9a248dc.

@tgreenx tgreenx marked this pull request as ready for review April 13, 2023 09:52
- Complete rewrite of Test Methods (Zonemaster::Engine::TestMethodsV2), based on specification from v2022.2.

- Documentation
@matsduf matsduf added the V-Minor Versioning: The change gives an update of minor in version. label May 10, 2023
@tgreenx
Copy link
Contributor Author

tgreenx commented May 10, 2023

As discussed in team meeting, this implementation requires extensive testing, but that will be done in a future PR when the new methods will start to be used. Corrections in the implementation, if needed, will also be added then. For now, these new methods are not used anywhere and so can be merged as is.

Follow-up issue for testing: #1222

@tgreenx tgreenx merged commit e2f9b78 into zonemaster:develop May 10, 2023
@tgreenx tgreenx deleted the methodsNT branch May 10, 2023 13:09
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.

Reverse zones: zonemaster fails to detect NS inconsistencies with parent zone (Nameserver07) Add implementation of MethodsNT

2 participants