Skip to content

docs: roll out registrar and service syntax - #4982

Open
TomOnTime wants to merge 16 commits into
mainfrom
tlim_stage7_docs
Open

TomOnTime wants to merge 16 commits into
mainfrom
tlim_stage7_docs

Conversation

@TomOnTime

Copy link
Copy Markdown
Collaborator

REGISTRAR() and SERVICE() are implemented, but current examples and generated starter files still teach the legacy provider declarations. This updates the broad documentation set and CLI-generated configs to use the new syntax.

The draft changes the README, getting-started material, provider and language-reference examples, and generated TypeScript declarations. It adds reference pages for REGISTRAR, SERVICE, and ALL_NS. dnscontrol init now writes direct REGISTRAR()/SERVICE() calls; get-zones does the same when the credential entry has a matching TYPE, retaining a legacy explicit-type fallback when it does not. DOMAIN_ELSEWHERE_AUTO() accepts a SERVICE() modifier while preserving legacy arguments.

Validation: go test ./... and git diff --check pass. A parser audit checked 295 documentation JavaScript snippets; 34 preexisting partial or invalid examples remain outside this syntax conversion (for example, MX("@", "example.com.") in the getting-started examples omits priority).

Keep this PR in draft until a release containing Stage 6b (#4976) is available and feedback has been reviewed. The latest release checked while opening this PR was v5.3.1, which predates Stage 6b.

@TomOnTime
TomOnTime marked this pull request as ready for review October 13, 2026 18:16
@TomOnTime
TomOnTime requested a review from cafferata as a code owner October 13, 2026 18:16

@cafferata cafferata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two points that don't fit on a line in the diff:

  • The title starts with docs:, but this pull request also changes behavior: REGISTRAR() defaults to "none", REGISTRAR() is rejected in D_EXTEND(), DOMAIN_ELSEWHERE_AUTO() accepts a SERVICE() modifier, and init and get-zones generate different output. The changelog groups by Conventional Commits type, so after the squash merge these changes end up under Documentation. How do you see this? I'd like to give this refactor a bit more visibility than a documentation entry.
  • Two pages still use the legacy syntax: CSYNC and the Cloudpress usage example. The latter arrived through a merge from main.

Comment thread pkg/js/helpers.js Outdated
i === 1 && m && m._isRegistrar === true;
processDargs(m, domain.obj);
var state = domain.obj._registrarState;
state.inExtension = true;

@cafferata cafferata Oct 15, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

REGISTRAR() inside D_EXTEND() now throws "REGISTRAR cannot be used in D_EXTEND()". In v5.4.0 this was accepted and documented: the conversion guide said "an explicit REGISTRAR in D_EXTEND() must likewise follow the domain name", and the tests used D("example.com"); D_EXTEND("example.com", REGISTRAR("chosen"), SERVICE("dns", 0)). Anyone who tried the v5.4.0 syntax that way gets an error after upgrading. Is this meant as a breaking change for users of v5.4.0?

credential files still supply the default `none` and `bind` entries. These
modifiers also work in `DEFAULTS()` and `D_EXTEND()`; an explicit `REGISTRAR` in
`D_EXTEND()` must likewise follow the domain name.
Leave creds.json unchanged.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A legacy NewDnsProvider("transip", "TRANSIP") with no TYPE in the creds.json entry still works today; refineProviderType() only prints a "For future compatibility" warning. After converting to SERVICE("transip") the type can only come from creds.json, so preview fails with creds.json entry "transip" is missing: "TYPE": "FILL_IN_PROVIDER_TYPE". The previous text of this paragraph covered the TYPE requirement; with "Leave creds.json unchanged" a reader following the guide will not expect this. get-zones in this pull request keeps a legacy fallback for exactly this case.


No `NewRegistrar()` declaration is needed.

`REGISTRAR("none")` is the selects the registrar using an entry name from creds.json.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sentence looks broken: "is the selects the registrar" has a double space and missing words, and it repeats the opening sentence. In 1bd325c the paragraph was split into separate lines, and the sentence "The entry's TYPE determines the provider." disappeared at the same spot.

Comment on lines +14 to +15
name from creds.json. Its `TYPE` determines the provider. No `SERVICE()`
declaration is needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In REGISTRAR.md this sentence changed from "No REGISTRAR() declaration is needed" to "No NewRegistrar() declaration is needed" in 4de5032. Should this one read "No NewDnsProvider() declaration is needed" as well?

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants