Skip to content

refactor: Stage 2: Adopt new way for providers to register, test with 4 providers - #4956

Open
TomOnTime wants to merge 8 commits into
mainfrom
tlim_stage2_unify
Open

TomOnTime wants to merge 8 commits into
mainfrom
tlim_stage2_unify

Conversation

@TomOnTime

@TomOnTime TomOnTime commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Provider implementations currently register roles, constructors, credential metadata, and capabilities separately. This adds providers.Register[T](name, Definition{...}) to collect that information in one definition and derive initialization, auditing, roles, and zone operations from the implementation's interfaces.

  • Migrate NONE, BIND, DNSimple, Route 53, and Cloudflare (CLOUDFLAREAPI).
  • Allocate a fresh instance per factory call, enforce CreateOptions.RequestedRole, and preserve Route 53's registrar-only region check and conversion observers.
  • Resolve canonical names and aliases through one map of shared definition pointers, documented as read-only. Enumerate canonical definitions once in sorted order.
  • Derive DocsURL from the lowercase canonical type name. Preserve explicit legacy-path overrides, reject overrides equal to the default during registration, and remove redundant URLs from the pilot definitions. Test defaults, overrides, alias lookups, and rejection independently of later stages.
  • Keep compatibility registries for existing consumers and unmigrated providers, preserving legacy feature notes and record-type validation.
  • Inline single-use maintainer constants, provider names, and feature maps in the migrated registrations; retain provider-name constants shared with custom record registration.
  • Cover registration errors, alias collisions, pointer identity, role enforcement, independent account caches, credential-free auditing, and provider initialization with local mocks.
  • Give the JavaScript syntax-test mock its own GetZoneRecords method and remove its embedding of NONE, which now implements only the registrar role.

This is Stage 2 of the provider API rollout. Stage 1 (#4955) has merged, and this branch includes the current syntax-test compatibility adjustment. Remaining provider migrations, consumer/alias consolidation, and SupportedTypes validation will follow in separate PRs. RecordAuditingProvider remains a temporary migration interface; AuditRecords will become part of models.DNSProvider at the end of Stage 3.

Validation at fdeac2b3:

  • go test ./...
  • bin/generate-all.sh: formatting, generation, module tidy, go fix ./..., repository-wide golangci-lint (0 issues), and staticcheck all pass; no additional tracked changes.
  • git diff --check

Route 53 and Cloudflare regression tests use local mocks; no live provider integration tests or DNS mutations were performed.

@TomOnTime
TomOnTime requested a review from cafferata October 1, 2026 17:52
@TomOnTime TomOnTime changed the title refactor: unify provider registration with providers.Register refactor: Stage 1: Adopt new way for providers to register, test with 4 providers Oct 2, 2026
@TomOnTime TomOnTime changed the title refactor: Stage 1: Adopt new way for providers to register, test with 4 providers refactor: Stage 2: Adopt new way for providers to register, test with 4 providers Oct 2, 2026

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

Development

Successfully merging this pull request may close these issues.

1 participant