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

Remove deprecated features planned for v2023.2 #1309

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

tgreenx
Copy link
Contributor

@tgreenx tgreenx commented Nov 29, 2023

Purpose

This PR removes deprecated features that were planned for v2023.2 See the Changes section below.

Context

Module Zonemaster::Engine::Net::IP was deprecated by #1202
Profile options dnssec and edns_size were deprecated by #1147

Changes

  • Remove module Zonemaster::Engine::Net::IP
  • Remove profile options dnssec and edns_size
  • Update unitary tests

How to test this PR

Tests are updated and should pass.

Manual testing:

$ git log -1 --oneline
910e9c5e (HEAD -> clean-deprecated, origin/clean-deprecated) Remove deprecated features planned for v2023.2
  1. Check that Zonemaster::Engine::Net::IP is not available anymore
$ perl -MZonemaster::Engine -E 'use Zonemaster::Engine::Net::IP'
Can't locate Zonemaster/Engine/Net/IP.pm in @INC (you may need to install the Zonemaster::Engine::Net::IP module)
  1. Check that setting profile option dnssec or edns_size in a custom profile return an error
$ cat share/custom.json
{
    "resolver" : {
        "defaults" : {
           "debug" : false,
           "dnssec" : false,
           "edns_size" : 0
        }
    },
    "test_cases": [
        "address01"
    ]
}

$ zonemaster-cli zonemaster.net --profile share/custom.json
Loading profile from share/custom.json.
Unknown property 'resolver.defaults.edns_size' at /home/tgreen/zonemaster/zonemaster-engine/lib/Zonemaster/Engine/Profile.pm line 311.

@tgreenx tgreenx added this to the v2023.2 milestone Nov 29, 2023
@tgreenx tgreenx added V-Minor Versioning: The change gives an update of minor in version. V-Major Versioning: The change gives an update of major in version. and removed V-Minor Versioning: The change gives an update of minor in version. labels Nov 29, 2023
mattias-p
mattias-p previously approved these changes Nov 29, 2023
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 applaud this initiative. I just have one suggestion.

foreach my $flag ( keys %flags ) {
$self->dns->$flag( Zonemaster::Engine::Profile->effective->get( q{resolver.defaults.}.$flag ) );
# Except for any flag that is not configurable in the profile
unless ( grep( /^$flag$/, ( 'dnssec', 'edns_size' ) ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

I believe there is a different cleanup for this that is cleaner. I.e. replacing lines 466 and 467

        $flags{q{dnssec}}    = $href->{edns_details}{do} // $flags{q{dnssec}};
        $flags{q{edns_size}} = $href->{edns_details}{size} // $flags{q{edns_size}};

with

        $self->dns->dnssec( $href->{edns_details}{do} );
        $self->dns->edns_size( $href->{edns_details}{size} );

That should have the same effect with less and simpler code.

Copy link
Contributor Author

@tgreenx tgreenx Nov 29, 2023

Choose a reason for hiding this comment

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

Unfortunately no that is not equivalent. Note that both options are still valid customizable flags, i.e. they can be changed in the Test Case implementations (with any call to Zonemaster::Engine::Nameserver::query()) - it is only the possibility of having/customizing them in the profile that is removed here.

But honestly, I'm not even sure this part of the code ("Reset to defaults", lines 537 to 543) is needed at all, since every options are checked whenever a new query is done (lines 454 to 463).

Copy link
Member

@mattias-p mattias-p Nov 29, 2023

Choose a reason for hiding this comment

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

But honestly, I'm not even sure this part of the code ("Reset to defaults", lines 537 to 543) is needed at all, since every options are checked whenever a new query is done (lines 454 to 463).

I agree with you. I also don't think "restore" describes very well what actually happens. To me "restore" bringing back the state that was before you came. This code resets the state to whatever happens to be in the profile right now.

Should we just remove it? Maybe in the beginning of next release cycle so we have more time to find weird bugs?

Unfortunately no that is not equivalent.

Oh, you're right. I was clearly going too fast in my review. Or I was seeing what I wanted to see. I really dislike how %flags is used in _query().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But honestly, I'm not even sure this part of the code ("Reset to defaults", lines 537 to 543) is needed at all, since every options are checked whenever a new query is done (lines 454 to 463).

I agree with you. I also don't think "restore" describes very well what actually happens. To me "restore" bringing back the state that was before you came. This code resets the state to whatever happens to be in the profile right now.

Should we just remove it? Maybe in the beginning of next release cycle so we have more time to find weird bugs?

That can come in another PR.

@tgreenx
Copy link
Contributor Author

tgreenx commented Dec 4, 2023

@mattias-p @matsduf I just fixed a conflict, please re-review.

- Remove module Zonemaster::Engine::Net::IP
- Remove profile options 'dnssec' and 'edns_size'
- Update unitary tests
@tgreenx tgreenx merged commit d47a356 into zonemaster:develop Dec 4, 2023
3 checks passed
@tgreenx tgreenx deleted the clean-deprecated branch December 4, 2023 12:56
@matsduf
Copy link
Contributor

matsduf commented Mar 17, 2024

Release testing: Looks fine.

@matsduf matsduf added the S-ReleaseTested Status: The PR has been successfully tested in release testing label Mar 17, 2024
@tgreenx tgreenx linked an issue Apr 30, 2024 that may be closed by this pull request
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-Major Versioning: The change gives an update of major in version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove items from profile
3 participants