Open
Conversation
cunha
requested changes
Jan 12, 2026
Member
cunha
left a comment
There was a problem hiding this comment.
Main points:
- Tests don't match expected behavior; we need to define a number of domain and path levels beyond which we start "anonymization"
- Need tests to cover URL query parameters
- Need tests to cover special domains and CC TLDs
cunha
requested changes
Jan 12, 2026
Member
cunha
left a comment
There was a problem hiding this comment.
Forgot to mention CC TLDs in the previous review.
cunha
reviewed
Jan 28, 2026
Member
cunha
left a comment
There was a problem hiding this comment.
Another round of comments. I think we should focus on comparing the URL identity keys (after we "erase" subdomains, path levels, and query parameter values). The filter is just taking one URL for each distinct identity key.
cunha
requested changes
Feb 27, 2026
Member
cunha
left a comment
There was a problem hiding this comment.
Requesting a few more additional testes around ccTLDs.
Comment on lines
+272
to
+285
| def test_regular_cctld(self, filter_instance): | ||
| """Test URL with regular ccTLD (not special) identity key.""" | ||
| url = "http://example.uk/page" | ||
| result = filter_instance.anonymize_url(url) | ||
| # Regular ccTLDs use 3-level domain key (domain + cc tld) | ||
| expected = "http://example.uk/page" | ||
| assert result == expected | ||
|
|
||
| def test_special_cctld(self, filter_instance): | ||
| """Test URL with special ccTLD identity key.""" | ||
| url = "http://a.b.c.d.example.co/page" | ||
| result = filter_instance.anonymize_url(url) | ||
| expected = "http://1w.1w.1w.d.example.co/page" | ||
| assert result == expected |
Member
There was a problem hiding this comment.
These tests need extending. We should test whether actual ccTLDs get handled correctly.
We should give
c.example.co.uk/page1
b.c.example.co.uk/page1
d.c.example.co.uk/page1
a.b.c.example.co.uk/page1
to anonymize_url and check that it returns
c.example.co.uk/page1
1w.c.example.co.uk/page1
1w.c.example.co.uk/page1
1w.1w.c.example.co.uk/page1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.