Commit cf60e7e
feat(ssl-assertion): export TlsVersion, CipherSuite, SignatureAlgorithm typed constants (#1392)
* feat(reporters): per-type TRACEROUTE/GRPC/SSL result rendering (P4-CLI-RESULTS)
Render failure-debug diagnostics for the three uptime monitor types across
every CLI result surface, mirroring the 4.1 public check-results fields:
- rest/check-results.ts: typed TracerouteCheckResult/GrpcCheckResult/
SslCheckResult interfaces + additive fields on CheckResult/CheckResultField.
- formatters/check-result-detail.ts: per-type terminal + markdown diagnostic
block (checks results get) keyed on the typed fields.
- reporters/util.ts: GRPC/SSL/TRACEROUTE branches in formatCheckResult
(checkly test terminal), sourced from the runner artifact (checkRunData).
- formatters/batch-stats.ts: add the three types to TIMING_TYPES.
- reporters/json.ts: emit a per-type diagnostics object in the JSON report
for a failed run (checkly test --reporter json).
Snapshot + assertion tests for each type across all three surfaces.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(constructs): add GrpcMonitor, SslMonitor, TracerouteMonitor IaC constructs
Implement the missing CLI constructs so users can author and deploy gRPC, SSL
and Traceroute uptime monitors via checkly/constructs, and so backend CLI export
templates that import these classes compile.
Constructs follow the DNS/TCP/ICMP monitor pattern (extend Monitor, register
with Session, validate, synthesize):
- GrpcMonitor / GrpcRequest / GrpcConfig / GrpcMetadata + GrpcAssertionBuilder
(RESPONSE_TIME, GRPC_STATUS_CODE, GRPC_HEALTHCHECK_STATUS, GRPC_RESPONSE,
GRPC_METADATA). checkType GRPC, top-level degraded/maxResponseTime (<=30000).
- SslMonitor / SslRequest / SslConfig / SecurityBaseline + SslAssertionBuilder
(cert expiry, chain, hostname, TLS version, cipher, key size, etc). checkType
SSL; response-time limits live in sslConfig (degraded/maxResponseTimeMs).
- TracerouteMonitor / TracerouteRequest + TracerouteAssertionBuilder
(RESPONSE_TIME, HOP_COUNT, PACKET_LOSS). checkType TRACEROUTE, top-level
degraded/maxResponseTime (<=30000); port dropped for ICMP probes.
Request shapes mirror the public API (verified against checkly-go-sdk types and
the p5-parity captured payloads). Wires exports in constructs/index.ts, import
codegen in check-codegen.ts (GRPC/SSL/TRACEROUTE -> *MonitorCodegen), and adds
the three types to constants.CheckTypes.
Tests: construct synthesize/validation/grouping specs, codegen specs (incl.
ICMP port-strip and assertion builders), and a regression spec asserting the
backend-style export snippets compile against checkly/constructs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(deploy): skip code-bundle upload when nothing was bundled
archive.store() (the 'Uploading Playwright tests' step) was called
unconditionally on every deploy. For a project of only uptime monitors
(GRPC/SSL/TRACEROUTE), the bundler registers no files, so this uploaded an
empty Playwright bundle — an unnecessary code-bundle upload in production, and
a hard failure in devenv where it 500s on the storage backend.
The remote code bundle is consumed only by Playwright check suites (via
bundler.marker -> playwright-check.ts); browser checks upload snapshots
separately. Add Bundler.isEmpty and skip store() when no files were registered.
Refs T65.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat(cli): wire gRPC/SSL/Traceroute analytics paths + connection-error rendering
Addresses review (Simo) new-monitor checklist gaps:
- src/rest/analytics.ts: add checkTypeToPath (grpc-checks/ssl/traceroute) and
defaultMetrics for the three types, matching the backend analytics routes +
metric registries (gRPC total_*, SSL handshakeTimeMs_*/daysUntilExpiry_avg,
TRACEROUTE finalHopLatencyAvg_*/totalHops_avg).
- src/reporters/util.ts: add the Connection Error subsection to the GRPC/SSL/
TRACEROUTE result blocks, mirroring ICMP/DNS.
* docs(cli): AI context references + examples for gRPC/SSL/Traceroute monitors
Addresses review (Simo) new-monitor checklist Phases 5 & 7:
- ai-context/references/configure-{grpc,ssl,traceroute}-monitors.md + REFERENCES
and EXAMPLE_CONFIGS entries in context.ts (inline exampleConfig).
- examples/advanced-project{,-js}/src/__checks__/uptime/{grpc,ssl,traceroute}
TS + JS examples with group, assertions, and doc-link comments.
* test(cli): e2e deploy fixtures + Create assertions for gRPC/SSL/Traceroute
Addresses review (Simo) new-monitor checklist Phase 6:
- e2e/__tests__/fixtures/deploy-project/{grpc,ssl,traceroute}.check.ts (activated:false)
- deploy.spec.ts: assert the three logical IDs in the Create output.
* feat(cli): support TEXT_BODY assertions for gRPC monitors
Mirror monorepo #2730 which added TEXT_BODY to grpcMonitorAssertionSources.
Adds GrpcAssertionBuilder.textBody() (source TEXT_BODY) + codegen case,
matching the API check's textBody() builder.
* refactor(cli): restructure SslMonitor props per review (wire shape unchanged)
Per @sorccu's review: make SslMonitor ergonomics consistent with other monitors.
- degradedResponseTime/maxResponseTime -> construct top level (were in sslConfig)
- hostname/port/ipFamily -> request top level (were in sslConfig)
- sslClientCertificateId -> into sslConfig (was on request)
synthesize() remaps to the identical API wire shape (request.sslConfig.* +
request.sslClientCertificateId), so the payload the backend receives is unchanged.
Updated codegen (wire->construct), unit + codegen + export-snippet tests,
examples (ts+js), e2e fixture, and AI context.
* refactor(cli): drop Ms suffix on SslConfig.handshakeTimeout per review
@sorccu: we don't suffix timeout properties with Ms even when the value is
milliseconds. Renames the construct field handshakeTimeoutMs -> handshakeTimeout;
synthesize() and the codegen wire interface keep the API's handshakeTimeoutMs.
* refactor(cli): emit SSL degraded/maxResponseTime at top level to match gRPC/traceroute wire
* feat(ssl-assertion): export TlsVersion, CipherSuite, SignatureAlgorithm typed constants
Add three exported const objects and matching type aliases so callers get
IDE autocomplete for the finite value sets:
- TlsVersion: TLS1_0/TLS1_1/TLS1_2/TLS1_3
- SignatureAlgorithm: common X.509 algorithm strings (sha256WithRSAEncryption, etc.)
- CipherSuite: TLS 1.3 suites + widely-deployed TLS 1.2 ECDHE/RSA suites
The GeneralAssertionBuilder API is unchanged; existing string-literal calls
continue to compile and work at runtime.
* fix(ssl-assertion): real type safety + correct SignatureAlgorithm wire values
Blocker 1 — GeneralAssertionBuilder now takes an optional TargetType generic
parameter (default: string|number|boolean for full backward compatibility).
tlsVersion(), cipherSuite(), signatureAlgorithm() return the narrowed form so
.equals() only accepts the typed union — invalid values are rejected at compile
time. matches() stays string (it carries a regex, not a value to compare).
Blocker 2 — SignatureAlgorithm constants now use Go's
x509.Certificate.SignatureAlgorithm.String() output (SHA256-RSA, ECDSA-SHA256,
etc.) matching the values the runner evaluates assertions against.
New test file ssl-assertion.spec.ts uses @ts-expect-error to prove:
- valid constants / string literals are accepted for all three typed builders
- invalid strings (wrong format, arbitrary strings, numeric) are rejected
- matches() remains unconstrained as intended
* fix(ssl-assertion): revert cipherSuite to unconstrained; complete SignatureAlgorithm union
cipherSuite() — Go's tls.CipherSuiteName() returns hundreds of IANA names plus
0x.... hex fallbacks; the 15-value union blocked valid values like
TLS_RSA_WITH_RC4_128_SHA. Reverted the builder to unconstrained string. The
CipherSuite constants remain for autocomplete convenience.
SignatureAlgorithm — completed the union to the full Go x509.SignatureAlgorithm.String()
set (16 values): added MD2-RSA, MD5-RSA, DSA-SHA1, DSA-SHA256, ECDSA-SHA1.
The type now covers every value the runner can emit without blocking any valid input.
Updated ssl-assertion.spec.ts: removed @ts-expect-error for cipher strings (now
unconstrained), added tests showing arbitrary cipher suite strings compile, and
expanded the signatureAlgorithm test to cover all 16 constants.
* refactor(cli): drop greaterThanOrEqual and matches from SSL assertions [SIM-295]
Remove the GREATER_THAN_OR_EQUAL (`greaterThanOrEqual`) and MATCHES (`matches`)
comparison operators from the CLI assertion builders — we are not yet sure we
want to keep these assertions. Drops the two methods from the shared
Numeric/General assertion builders, the two members from the Comparison union,
and the related SSL examples/docs/tests. `tlsVersion`, `keySizeBits`,
`cipherSuite` and `signatureAlgorithm` keep `equals`/`notEquals`, which remain
backend-valid.
The backend (Joi §9 + go-runner) still supports both operators, so this only
removes the CLI surface and they can be re-exposed later if we decide to keep
them.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
---------
Co-authored-by: Ubuntu <ubuntu@ip-172-31-7-108.eu-central-1.compute.internal>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent c66f2f2 commit cf60e7e
3 files changed
Lines changed: 234 additions & 15 deletions
File tree
- packages/cli/src/constructs
- __tests__
- internal
Lines changed: 101 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| |||
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
73 | | - | |
| 85 | + | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
77 | | - | |
| 89 | + | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
| |||
86 | 98 | | |
87 | 99 | | |
88 | 100 | | |
89 | | - | |
| 101 | + | |
90 | 102 | | |
91 | 103 | | |
92 | 104 | | |
93 | | - | |
| 105 | + | |
94 | 106 | | |
95 | 107 | | |
96 | 108 | | |
| |||
102 | 114 | | |
103 | 115 | | |
104 | 116 | | |
105 | | - | |
| 117 | + | |
106 | 118 | | |
107 | 119 | | |
108 | 120 | | |
109 | | - | |
| 121 | + | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
3 | 89 | | |
4 | 90 | | |
5 | 91 | | |
| |||
12 | 98 | | |
13 | 99 | | |
14 | 100 | | |
| 101 | + | |
15 | 102 | | |
16 | 103 | | |
17 | 104 | | |
| |||
77 | 164 | | |
78 | 165 | | |
79 | 166 | | |
80 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
81 | 171 | | |
82 | | - | |
83 | | - | |
| 172 | + | |
| 173 | + | |
84 | 174 | | |
85 | 175 | | |
86 | 176 | | |
87 | 177 | | |
88 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
89 | 183 | | |
90 | | - | |
| 184 | + | |
91 | 185 | | |
92 | 186 | | |
93 | 187 | | |
| |||
117 | 211 | | |
118 | 212 | | |
119 | 213 | | |
120 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
121 | 227 | | |
122 | | - | |
123 | | - | |
| 228 | + | |
| 229 | + | |
124 | 230 | | |
125 | 231 | | |
0 commit comments