Skip to content

feat(provider): enumerate + import infra.dns_delegation (registrar+live NS)#33

Merged
intel352 merged 2 commits into
mainfrom
feat/hover-delegation-enumerate
Jun 2, 2026
Merged

feat(provider): enumerate + import infra.dns_delegation (registrar+live NS)#33
intel352 merged 2 commits into
mainfrom
feat/hover-delegation-enumerate

Conversation

@intel352
Copy link
Copy Markdown
Contributor

@intel352 intel352 commented Jun 2, 2026

Lets the Hover provider bulk-import registrar NS delegation so the DNS catalog can capture each domain's delegation alongside its hosted records. Part 2 of 3; design workflow/docs/plans/2026-06-02-dns-delegation-portfolio-design.md + ADR 0047.

Changes

  • EnumerateAll now accepts infra.dns_delegation (lists domains, same ListDomains call) in addition to infra.dns; unknown types still rejected.
  • Import gets a delegation branch: a new DelegationDriver.ReadForImport dual-fetches registrar NS (GetDomainDelegation = authoritative intent) + live NS (public lookup = propagation), emitting Outputs{nameservers(=registrar, primary), registrar_nameservers, live_nameservers}. This bypasses the live-first DelegationDriver.Read — so during an NS-switch the catalog records the registrar's intended NS, not the stale live NS. The registrar-vs-live gap is the staging signal.

DelegationDriver.Read/drift/apply semantics are untouched (zero blast radius). nameservers stays the primary key so existing Diff/nameserversFromOutputs are consistent (no spurious drift). go test ./... green incl. existing delegation Diff/Read tests + real-browser tests.

Needs a hover v0.5.1 release after merge; consumed by gocodealone-dns (PR3).

🤖 Generated with Claude Code

intel352 and others added 2 commits June 2, 2026 12:13
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add DelegationDriver.ReadForImport which fetches the Hover registrar NS
(authoritative intent) first, then the live public NS best-effort, and
returns both as separate Outputs keys. HoverProvider.Import now routes
infra.dns_delegation through this path so a catalog import captures
registrar intent rather than TTL-cached live NS during an NS switch.
The primary "nameservers" key is set to the registrar NS, keeping
existing Diff/nameserversFromOutputs semantics consistent.
DelegationDriver.Read is unchanged (drift/apply path unaffected).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 2, 2026 16:18
@intel352 intel352 merged commit f3b0985 into main Jun 2, 2026
5 checks passed
@intel352 intel352 deleted the feat/hover-delegation-enumerate branch June 2, 2026 16:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds bulk enumeration and import support for infra.dns_delegation so the Hover provider can populate the DNS catalog with both registrar-intended and live-propagated nameserver delegation for each domain.

Changes:

  • Extend EnumerateAll to accept infra.dns_delegation (same ListDomains listing as infra.dns).
  • Add an Import fast-path for infra.dns_delegation that uses a new DelegationDriver.ReadForImport dual-fetch (registrar NS + best-effort live NS) while keeping existing drift/apply semantics unchanged.
  • Add targeted unit tests covering EnumerateAll(infra.dns_delegation) and the delegation import behavior, plus driver-level tests for ReadForImport.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
internal/provider.go Adds delegation-aware Import path and allows EnumerateAll for infra.dns_delegation.
internal/provider_test.go Adds tests for delegation enumeration and delegation import behavior.
internal/drivers/delegation.go Introduces ReadForImport to capture registrar + live NS during import.
internal/drivers/delegation_test.go Adds tests validating ReadForImport dual-fetch and failure handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/provider.go
Comment on lines +283 to +292
if dd, ok := d.(*drivers.DelegationDriver); ok {
out, err := dd.ReadForImport(ctx, ref)
if err != nil {
return nil, fmt.Errorf("hover import %q: %w", cloudID, err)
}
if out == nil {
return nil, fmt.Errorf("hover import %q: driver returned nil output", cloudID)
}
return buildResourceState(cloudID, out), nil
}
Comment on lines +236 to +239
outputs := map[string]any{
"nameservers": nameserversToAny(dom.Nameservers),
"registrar_nameservers": nameserversToAny(dom.Nameservers),
}
Comment thread internal/provider_test.go
Comment on lines +250 to +254
// fakeDelegationClientForImport satisfies HoverDelegationClient and
// hoverDomainLister so it can be injected into both the DelegationDriver
// and HoverProvider.domains field. It also satisfies hoverclient.HoverClient
// via a nil client stored in drivers so we need a separate provider-level stub.
type fakeDelegationClientForImport struct {
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.

2 participants