Repository navigation
fix(tlds): read IANA's redesigned root zone database page - #231
Merged
Merged
Conversation
IANA redesigned https://www.iana.org/domains/root/db: links lost their .html suffix, a status column now sits before the type, the manager cell is marked col-manager, and types are title case ("Country Code"). The old regex matched nothing, so every TLD sync logged [tlds] root zone database failed: root zone database parsed to 0 rows and type/manager stopped updating. Parse row by row and read both layouts; types are normalised to the existing vocabulary (country-code), and a retired row (status Retired, empty manager) keeps the "Not assigned" manager the retired-label pass keys on. The live page parses to 1,603 rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What broke
Every TLD sync logs
[tlds] root zone database failed: root zone database parsed to 0 rows, so TLD type and manager stopped updating.Why
IANA redesigned https://www.iana.org/domains/root/db. Links are now
/domains/root/db/aaa(no.html), a status column (Active / Retired / Reserved) sits before the type, the manager cell carriesclass="col-manager", and types are title case (Generic,Country Code,Special Use,Test). The single regex inparseRootDbmatched none of it.Fix
parseRootDbreads row by row and handles both layouts. Types are normalised to the existing lower-case, dashed vocabulary (country-code). A retired row in the new layout (status Retired, empty manager) gets theNot assignedmanager that the retired-label pass keys on. Against the live page this parses 1,603 rows: generic 1265, country-code 318, special-use 9, test 11.Note: the new page no longer distinguishes sponsored / generic-restricted / infrastructure, so those rows will read as IANA now labels them.
Test: a fixture in the new layout, alongside the old one.
bun test test/tlds.test.js: 30 pass.🤖 Generated with Claude Code