docs: document PWCS cancellation feature [RED-511]#308
Conversation
- New concepts/cancellation.mdx covering cancellation surfaces, post-cancel flow, and API versioning
- New api-reference/cancel/cancel-a-session.mdx for POST /v1/cancel
- New v2 check-session reference pages (trigger, retrieve, await completion)
- Sidebar entries in docs.json for the above
- Cross-links from concepts/results.mdx, communicate/alerts/configuration.mdx
- Ctrl+C cancellation sections in cli/checkly-{pw-test,test,trigger,deploy}.mdx
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| ## Cancelling a run | ||
|
|
||
| {/* TODO: confirm CLI version that ships pw-test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships pw-test Ctrl+C handling (RED-375), or remove this Note if Ferran prefers a generic call-out. The Linear ticket is still in In Review.
| {/* TODO: confirm CLI version that ships pw-test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| Press <kbd>Ctrl</kbd>+<kbd>C</kbd> during a `checkly pw-test` run to cancel the test session. The CLI sends a cancel request and waits for the runner to stop. Pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> a second time exits the CLI without waiting. |
There was a problem hiding this comment.
Verify the Ctrl+C UX matches what shipped: "no detach prompt; second Ctrl+C exits without waiting." I took this from the project spec (RED-375), not from reading the CLI source.
| ## Cancelling a run | ||
|
|
||
| {/* TODO: confirm CLI version that ships test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships checkly test Ctrl+C handling (was RED-373, marked Duplicate — verify it actually shipped), or remove this Note.
| {/* TODO: confirm CLI version that ships test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| When you started the run with `--record`, pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> prompts you to either **cancel** the recorded test session in Checkly or **detach** and let it finish in the background. Detach is the default. Cancellation only applies to Playwright Check Suite runs inside the session. |
There was a problem hiding this comment.
Verify "cancel or detach, detach is default" matches what shipped. RED-373 was marked Duplicate so I'm not 100% sure this is the final UX.
| ## Cancelling a run | ||
|
|
||
| {/* TODO: confirm CLI version that ships trigger Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships checkly trigger Ctrl+C handling (RED-373 dup), or remove this Note.
| {/* TODO: confirm CLI version that ships trigger Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| When you started the run with `--record`, pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> prompts you to either **cancel** the recorded test session in Checkly or **detach** and let it finish in the background. Detach is the default. Cancellation only applies to Playwright Check Suite runs inside the session. |
There was a problem hiding this comment.
Same UX question as in checkly-test.mdx — confirm "detach is the default" is accurate.
| ## Cancelling a deploy | ||
|
|
||
| {/* TODO: confirm CLI version that ships deploy Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships checkly deploy Ctrl+C handling (RED-374 dup), or remove this Note.
| {/* TODO: confirm CLI version that ships deploy Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| `checkly deploy` may run [Playwright Check Suites](/detect/synthetic-monitoring/playwright-checks/overview) as part of post-deploy verification. Pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> during that phase prompts you to either **cancel** the recorded check session or **detach** and let it finish in the background. Detach is the default. |
There was a problem hiding this comment.
Confirm: (1) checkly deploy actually runs PWCS as part of post-deploy verification today — is that universally true or only when configured? (2) "detach is the default" matches what shipped.
Match the convention used by check-groups and check-results: v1 MDX pages get deprecated: true when a v2 equivalent exists. Updates the matching ResponseField label in concepts/cancellation.mdx from backwards-compatible to deprecated for consistency. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The v2 OpenAPI entries have no description fields, so the auto-rendered pages were blank. Carry the v1 description text forward in the MDX body and add a What's new in v2 note covering the CANCELLED status value and isCancelled result flag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The /v1/cancel OpenAPI entry has no description, so the auto-rendered page only showed the request schema. Add MDX body content explaining the discriminated body (checkSessionId vs testSessionId), the optional sequenceId narrowing, and the Playwright-only constraint, with a link out to the cancellation concept page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| The successful response of this endpoint is equivalent to the [retrieve a check session](/api-reference/check-sessions/retrieve-a-check-session-v2) endpoint's response for a completed check session. | ||
|
|
||
| <Note> | ||
| **What's new in v2:** `status` may return the new `CANCELLED` value for sessions that were [cancelled](/concepts/cancellation), and every per-result object includes an `isCancelled` boolean. v1 clients continue to work unchanged and never see these additions. |
There was a problem hiding this comment.
for v1, cancelled is mapped to TIMED_OUT
There was a problem hiding this comment.
Good point, added that!
The only v2-only addition is the CANCELLED status enum value; v1 maps cancelled sessions to TIMED_OUT. The isCancelled boolean on per-result objects is additive and present in both versions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Verified the Ctrl+C cancellation behavior against the checkly-cli RED-375 branch: - Remove the "Cancelling a deploy" section — checkly deploy has no cancellation handling. - Note that cancellation requires a recorded test session (checkly test/trigger --record; pw-test records by default). - Document the --detach flag on pw-test, test, and trigger, and fix the default: Ctrl+C opens a cancel prompt by default, and --detach is the opt-in flag to skip it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Recovers the work from commit e4c25ee, which was dropped during a rebase onto the updated remote branch. The RED-512 backend changes are in the production OpenAPI spec, so the v2 check-session and /v1/cancel endpoints carry full request, response, and description content. Strip the manually-written prose from the three v2 check-session pages so the synced spec drives their content, matching the v1 pages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The public API replaced POST /v1/cancel with two path-scoped endpoints:
POST /v1/check-sessions/{checkSessionId}/cancel and
POST /v1/test-sessions/{testSessionId}/cancel.
- openapi.json: swap the cancel path and schemas to match the live spec;
update v2 check-session descriptions that cross-referenced /v1/cancel
- Split the reference page into cancel-a-check-session and
cancel-a-test-session, filed under the Check Sessions and Test Sessions
nav groups; drop the standalone Cancel group
- cancellation.mdx: update API tab, curl examples, and versioning notes
- style.css: add a dark-mode rule so <kbd> keys are visible
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
checkly-cli #1306 makes `checkly test` and `checkly trigger` record a test session by default (opt out with --no-record), matching pw-test. - test/trigger reference pages: --record -> --[no-]record, note that recording defaults to enabled since CLI v8.0.0 - Fill in CLI v8.0.0 for the cancellation availability notes across test, trigger, and pw-test (replacing the vX.X placeholders) - cancellation.mdx and cancel-a-test-session.mdx: test sessions are created by checkly test/trigger/pw-test, which all record by default Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Show the --record flag explicitly in example snippets so they work on pre-v8.0.0 CLIs where recording is opt-in. The --detach examples omit it, since --detach only exists in v8.0.0+ where --record is default. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-511] The shipped checkly-cli (PR #1292) cancels directly on Ctrl+C; the cancel-confirmation prompt was prototyped but never merged. Update the docs to match: first Ctrl+C cancels the session, the CLI keeps running to report results, a second Ctrl+C exits immediately, and --detach exits at once leaving checks running in the cloud. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3d909ce to
5f2839a
Compare
Documents the Playwright Check Suite cancellation feature shipping under Allow cancellation of PWCS runs & test sessions (RED-511).
Summary
Cancellation lets you stop in-progress Playwright Check Suite runs from the UI, public API, or CLI. This PR adds the concept page, the API reference for the cancel endpoints, the v2 check-session pages, and CLI cancellation docs — plus follow-on updates for two related CLI/API changes found along the way.
New pages
concepts/cancellation.mdx— what can be cancelled (check session vs. test session), how to cancel from UI/API/CLI, what happens after a run is cancelled (no alerts, excluded from metrics, no automated incidents), and the v1/v2 API versioning split.api-reference/check-sessions/cancel-a-check-session.mdxandapi-reference/test-sessions/cancel-a-test-session.mdx— the two cancel endpoints (see below).api-reference/check-sessions/{trigger,retrieve,await-completion}-v2.mdx— three v2 check-session pages; endpoint content renders from the OpenAPI spec.Cancel endpoint split
POST /v1/cancelwas replaced by two path-scoped endpoints —POST /v1/check-sessions/{checkSessionId}/cancelandPOST /v1/test-sessions/{testSessionId}/cancel. The session ID moves to the path; the body carries only an optionalsequenceIdarray.openapi.jsonis synced from the live endpoint, and the v2 check-session descriptions that cross-referenced/v1/cancelwere updated.--recordnow defaults to truecheckly-cli#1306 makes
checkly testandcheckly triggerrecord a test session by default (opt out with--no-record), matchingpw-test. Thetest/triggerreference pages now document--[no-]recordand note the default applies since CLI v8.0.0. Examples keep--recordexplicit so they work on pre-v8.0.0 CLIs.CLI cancellation behaviour
cli/checkly-{test,trigger,pw-test}.mdxget a "Cancelling a run" section. Behaviour was verified against the checkly-cli source (PR #1292): the firstCtrl+Ccancels the recorded session directly — there is no confirmation prompt (one was prototyped during development but never merged); the CLI keeps running to report results; a secondCtrl+Cexits immediately;--detachexits at once and leaves the checks running in the cloud. CLI cancellation ships in v8.0.0.Sidebar
cancel-a-check-sessionadded to the Check Sessions group; new Test Sessions group forcancel-a-test-session.concepts/cancellationadded under Concepts.v1 deprecation markers
The three v1 check-session MDX pages carry
deprecated: truein frontmatter, matching the convention used bycheck-groups,check-results,checks, andtriggerswhen a v2 replacement exists.Cross-links and other fixes
concepts/results.mdxandcommunicate/alerts/configuration.mdx— notes linking to / about cancellation (cancelled runs never trigger alerts, excluded from metrics).style.css— dark-mode rule so<kbd>keys (e.g.Ctrl+C) are legible.Resolved — RED-512
RED-512 fixed the empty/partial request/response schemas on the new API reference pages. Merged in checkly/monorepo#1797;
api-reference/openapi.jsonis synced from the live endpoint, so the cancel and v2 check-session endpoints render full request, response, and description content.Test plan
npm run devand visit/concepts/cancellation— copy reads cleanly, all links resolve./concepts/results,/communicate/alerts/configuration, and the threecli/*pages — new sections appear in the right place.cancel-a-check-session+ the three v2 pages; new Test Sessions group withcancel-a-test-session.<kbd>keys in the CLI cancellation sections are legible.🤖 Generated with Claude Code