feat: zone_groups support and ZoneResolver service - #61
Merged
Conversation
Introduces zone_groups as a way to auto-discover zones from a provider without listing each one explicitly. Explicit zones: entries always take precedence over zone_groups (with a warning on conflict). All four commands (plan, apply, drift, validate) now use IZoneResolver for zone loading.
… coverage Adds ~100 new tests across 5 new files and 1 expanded file: - ZoneResolverTests: 20 tests covering discovery, include/exclude patterns, explicit-zone precedence, case insensitivity, multiple groups, failure resilience - ZoneDiffEdgeCaseTests: 14 tests for empty zones, wildcards, SOA filtering, apex-NS flags, TTL-only changes, mixed create/update/delete - ZoneValidatorBoundaryTests: 18 tests for TTL=0/max, SRV port 0/65535/65536, MX preference 0/65535/65536, CAA flags, empty zones - ZoneYamlSerializerEdgeCaseTests: 15 tests for QuoteScalar (@, backtick, colon, hash, quotes, backslash, empty) and QuoteTxt round-trips - YamlProviderEdgeCaseTests: 15 tests for paths with spaces, hyphens, missing files, non-YAML files, malformed YAML, TTL defaults, \; unescape, key edge cases - ConfigLoaderTests: +8 zone_groups validation tests (parsing, unknown source/target, same source+target, read-only target, empty targets, zone_groups-only config)
DNS names are case-insensitive per RFC 1035. GroupBy now uses ToLowerInvariant() on name and ToUpperInvariant() on type so that records differing only in case are treated as the same RRset. Discovered during test audit — previously ZoneDiff was case-sensitive, which could cause spurious creates/deletes if providers returned names in different cases.
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.
Fixes #60
Summary
zone_groups:config section for auto-discovery of zones from a provider without listing each one explicitlyIZoneResolverservice that merges explicitzones:+ discoveredzone_groups:— decoupling zone loading from command logiczones:always wins overzone_groups:(warning shown on conflict)include_pattern/exclude_patternregex filters per groupplan,apply,drift,validate) now useIZoneResolverzone_groupsNew config structure
Test plan
zones:→ behavior identical to current (no regression)zone_groups:→ discovered zones are planned/applied/driftedzones:andzone_groups:→ explicit wins, warning showninclude_pattern/exclude_patternfilter correctlydns-sync validatevalidates zone_groups zonesdns-sync driftchecks zone_groups zonesdotnet test→ all 188 tests pass