Separate functions to trim whitespace and normalize domain name#1316
Conversation
|
@matsduf has expressed that he wants to update RequirementsAndNormalizationOfDomainNames.md before this is merged. |
matsduf
left a comment
There was a problem hiding this comment.
If trimming of leading and trailing white space is removed from Engine, then the function must be in GUI or in Backend. Do we have the function in GUI?
Another option would be that Engine offers two alternatives, trimming of leading and trailing white space enabled and trimming disabled, respectively. That would make it easy for a new client to choose.
Also, we have zmb in Backend. Should that behave like GUI and trim? Or should that be like CLI and not trim? If zmb should trim (to make it more GUI like) then trimming should be done in Backend.
|
@matsduf Regarding your comment above, as you remember, we discussed this topic at a work group meeting a while ago. I believe it was after your comment, but it seems we forgot to note our conclusions here. Instead of leaving (seemingly) unanswered questions hanging, it seems appropriate to summarize some clarifications along the lines of our discussion as I remember it.
@matsduf, @marc-vanderwal, @tgreenx, @MichaelTimbert do you guys agree with the above? |
|
@mattias-p, please see zonemaster/zonemaster#1260. |
|
@mattias-p, you do not trimming to be part of the normalization specification (you write "test case specification" but I think you mean the normalization document), but you want the normalization to happen in GUI. Where do you want that to be specified or do you prefer it to be unspecified. I am not sure that I agree with your bullets, but I will not totally object. A requirement is that operations happening are documented and specified. |
Also, fix resulting compilation errors and make iteration order deterministic.
* Better diagnostics. * More complete test for bad domain names.
marc-vanderwal
left a comment
There was a problem hiding this comment.
Code looks fine; just one nit.
| use Test::More; | ||
| use Test::Exception; | ||
|
|
||
| #!perl |
There was a problem hiding this comment.
.t files don’t need shebangs, do they?
There was a problem hiding this comment.
It does not hurt, does it? It can help some editors to recognize it as a Perl script.
There was a problem hiding this comment.
Strictly speaking, I don't think it's required. I picked it up as a habit at some point, I don't remember exactly why. It seems at this point it's mostly a historical artifact. I noticed that it's present in examples in Intermediate Perl from 2012.
|
Before this PR is merged, zonemaster/zonemaster#1260 should be approved and merged. |
matsduf
left a comment
There was a problem hiding this comment.
Fine given that zonemaster/zonemaster#1260 is approved and merged.
|
zonemaster/zonemaster#1260 has been merged. How is this PR related to zonemaster/zonemaster-backend#1143 |
|
This is a breaking change, and zonemaster/zonemaster-backend#1143 depends on this change. |
v2025.1 Release testingWorks as advertised in the "How to test" section. |
Purpose
This PR separates the normalization of what's logically part of domain names from the white space stripping that is also specified in RequirementsAndNormalizationOfDomainNames.md to make it possible to apply them individually.
Context
This PR fixes item 3 in zonemaster/zonemaster-cli#364.
zonemaster/zonemaster-backend#1143 should be merged together with this one.
This is technically a major change because normalize_name() is part of the public API. However, even though we've included an implementation in prior releases, we've never actually called it (except from unit tests).
Changes
How to test this PR
Zonemaster CLI should present the following behaviors: