Repository navigation
service domain add succeeds before DNS is set up; the domain commands move off the deprecated custom domain API - #400
Merged
wmadden-electric merged 8 commits intoNov 23, 2026
Conversation
The custom domain routes are deprecated and will be removed. add, show,
delete, retry and wait now use /v1/services/{serviceId}/urls and
/v1/urls/{id}, from @prisma/management-api-sdk 1.101.0.
add succeeds before DNS is set up and prints the records to publish.
show and wait report the hostname's status and state. retry asks for a
check, and explains HTTP 429 as the hourly limit of new certificates.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 49 minutes. View limit details
|
commit: |
Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
A service can list one hostname more than once. show, retry, wait and add now follow the entry the platform routes the hostname through; the earlier rule could pick an older entry that never becomes active. Also: the add command owns its idempotency and the provider is a plain API mapping; delete skips an entry someone else already deleted; a 429 on retry shows the API's own message; the JSON summary drops its constant type field; a null error body no longer throws. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
When a service lists a hostname twice and the entry wait follows loses the hostname to the other, wait now looks the hostname up again and follows the holder. delete removes the holder last. Wording and test gaps from the second review round are fixed. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
wmadden-electric
marked this pull request as ready for review
November 23, 2026 04:56
wmadden-electric
marked this pull request as draft
November 23, 2026 05:09
…e user A failure from a system below the API is internal, relayed or modelled. A failed certificate's reason is relayed as given, with no advice added. A failed platform update, a failed certificate with no reason and a wait that times out while the platform is working say only that provisioning failed for reasons we are not sure about. The platform's update error is no longer shown, and retry's 429 prints the API's message and hint. The rule is recorded in docs/product/error-conventions.md. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Fixes from the review of the error-model change: wait's timeout no longer calls a hostname the platform is still working on a failure; a 5xx answer to a domain command says only that the operation failed; the DNS refusal reason is relayed as given; show suggests retry, not wait, after a failed update, and nothing after a deleted service. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
A failed update says the last update failed and is being retried. The platform's reason for refusing a hostname's DNS is relayed beside a failed certificate too. The CLI's doc no longer says a 4xx answer is safe to relay as such. Help and reference wording brought in line. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
wmadden-electric
marked this pull request as ready for review
November 23, 2026 06:10
wmadden-electric
marked this pull request as draft
November 23, 2026 06:14
After a certificate retry that the platform refuses for DNS, the API carries the same text as the certificate's reason and as the DNS reason. The CLI printed both, run together. It now shows the certificate's reason, and the DNS reason only when the certificate has none. A wait that times out after a failed update offers the retry. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
wmadden-electric
marked this pull request as ready for review
November 23, 2026 06:15
wmadden
approved these changes
Nov 23, 2026
service domain add succeeds before DNS is set up; the domain commands move off the deprecated custom domain API
wmadden-electric
deleted the
claude/service-domain-hostname-routes-4eee86
branch
November 23, 2026 06:21
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.
Adding a custom domain used to fail until your DNS was already right. Now it succeeds at once and tells you what to publish.
Before (abridged):
You published the record, ran
addagain, and it failed again withSERVICE.DOMAIN_DNS_NOT_CONFIGUREDuntil the second record was in place too.After (abridged):
The decision
The five
prisma service domaincommands (add,show,retry,wait,delete) move from the Management API's custom domain routes to its newer hostname routes. The old routes are deprecated by prisma/pdp-control-plane#6113 and are removed 30 days after that deploys, so the CLI has to move before then.Command names, arguments and flags do not change. The
--jsonoutput and the error codes do change, because the new API models a custom domain differently: a hostname exists from the moment you add it, and "DNS is not ready" is a state it is in, not a reason to refuse it. Those breaking changes are listed in full below.How a custom domain works now
A hostname serves a service once three things are true:
The API reports where a hostname stands in two fields, and the CLI passes both through unchanged:
statusispendinguntil the hostname has gone live once, thenactive.statesays what the hostname is doing right now.activemeans it serves the service. Every other value names what is missing:statenot_verifiedwaiting_for_dnsno_live_deploymentno_servicein_use_elsewhereprovisioning_certificate,updatingcertificate_failedretry, after reading the platform's reasonupdate_failedretryto try nowOne fact shapes two of the commands: the platform looks DNS up when a hostname is added and when someone asks it to check, not on a timer. So after you publish your records, something has to ask.
What each command does
addcreates the hostname and prints the records still to publish. It does not need DNS, or a live version of the service, to be in place first. Adding a hostname the service already has shows the existing one (existing: true).showprintsstatus,state, what the hostname waits on, and the records still to publish.retryasks the platform to check again: it looks the DNS records up, tries a failed update again, and orders a new certificate if the last one failed.waitblocks untilstateisactive. While the hostname waits for records you publish, it asks for a check every 30 seconds, so a record you publish mid-wait is noticed. It stops at once on a failed certificate or a deleted service, since waiting cannot fix those. On timeout it reports the state the hostname is still in.deleteremoves the hostname from the service.After
add,showandretry, the suggested next command now carries--service,--projectand--branch, so it works from any directory and on any branch.How failures are worded
The certificate and the DNS checks are done by systems below the Management API, so the CLI learns of a failure second-hand. It words a failure by what it was given, not by guessing at the cause:
The CLI adds no advice to a message it does not understand, because it cannot know the advice is true: about half of failed certificates are temporary and half need the customer to change something, and the platform cannot tell them apart. For the same reason the CLI does not print the platform's internal error after a failed update.
This rule is recorded in
docs/product/error-conventions.md, which links to the control plane's document for every layer (prisma/pdp-control-plane#6138, not merged yet). Only theservice domaincommands follow it so far.One hostname listed twice
The API accepts the same hostname on a service more than once, for example when it was also added in the Console. At most one of those entries holds the hostname, meaning it is the one that serves it or will. The CLI treats the entries as one hostname:
show,retryandwaitfollow the entry that holds it (the oldest, while none does), anddeleteremoves them all.Breaking changes
--json: thedomainobject ofadd,showandretryiddom_…custom domain idstatuspendingoractive. Was one ofpending_dns,verifying,verified_routing_blocked,provisioning_tls,active,failed,removingdnsRecords[]condition;ttlis always a numberserviceIdnullurl,type,foundryStatus,failureCategorystate,conditions,firstUnmetCondition,dnsDetail,ownershipExpiresAt,heldBy,setupUrlUnchanged:
hostname,failureReason,certExpiresAt,createdAt,updatedAt, the target fields,existingonadd, and the wholedeleteresult. Thewaitresult gainsstate.wait's progress events now carry the state instatusand the API's status indata.domainStatus.Piped output of
showIt gains a
stateline and loses itsfailureline.Error codes
SERVICE.DOMAIN_OWNERSHIP_REQUIRED,SERVICE.DOMAIN_DNS_NOT_CONFIGURED,SERVICE.DOMAIN_CLOUDFLARE_PROXYaddsucceeds and reports a stateSERVICE.DOMAIN_ALREADY_REGISTEREDstate: in_use_elsewhereSERVICE.NO_VERSIONSfromdomain addstate: no_live_deploymentSERVICE.DOMAIN_RETRY_NOT_ELIGIBLESERVICE.DOMAIN_RETRY_RATE_LIMITEDretrygot HTTP 429. It prints the API's message and the wait fromRetry-AfterSERVICE.DOMAIN_QUOTA_EXCEEDEDSERVICE.DOMAIN_VERIFICATION_FAILEDwaitraises it for a failed certificate and now also for a deleted serviceSERVICE.DOMAIN_VERIFICATION_TIMEOUTwhynames the state the hostname is still inSERVICE.DEPLOY_FAILEDfrom a domain commandI searched the sibling repositories (Composer, Alchemy, create-prisma, cloud-deploy-action) and found nothing that reads the
service domainoutput. The docs site pages for these commands will need updating.Also in this diff
@prisma/management-api-sdk1.80.0 → 1.101.0, which has the new routes.packages/cli-enginechanges only its dev dependency, so it needs no release.src/lib/management-api-error.ts. Behaviour is unchanged.command-principles.md,error-conventions.mdand the error reference are updated to match.Tests
packages/cli/e2e/service-domain.e2e.tsrunsadd,show,retryanddeleteagainst the real API, on a hostname under.example, which never resolves.waitcannot have a real success case without DNS for a domain the test account owns, so it stays on the coverage backlog; the file runswait --timeout 0to prove its read.Known limits
addalso creates the workspace's record that it intends to own the domain. No CLI command shows or removes that record yet.waiting_for_dnswith the platform's reason.waitends on a single 5xx answer, although the hostname may still become active. This was already so.Alternatives considered
statusvalues, mapped from the newstate. Rejected: they describe steps the platform no longer has, several new states have no old equivalent, and the API's own fields are passed through unchanged everywhere else.failureCategoryby deriving it from the reason's prefix. Rejected: every certificate failure in practice was labelledacme, whatever its cause, so the field told a script nothing.addfailing until DNS is ready. Rejected: the API now creates the hostname either way, so a failure would leave the hostname added and tell the user it was not.waitonly read, never ask for a check. Rejected: awaitstarted after the records are published could then run to its timeout, because nothing looks DNS up again.waitask for a check after a failed certificate too. Rejected: that check orders a new certificate, and a workspace may order ten an hour.SERVICE.DOMAIN_VERIFICATION_FAILEDandSERVICE.DOMAIN_VERIFICATION_TIMEOUT, which now cover more than verification. Not done here, to keep the codes stable; cheap to do before release if wanted.Agent: monet-19
🤖 Generated with Claude Code