Skip to content

Refresh IANA top level domain list and add rake update_tlds - #43

Merged
natelindsey-nexl merged 1 commit into
mainfrom
devin/1785355284-refresh-iana-tlds
Sep 17, 2026
Merged

natelindsey-nexl merged 1 commit into
mainfrom
devin/1785355284-refresh-iana-tlds

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

PublicDomainSuffix#initialize rejects a domain whose last label is absent from the bundled tlds-alpha-by-domain.txt (raise ArgumentError, 'has invalid tld') before public_suffix ever sees it, so a stale snapshot silently turns real brand gTLD domains into ExceptionalValue. The snapshot was missing MERCK and WEB, so msd.merck was exceptional even though public_suffix's PSL knows the tld. Downstream this breaks contact-to-company auto-linking and search indexing in nexl360 (see NEXL-LTS/nexl360#17696).

The refresh merges rather than replaces: IANA has retired 51 tlds still present in our snapshot (ABARTH, CBS, VOLKSWAGEN, …), and dropping them would make already-stored historical domains newly exceptional. rake update_tlds encodes that union rule so future refreshes are one command.

A new spec asserts the snapshot is a superset of every single-label rule in public_suffix's PSL; onion is the sole expected exception, since it is a special-use name that IANA does not publish.

Checklist

  • Changelog updated
  • Version bumped in rails_values.gemspec

Test plan

bundle exec rspec (259 examples, 0 failures) and bundle exec rubocop (no offenses). rake update_tlds re-run against live IANA data reports added nothing, confirming the file is current. Verified before/after: PublicDomainSuffix.cast('msd.merck') was ExceptionalValue, now parses with tld merck; global.weir and bmwgroup.bmw are covered by the new brand-gTLD spec.

Link to Devin session: https://app.devin.ai/sessions/d71cadb95122427f80ec21aafa2c8c9a
Requested by: @natelindsey-nexl


Open in Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@natelindsey-nexl natelindsey-nexl self-assigned this Jul 29, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The update task can write an error response into the checked-in TLD list.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Refreshes the bundled IANA TLD snapshot and adds automated maintenance and coverage for brand gTLDs.

Changes:

  • Adds MERCK and WEB TLDs.
  • Adds rake update_tlds with union-based merging.
  • Adds PSL coverage specs.
  • Bumps version to 2.0.10 and updates the changelog.
File summaries
File Description
spec/rails_values/public_domain_suffix_spec.rb Adds TLD coverage tests.
Rakefile Adds the TLD refresh task.
rails_values.gemspec Bumps the gem version.
lib/rails_values/tlds-alpha-by-domain.txt Adds missing TLD entries.
CHANGELOG.md Documents the release.

The Rakefile task should reject unsuccessful IANA responses before parsing or overwriting the snapshot.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Rakefile
Comment on lines +15 to +16
published = Net::HTTP.get(URI(IANA_TLD_URL)).lines.map(&:chomp)
.reject { |line| line.empty? || line.start_with?('#') }
@natelindsey-nexl
natelindsey-nexl merged commit 120c90e into main Sep 17, 2026
11 checks passed
@natelindsey-nexl
natelindsey-nexl deleted the devin/1785355284-refresh-iana-tlds branch September 17, 2026 19:41

Copy link
Copy Markdown
Contributor

VA is a country code, not the country name expected by Country.is?, so initialization raises an exception. This causes all 13 specs to fail during file loading, producing 0 examples, 13 errors.

Change the record to the supported country name:

Diff
{

  • "country": "VA",
  • "country": "Vatican City",
    "tld": ".va"
    }
    The resulting entry should be:

JSON
{
"country": "Vatican City",
"tld": ".va"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants