Skip to content

Absorb utopia-php/domains - #156

Open
loks0n wants to merge 344 commits into
mainfrom
feat/absorb-domains
Open

Absorb utopia-php/domains#156
loks0n wants to merge 344 commits into
mainfrom
feat/absorb-domains

Conversation

@loks0n

@loks0n loks0n commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Imports utopia-php/domains with its full history and brings it onto the monorepo's contracts. Net -52k LoC.

bin/monorepo absorb domains did the mechanical part: history import, hoisted QA stripped, the mirror's four workflows replaced with the redirect mirror.yml, issue templates dropped, README bannered, mirror ruleset normalised (PR-only, split app bypassed).

By hand

  • QApint.json gone, Pint and Rector applied, package clears the root PHPStan floor.
  • Test contract — unit tier is the parser, the validators and the Mock registrar (51 tests). E2E tier is the OpenSRS and Name.com suites, which now skip rather than fail an assertion when their sandbox credentials are absent, since nothing in CI can hold them.
  • The datasetdata/data.php only ever answered "which list section did this rule come from": the suffix key duplicated the array key and comments was never read. It is now a rule => section map, 59,534 lines down to 10,252. That also unblocks Pint, which OOMed tokenising the old file (the root pint.json is applied with a hardcoded --config, so a per-package exclude was not an option).
  • Manifest — sibling constraints on the caret convention, test/test:e2e scripts, modern phpunit.xml, trimmed .gitignore, package CODE_OF_CONDUCT.md/CONTRIBUTING.md dropped.
  • Docs — README brought past Vale (sentence-case headings, backticked identifiers, locahost, a stale PHP 8.2 claim, a dead Travis badge) plus a Tests section; OpenSRS and Name.com added to the shared vocabulary; dependency graph regenerated (dns --> domains).
  • Data automation kept — the mirror's nightly importer becomes .github/workflows/domains-data.yml, opening a pull request when publicsuffix.org moves on.

Bugs found on the way in

  • The cURL header callback lowercased whole header lines, so every response header value came back lowercased.
  • A JSON body was only decoded when Content-Type carried a parameter — bare application/json fell through undecoded, because strpos returned false and truncated the substr comparison.

Verification

bin/monorepo check domains, test domains, validate, vale, ratchet lint, and bin/monorepo test dns --linked (its only dependent) all pass.

Important

Land as a merge commit, never a squash — the import's subtree annotation lives in the merge, and a squash orphans the package from its mirror history.

🤖 Generated with Claude Code

ChiragAgg5k and others added 27 commits March 2, 2026 09:50
Fix Name.com error handling for invalid domains and unsupported TLDs
- Add new RateLimitException class to handle API rate limit errors
- Update NameCom adapter to detect HTTP 429 and 'Rate Limit Exceeded' messages
- Refactor exception handling to catch RateLimitException first before generic Exception
- Add ERROR_RATE_LIMIT_EXCEEDED constant to error map
feat: add RateLimitException for NameCom adapter
Throw InvalidPeriodException when the API returns an invalid years
error (HTTP 400). Ordered ERROR_INVALID_YEARS before
ERROR_INVALID_CONTACT in ERROR_MAP so the more specific pattern
matches first.
feat: add InvalidPeriodException for NameCom adapter
* Remove deprecated curl_close calls

* Clean up curl_close removal formatting

* Stabilize registrar update tests

* Treat OpenSRS no-op updates as successful
chore: bump utopia-php/cache to 2.0.0
* chore: bump utopia-php/cache to ^3.0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore: raise PHP minimum to 8.3

utopia-php/cache 3.0 requires PHP >=8.3, so consumers on 8.2 would
fail to install. Drop 8.2 from the supported matrix to match.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore: refresh composer.lock content-hash

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci: test against PHP 8.3, 8.4, 8.5

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* Fix premium domain pricing for aftermarket listings

Name.com's getPricing endpoint only returns standard registry
registration pricing, so premium aftermarket listings (e.g. short or
brandable domains sold at a one-time acquisition fee) were quoted at
the base TLD price — a domain selling for ~$2,200 was priced at $1.99.

- NameCom::getPrice() now consults checkAvailability and, when the
  domain is a premium listing (premium flag or a non-registration
  purchaseType), uses its purchasePrice/renewalPrice as authoritative
- NameCom::suggest() treats non-registration purchase types as premium
  and exposes renewalPrice and purchaseType per suggestion
- purchase() accepts an optional purchasePrice (required by registrars
  for premium domains), wired through Registrar, NameCom (request
  payload, mirroring transfer()), OpenSRS (existing register() param)
  and Mock
- getPrice() no longer caches null renewal/transfer prices as 0.0;
  they now correctly raise PriceNotFoundException

* (fix): soft-fail availability lookup in getPrice for standard domains

Per review: a transient checkAvailability failure no longer breaks
getPrice() when getPricing already returned usable data. The premium
merge is skipped and the result is not cached, so the merge is retried
on the next request. Rate limits still propagate. Also documented why
a renewal price of 0 (name.com's 'no data') must not override the
registry renewal price.
* chore(deps)!: upgrade to utopia-php/cache 4.x

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore!: require PHP 8.4

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: drop PHP 8.3 from the test matrix

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: refresh lock content-hash after PHP requirement bump

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cache 5.0.0 is released and this package pinned ^4, which blocks every consumer
downstream: appwrite cannot move to cache 5 while any dependency still requires
cache 4.

Nothing here needs to change to support it. Cache's major is for the
Redis\Multiplexing deadline behaviour and for requiring circuit-breaker ^0.4,
which dropped the threshold argument. This package uses neither — grep for
Multiplexing and CircuitBreaker across src/ and tests/ returns nothing, and the
generic Cache and Adapter surface is identical between 4 and 5.

Constrained as ^4.0 || ^5.0 rather than ^5.0 so this does not force the upgrade
on anyone still on cache 4.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…2b1d7a16'

git-subtree-dir: packages/domains
git-subtree-mainline: 0bbd713
git-subtree-split: cab900a
Imports the library with its history and brings it onto the monorepo's
contracts.

- QA hoisted to the root toolchain: pint.json is gone, Pint and Rector
  applied, and the package clears the root PHPStan floor.
- Test contract: the parser, the validators and the Mock registrar are
  the unit tier; the OpenSRS and Name.com suites are the e2e tier, and
  they skip instead of failing when their sandbox credentials are absent
  (nothing in CI can hold them).
- The generated public suffix dataset only ever answered "which section
  did this rule come from", so it is now a rule => section map rather
  than a record per rule with an unread suffix and comment list. That
  takes data.php from 59k lines to 10k — small enough for Pint to
  tokenise, which the old file was not.
- The mirror's nightly import workflow becomes a monorepo workflow that
  opens a pull request when publicsuffix.org has moved on.

Bugs found on the way in:

- The cURL header callback lowercased whole header lines, so every
  response header value came back lowercased.
- A JSON response was only decoded when its Content-Type carried a
  parameter — `application/json` on its own fell through undecoded,
  because strpos() returned false and truncated the comparison.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.