fix: correct CLI code samples that do not compile against the checkly package [RED-935] - #499
Merged
Merged
Conversation
…nd uptime guides [RED-935] Reported in checkly/checkly-cli#1457. The ApiCheck samples used `skipSsl` (the property is `skipSSL`) and referenced `AssertionBuilder` without importing it; the group sample set `maxResponseTime`, which CheckGroupV2 does not accept; and the URL monitor sample used the non-existent `Frequency.EVERY_60S`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ruct APIs [RED-935] The samples on detect/uptime-monitoring/cli-configuration.mdx used properties and classes that do not exist in the checkly package: `method`/`headers` on URL monitor requests, `UrlAssertionBuilder` response-time and body assertions, `target`/`timeout`/`ssl`/ `responseValidation` on TCP monitors, heartbeat monitors without `periodUnit`/`graceUnit`, a `MonitorGroup` class, and alert channels referenced by string name. Rewrite every ts/js sample pair to the real API, retitle the two sections whose feature no longer applies, name the check files so the default `checkMatch` picks them up, and bump the CI workflow sample to a Node version the current CLI supports. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ct API [RED-935] Alert channels were passed as string names on the heartbeat CLI page, API check headers were written as an object instead of an array of key/value pairs, the environments config typed `locations` as `string[]`, the environment-variables sample OR-ed a string literal with a fallback (always truthy), and the heartbeat construct page's advanced example referenced channels it never defined. Also rename the deprecated `HeartbeatCheck` alias to `HeartbeatMonitor` on the heartbeat CLI page so it matches the construct reference. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
…ED-935] The Slack App integration is the preferred way to send alerts to Slack; the webhook-based SlackAlertChannel is the legacy option. Switch the samples introduced on the uptime and heartbeat CLI pages to SlackAppAlertChannel. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…es [RED-935] `frequency: 5` reads as an ambiguous number; `Frequency.EVERY_5M` makes the unit explicit. Replace the numeric form in every hand-written CLI construct and checkly.config.ts sample and add the import to each block. Blocks that show what `checkly init` or `checkly pw-test --create-check` generate keep the number, because the CLI writes a number there. Pulumi, Terraform, and REST payload samples are unchanged since those APIs take numbers. Also point the add-to-group highlights at the `group` lines the prose describes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… name [RED-935] Three pages still imported constructs from `@checkly/cli`, the package name the CLI shipped under before it was renamed to `checkly`. Bringing those blocks under the type check also surfaced a lowercase retry strategy type (`'linear'`, the API takes `'LINEAR'`) and a mis-cased `./alert-Channels` import, and a browser check block titled as the config file. The `@checkly/cli-nodejs` auth.json paths on the login and logout pages are unchanged: the CLI still stores its config under that name. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The login and logout pages pointed at `@checkly/cli-nodejs`, but the CLI registers its config store with an explicit empty suffix, so the real directory is `@checkly/cli` (`Config` subfolder on Windows). The login page also described the tokens as encrypted; the store has no encryption key and the file is plain JSON. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Hand-written retry strategy and alert escalation objects are easy to get wrong (casing of enum values, REST-API field names that the constructs do not accept). Switch the remaining samples to RetryStrategyBuilder and AlertEscalationBuilder. The startup guide showed an `alertSettings` object in the REST API's shape, which is not a construct property; it now shows `alertEscalationPolicy` built with the builder. Also correct `comparison: 'lessThan'` to `'LESS_THAN'` in an explanatory comment. Co-Authored-By: Claude Fable 5.1 <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.
Linear: RED-935
Fixes checkly/checkly-cli#1457.
A user type-checked the TypeScript samples in these docs against the published
checklypackage and found that several do not compile. Type-checking every code block that imports fromcheckly(207 blocks) against the CLI's currentmainfound the same class of drift on eleven pages. This PR fixes all samples that use a wrong or non-existent construct API.Changes
constructs/dynamic-monitor-creation.mdx,guides/create-multiple-monitors.mdx,guides/uptime-monitoring.mdx(the pages from the issue):skipSsl→skipSSL, missingAssertionBuilderimport,maxResponseTimeremoved from theCheckGroupV2sample (not a group property),Frequency.EVERY_60S→Frequency.EVERY_1M.detect/uptime-monitoring/cli-configuration.mdx: every ts/js sample pair rewritten to the real API. The old samples usedmethod/headerson URL monitor requests, response-time and body assertions thatUrlAssertionBuilderdoes not have,target/timeout/ssl/responseValidationon TCP monitors, heartbeat monitors withoutperiodUnit/graceUnit, aMonitorGroupclass, and alert channels as strings. Two section headings were retitled because the feature they named (authentication headers, TCP SSL) is not available on those monitor types; a note points to API checks instead. Sample file names now match the defaultcheckMatchpattern.detect/uptime-monitoring/heartbeat-monitors/cli-configuration.mdx: alert channels defined as constructs instead of strings (Slack samples useSlackAppAlertChannel, the preferred Slack integration);HeartbeatCheckalias replaced withHeartbeatMonitorto match the construct reference.detect/synthetic-monitoring/api-checks/api-structure.mdx,platform/secrets.mdx: requestheaderswritten as{ key, value }arrays.concepts/environments.mdx:locationstyped as(keyof Region)[].cli/environment-variables.mdx: removed the always-truthy'{{ENVIRONMENT_URL}}' || ...fallback and corrected the prose that promised one.constructs/heartbeat-monitor.mdx: the advanced example now defines the alert channels it references.Verification
After the change, re-running the type check leaves only errors in snippets that are partial by design (
/* More options... */,checkly.config.tsfragments that show only thecheckssection,secret()snippets without imports). Those were left as-is.Other changes
Frequencyconstants (Frequency.EVERY_5M) instead of numeric minutes, so the unit is explicit. Blocks that depict generated output (checkly init,checkly pw-test --create-check) and non-CLI samples (Pulumi, Terraform, REST payloads) keep numbers, because those tools write numbers.@checkly/clipackage; they now import fromcheckly. Type-checking those blocks surfaced one more error, a lowercase retry strategytype: 'linear', now'LINEAR'.@checkly/cli-nodejs; the CLI actually stores it under@checkly/cli. The login page also claimed the file is encrypted; it is plain JSON.RetryStrategyBuilder,AlertEscalationBuilder) instead of hand-built objects. The startup guide showed analertSettingsobject in the REST API's shape, which is not a construct property; it now showsalertEscalationPolicybuilt with the builder. A mis-cased comparison value in an explanatory comment on the URL monitor page is corrected.🤖 Generated with Claude Code