Skip to content

docs,test: use RFC 2606 reserved domains in examples#4869

Open
nthbotast wants to merge 3 commits intonodejs:mainfrom
nthbotast:chore/rfc2606-tlds-docs-tests
Open

docs,test: use RFC 2606 reserved domains in examples#4869
nthbotast wants to merge 3 commits intonodejs:mainfrom
nthbotast:chore/rfc2606-tlds-docs-tests

Conversation

@nthbotast
Copy link
Contributor

@nthbotast nthbotast commented Mar 6, 2026

Summary

  • replace non-reserved example domains in docs examples with RFC 2606-style reserved TLDs
  • update node-test fixtures that previously used google.com
  • update type tests that previously used www.nodejs.org as an upstream example

Why

Closes #4866 by avoiding real/public domains in documentation and test examples.

Validation

  • npm run test:node-test -- test/node-test/util.js test/node-test/client-dispatch.js
  • npx tsd --files test/types/balanced-pool.test-d.ts
  • pre-commit lint hook (npm run lint)

Signed-off-by: Nathanael BOT <nathanaelbot@minidenathanael.home>
@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.01%. Comparing base (bfeacd0) to head (554aec2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4869      +/-   ##
==========================================
- Coverage   93.14%   93.01%   -0.13%     
==========================================
  Files         109      112       +3     
  Lines       34254    35157     +903     
==========================================
+ Hits        31905    32701     +796     
- Misses       2349     2456     +107     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

mcollina commented Mar 6, 2026

did you find all of them? Seems too few.

Can you add some kind of automation on CI to avoid them in the future?

Signed-off-by: Nathanael BOT <nathanaelbot@minidenathanael.home>
@nthbotast
Copy link
Contributor Author

Implemented, thanks for the review.\n\nI pushed commit with two follow-ups:\n\n1. Expanded placeholder-domain cleanup in docs examples (replaced remaining non-RFC2606 placeholders in the touched API docs).\n2. Added CI guard test: to fail if those non-RFC2606 placeholders are reintroduced in these docs.\n\nValidation run: and .

@nthbotast
Copy link
Contributor Author

(Correction for formatting)

Implemented, thanks for the review.

I pushed commit 3fd8bd4 with two follow-ups:

  1. Expanded placeholder-domain cleanup in docs examples (replaced remaining non-RFC2606 placeholders in the touched API docs).
  2. Added CI guard test: test/node-test/rfc2606-doc-placeholders.js to fail if those non-RFC2606 placeholders are reintroduced in these docs.

Validation run: node --test test/node-test/rfc2606-doc-placeholders.js and git diff --check.

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 this could be better if offloaded into a GHA, on top, maybe iterate over the docs and verify each link, attempting to identify if they are following the RFC-2606 standard

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, somehow gives false sense of security.

@Uzlopak
Copy link
Contributor

Uzlopak commented Mar 6, 2026

May we have some nicer domains?

It now looks kind strange, when i read example.example in the docs. Reads like we didnt where motivated to give some good domain name for our documentation, which is our "business card".

Lets use nodejs.example.and nodejs.test

@nthbotast
Copy link
Contributor Author

Good point — agreed on readability.\n\nI pushed commit 554aec2 to switch the touched examples from to clearer reserved domains:\n- (majority of examples)\n- (crawling example)\n\nI also updated the placeholder guard test to forbid in these files going forward.\n\nValidation run:\n- \n-

@nthbotast
Copy link
Contributor Author

(Correction for formatting)

Good point — agreed on readability.

I pushed commit 554aec2 to switch the touched examples from example.example to clearer reserved domains:

  • nodejs.example (majority of examples)
  • nodejs.test (crawling example)

I also updated the placeholder guard test to forbid example.example in these files going forward.

Validation run:

  • node --test test/node-test/rfc2606-doc-placeholders.js
  • git diff --check

@Fdawgs
Copy link
Contributor

Fdawgs commented Mar 6, 2026

@nthbotast is an AI bot btw, see the flood of PRs here and on the Fastify repo.

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.

Use RFC 2606 TLDs for documentation and tests

6 participants