feat(dns): canonical record/portfolio schema + import-all --format portfolio#798
Merged
Merged
Conversation
- C-1: TestSanitizeRedactsPublicIPv4/v6 use genuinely-public IPs (8.8.8.8, 2606:4700:4700::1111) + assert output differs from input (no longer vacuous) - C-2: looksLikeSecret no longer false-redacts long DMARC (>80 char p=reject); DKIM requires v=DKIM1 + a long base64-ish p= blob (hasLongBase64PField) - I-1: canonicalize stores priority/port/weight/flags when KEY present even if zero (RFC-7505 null-MX priority=0, SRV weight/port=0 no longer dropped) - I-2: isPublicIPv4/v6 rewritten on net.ParseIP + stdlib predicates; excludes RFC-6598 CGNAT (100.64/10), IPv6 ULA (fc00::/7), broadcast; redacts routable 2001:dbc/2001:db0 (no longer over-broad 2001:db prefix); RFC-5737/3849 spared - I-3: TestDumpPortfolioToFile_WithSanitize asserts Sanitized==true + example IP - M-2: isWFInfraPolicyTXT guards on record NAME (_workflow-dns-policy) too
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
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.
Summary
Adds a canonical, strict DNS record/portfolio schema (
dns/record) and an--format portfoliooutput mode towfctl infra import-all, so DNS state can be exported as a provider-neutralworkflow.dns-portfolio.export.v1document. Foundation for the dogfooded DNS catalog (gocodealone-dns) + provider-portability.Part of the DNS-management reconciliation cascade (design + plan + ADRs 0004/0005/0006 in the GoCodeAlone workspace intent repo,
docs/plans/2026-05-29-dns-management-reconciled{,-design}.md). This is PR 1 of 3 (workflow / workflow-scenarios / gocodealone-dns).Changes
dns/record/(new pkg): flat canonical typesPortfolio{Schema,Sanitized,Snapshots[]}/Snapshot{ID,Provider,Domain,Authority,Records[],Extra}/Record{Type,Name,Value,TTL,Priority,Port,Weight,Flags,Tag}matching the scenario-88dns-portfolio.export.v1fixture (record value key =value).Validateis structural-only (rejects empty type / negative TTL; preserves unknown record types — snapshots are an open set).FromResourceStatescanonicalizes imported IaC state → portfolio, aliasing the per-provider value key (data/content/address/value) so DigitalOcean, Hover (content), and Namecheap (address) all map correctly. Preserves zero-valuedpriority/port/weight/flags(RFC-7505 null-MX, SRV weight=0).Sanitize(for shareable snapshots):net.ParseIP-based public-IP → RFC-5737/3849 example replacement (private/ULA/CGNAT/loopback preserved), DKIM-key redaction (DMARC policy records preserved),_workflow-dns-policyTXT preserved by record name.wfctl infra import-all: new--format state|portfolio(defaultstate, back-compat) +--sanitize.--format portfolioemits the canonical document; the dump is auxiliary (a dump error warns, never fails a successful import).Test plan
GOWORK=off go test ./dns/record/... ./cmd/wfctl/...— green (dns/record 20 tests).GOWORK=off golangci-lint run ./dns/record/ ./cmd/wfctl/— 0 issues.Scope Manifest
PR Count: 3 · Tasks: 11 · Status: Locked 2026-05-30T02:54:30Z
This PR = row 1 (Tasks 1-4).
🤖 Generated with Claude Code