feat(cli): gRPC/SSL/Traceroute typed result rendering + IaC constructs#1362
feat(cli): gRPC/SSL/Traceroute typed result rendering + IaC constructs#1362danielpaulus wants to merge 3 commits into
Conversation
…I-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>
37e7d34 to
1f8b58d
Compare
|
Follow-up scope identified after opening this PR: the current branch adds typed result/report rendering, but CLI IaC is not complete until the new monitor constructs exist. A remote implementation run has been kicked off to add:
Current context for that work:
Tracking ticket lives in the spec branch at |
…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>
Deploy validation evidence (local devenv, flags enabled)Target: local devenv backend ( What fully passed via the real CLIA fixture project with one Parse → validate → bundle of all three new constructs succeeds against the real backend. Known blocker for end-to-end
|
| type | POST | id | GET | DELETE | GET after delete |
|---|---|---|---|---|---|
| GRPC | 201 | 3181f60a-4640-461a-92d3-efad5a3d43a1 |
200 | 204 | 404 |
| SSL | 201 | afbf4313-5dbf-4d70-9f35-bc09ec3a6466 |
200 | 204 | 404 |
| TRACEROUTE | 201 | 1f11f58d-f797-45bb-9e33-e37ee7ca2ccc |
200 | 204 | 404 |
All three created checks were deleted afterwards (confirmed 404). Created checkType values matched GRPC/SSL/TRACEROUTE.
Payload parity
GrpcMonitor/SslMonitor/TracerouteMonitor .synthesize() output is byte-identical to the previously parity-validated create bodies (request block diff = empty for all three types).
Net: constructs parse/validate/bundle through the real CLI and the backend creates checks from their exact payloads. The only gap to a single npx checkly deploy run is the devenv's unavailable code-bundle storage endpoint, not the construct code.
|
Addendum: re-ran the CLI validation without Using checkly whoami
You are currently on account "dude@dude.com" (...) as undefined.
Plan: EnterpriseThen Parsing your project... ✅
Validating project resources... ✅
Bundling project resources... ✅
Uploading Playwright tests... ❌
ServerError: An internal server error occurred
Caused by: AxiosError: Request failed with status code 500So |
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>
T65: local CLI deploy of GRPC/SSL/TRACEROUTE uptime monitorsPushed Problem: Fix (this PR): add Companion backend fix (checkly monorepo): the project-deploy path also silently dropped the type-specific config ( Verified end-to-end against devenv (real
Created checks cleaned up after verification. |
|
T65 update: CLI PR now includes the deploy fix for uptime-only projects. New commit: What changed:
UAT from hub ticket T65:
|
Summary
This branch now covers two related pieces of CLI support for the new uptime monitor types (gRPC, SSL, Traceroute):
1. Typed result/report rendering (original scope)
2. IaC constructs (added)
Implements the missing
checkly/constructsclasses so users can author and deploy the new monitor types, and so backend CLI export templates thatimport { GrpcMonitor, SslMonitor, TracerouteMonitor } from 'checkly/constructs'compile.GrpcMonitor(grpc-monitor.ts,grpc-request.ts,grpc-assertion.ts+ codegen) —checkType: 'GRPC', top-leveldegradedResponseTime/maxResponseTime(≤30000). Request mirrors the public API:url,port,ipFamily,skipSSL,timeout,grpcConfig { mode, tls, storeResponseBody, serviceDefinition, method, protoContent, message, service, metadata },assertions.GrpcAssertionBuilder:responseTime,statusCode,healthCheckStatus,responseMessage,responseMetadata.SslMonitor(ssl-monitor.ts,ssl-request.ts,ssl-assertion.ts+ codegen) —checkType: 'SSL'. Response-time limits live insidesslConfig(degradedResponseTimeMs/maxResponseTimeMs), not at the top level. ModelsserverName,skipChainValidation,handshakeTimeoutMs,alertDaysBeforeExpiry,securityBaseline,clientCertificateMode+sslClientCertificateId.SslAssertionBuildercovers cert expiry/trust/hostname/TLS version/cipher/key size/etc.TracerouteMonitor(traceroute-monitor.ts,traceroute-request.ts,traceroute-assertion.ts+ codegen) —checkType: 'TRACEROUTE', top-leveldegradedResponseTime/maxResponseTime(≤30000). Request:url,protocol,port,ipFamily,maxHops,maxUnknownHops,ptrLookup,timeout,assertions.portis dropped from generated code forICMPprobes (matches the backend strip).TracerouteAssertionBuilder:responseTime,hopCount,packetLoss.Wiring:
constructs/index.ts.constructs/check-codegen.ts(GRPC → GrpcMonitorCodegen,SSL → SslMonitorCodegen,TRACEROUTE → TracerouteMonitorCodegen).GRPC/SSL/TRACEROUTEadded toconstants.CheckTypes.Request shapes were verified against
checkly-go-sdktypes and the terraform-provider resource schemas, and the synthesized payloads are byte-identical to the previously parity-validated create bodies.3. Deploy fix for uptime-only projects (T65)
Bundler.isEmptyand skips thearchive.store()/ "Uploading Playwright tests" step when no files were registered for bundling./next/checkly-storage/upload-code-bundle.Feature flags for the backend:
GRPC_CHECKS,SSL_CHECKS,TRACEROUTE_CHECKS.Testing
npx checkly deployagainst local devenv through the dev-auth proxy created one GRPC, one SSL, and one TRACEROUTE check withoutCHECKLY_SKIP_AUTH; the uptime-only project skipped "Uploading Playwright tests"; checks were readable via the public API and cleaned up.tsc --noEmitandtsc --build: clean.eslinton all new/changed files: clean.constructs/__tests__/grpc-monitor.spec.ts,ssl-monitor.spec.ts,traceroute-monitor.spec.ts— synthesize / validation / grouping.constructs/__tests__/uptime-monitor-codegen.spec.ts— codegen emits compiling construct code (incl. ICMPportstrip, assertion builders).constructs/__tests__/uptime-monitor-export-snippets.spec.ts— backend-style export snippets compile againstcheckly/constructsand synthesize the expected payload.