feat(dns): M1 construct support for record types, dnsConfig and answer assertions#1416
Open
danielpaulus wants to merge 2 commits into
Open
feat(dns): M1 construct support for record types, dnsConfig and answer assertions#1416danielpaulus wants to merge 2 commits into
danielpaulus wants to merge 2 commits into
Conversation
…r assertions
Extend the DNS constructs to match the DNS v2 M1 backend surface:
- DnsRecordType union gains HTTPS + PTR, SRV, CAA, DS, DNSKEY, TLSA, NAPTR
(now equals the backend's 15 accepted types).
- DnsRequest gains an optional dnsConfig { queryTimeoutSeconds, followCname }.
- DnsAssertionBuilder gains answerData/answerName/answerType/answerTtl
(quantifier-aware: EVERY|SOME|NONE) and answerCount (numeric, no quantifier),
emitting source: 'ANSWER' + property + quantifier per the backend contract.
- matches()/notMatches() added to the shared GeneralAssertionBuilder (RE2 semantics).
- DnsMonitor.validate() mirrors the backend cross-field rules: IP query only for
PTR, ASCII/punycode query, queryTimeoutSeconds integer 1..30.
- Codegen (dns-request/dns-assertion) roundtrips dnsConfig and every new
assertion shape; shared assertion-codegen learns MATCHES/NOT_MATCHES.
- Construct + codegen unit tests (dns-monitor, dns-assertion, dns-monitor-codegen).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add DnsChangeDetection { enabled; includeTtl? } to the DnsConfig
interface (sibling of followCname) mirroring the backend
dnsConfig.changeDetection wire shape, and roundtrip it through the
DnsMonitor codegen. Covered by codegen roundtrip + synthesize tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Extends the DNS constructs to match the DNS v2 M1 backend surface (checkly monorepo progress 2.8), so a user can express every M1 feature in code (and codegen roundtrips it on import).
DnsRecordTypeunion gainsHTTPS+PTR, SRV, CAA, DS, DNSKEY, TLSA, NAPTR— now equal to the backend's 15 accepted types (schemas.jsdnsMonitorRecordTypes).DnsRequestgains an optionaldnsConfig { queryTimeoutSeconds, followCname }.DnsAssertionBuildergainsanswerData()/answerName()/answerType()/answerTtl()(quantifier-aware —EVERY|SOME|NONE) andanswerCount()(numeric, no quantifier). They emitsource: 'ANSWER'+property+quantifierper the backendvalidate-dns-answer-assertioncontract (quantifier required for all properties exceptcount).matches()/notMatches()added to the sharedGeneralAssertionBuilder(available to all check types; RE2 semantics noted in the docstring).DnsMonitor.validate()mirrors the backend cross-field rules — IP-shapedqueryonly allowed whenrecordType == PTR, ASCII/punycodequery, andqueryTimeoutSecondsinteger 1..30.dns-request-codegenemitsdnsConfig;dns-assertion-codegenemits theanswer*/matches/notMatchescalls; the sharedinternal/assertion-codegenlearnsMATCHES/NOT_MATCHES.The new
Assertion.quantifierfield is optional and emitted only when set, so sibling check types' synthesized output stays byte-identical.Tests
dns-monitor.spec.ts— new validation cases (PTR/IP, non-ASCII query,queryTimeoutSecondsrange) + asynthesize()case withdnsConfigand ANSWER assertions.dns-assertion.spec.ts(new) — builder output shape for everyanswer*method,matches/notMatches, and that existing assertions keep noquantifierkey.dns-monitor-codegen.spec.ts(new) — codegen roundtrip for record types,dnsConfig, quantified ANSWER assertions, and sharedmatches/notMatches.All three suites: 31/31 passing; eslint clean.
🤖 Generated with Claude Code