Commit cdf176f
fix(cli): SSL/gRPC/traceroute — valid assertion builders, honest reporter, rich checks get [SIM-286][SIM-287][SIM-291] (#1391)
* 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
* fix(reporters): don't render green assertions on a request error; add gRPC/SSL detail [SIM-286]
Suppress the Assertions block when a result has a requestError (nothing was
evaluated); humanize gRPC assertion source labels; render gRPC response time;
add an SSL response-time reason line and a security-baseline verdict line.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
* fix(constructs): make SSL/traceroute assertion builders emit backend-valid payloads [SIM-287]
responseTime() defaults property to 'avg' + avg/min/max/stdDev selectors;
SslBaselineSeverity 'warn' -> 'degrade'; add greaterThanOrEqual and matches
builders; add SSL sources OCSP_STAPLED/HANDSHAKE_TIME_MS/SAN_CONTAINS; add
degraded<=max validation. Codegen updated to round-trip all of the above.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
* feat(cli): show assertions + rich per-type detail in checkly checks get [SIM-291]
checkly checks get --result rendered the per-type RESULT block but omitted
the assertions (so a failing SSL/gRPC/traceroute check showed no reason) and
a lot of available detail. Bring it on par with checkly test and surface the
rich result body agents can use:
- Extract the assertion-line renderer into a shared formatters/assertion-line.ts
used by BOTH the checkly test reporter and checks get, so they render
identically and cannot drift.
- Add an ASSERTIONS section to the SSL/gRPC/traceroute detail formatters
(terminal + markdown), including a Received value for falsy actuals (0/false/'').
- gRPC: add a TIMING breakdown (dns/connect/total).
- SSL: add a CERTIFICATE section (subject/issuer CN, validity, key, signature,
SHA-256 fingerprint, SANs, serial, self-signed/CA, OCSP stapled) and a per-rule
SECURITY BASELINE breakdown, keeping the one-line baseline summary.
- Traceroute: add probe protocol + DNS timing.
- Harden the shared truncate() to cap on the stringified length (objects/numbers
no longer bypass it) and slice by code point (no split surrogate pairs); give
the markdown request-error its own heading.
The --output json path already emits the full result body and is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
* test(cli): cover scalar baseline rule + self-signed/CA cert flags [SIM-291]
Adds the two branches the tri-model review flagged as untested: a scalar
securityBaseline rule (rendered as key: value) and selfSigned/isCA=true cert
flags. Test-only; no behavior change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
* fix(grpc): raise response-time cap to 180000ms in the CLI construct [SIM-287]
GrpcMonitor capped degradedResponseTime/maxResponseTime at 30000 (JSDoc @maximum
and the validate() bounds), but gRPC calls run to the 180s timeout and the backend
allows up to 180000 (grpcResponseTimeLimitFields). Users couldn't set a gRPC
threshold above 30s. Raise the cap to 180000 to match the backend (and the
terraform provider fix).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
* style(cli): single-quote strings in ssl-assertion-codegen spec [SIM-287]
Fixes 4 @stylistic/quotes lint errors (strings must use single quotes) in
ssl-assertion-codegen.spec.ts — the affected `expected` strings contain inner
single quotes and were written with double quotes; the repo eslint config
requires single quotes with escaping.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
* fix(cli): stabilize assertion symbols across platforms
* refactor(cli): drop greaterThanOrEqual, matches, handshakeTime, sanContains from SSL assertions [SIM-287]
Mirror the removals made on #1392 so the two SSL-assertion PRs stay consistent
and don't resurrect this API when they merge:
- Remove greaterThanOrEqual (GREATER_THAN_OR_EQUAL) and matches (MATCHES) from
the shared Numeric/General assertion builders + the Comparison union, and
their codegen cases in internal/assertion-codegen.ts.
- Remove the handshakeTimeMs()/HANDSHAKE_TIME_MS and sanContains()/SAN_CONTAINS
SSL sources (builder + union + ssl-assertion-codegen cases).
- Update ssl-monitor + ssl-assertion-codegen specs to the remaining
backend-valid operators (equals/notEquals). Keeps keySizeBits/certExpiresInDays.
The SSL result's handshakeTimeMs response field is unaffected. Backend still
supports all of these operators/sources, so they can be re-exposed later.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NC9pESYE5wGqy5TKRzufyc
* style(cli): remove padded blank line in ssl-assertion-codegen spec [SIM-287]
Fixes @stylistic/padded-blocks after dropping the removed-operators test block.
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 ee3eab5 commit cdf176f
37 files changed
Lines changed: 2409 additions & 314 deletions
File tree
- packages/cli/src
- ai-context/references
- constructs
- __tests__
- internal
- formatters
- __tests__
- __fixtures__
- __snapshots__
- reporters
- __tests__
- __snapshots__
- fixtures
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
Lines changed: 119 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
125 | 155 | | |
126 | 156 | | |
127 | 157 | | |
| |||
138 | 168 | | |
139 | 169 | | |
140 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
141 | 257 | | |
142 | 258 | | |
Lines changed: 46 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 | + | |
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
101 | 143 | | |
0 commit comments