Skip to content

feat(cli): expose description property in Check construct API#1272

Merged
pmallol merged 7 commits intomainfrom
paula/add-check-description-prop
Apr 3, 2026
Merged

feat(cli): expose description property in Check construct API#1272
pmallol merged 7 commits intomainfrom
paula/add-check-description-prop

Conversation

@pmallol
Copy link
Copy Markdown
Contributor

@pmallol pmallol commented Apr 2, 2026

Affected Components

  • CLI

Notes for the Reviewer

Adds the description property to the CheckProps interface, Check class, and CheckResource codegen interface so users can set a check description via the Checkly CLI construct API. Also surfaces the description in checks get and checks list CLI output.

Changes:

Construct API:

  • check.ts: Added description?: string | null to CheckProps interface with JSDoc, class field, constructor assignment, and synthesize() output
  • check-codegen.ts: Added description to CheckResource interface and buildCheckProps code generation

CLI output:

  • rest/checks.ts: Added description to the Check interface
  • formatters/checks.ts: Added Description field to checks get detail view (hidden when null in terminal, shows - in markdown). Added Description column to checks list markdown table
  • Tests: Added description rendering tests, updated fixtures and snapshots

Screenshots

checks get [id]
CleanShot 2026-04-03 at 13 01 49@2x
CleanShot 2026-04-03 at 15 14 46@2x
CleanShot 2026-04-03 at 16 37 14@2x

checks list
CleanShot 2026-04-03 at 13 11 02@2x

checks list --output md
CleanShot 2026-04-03 at 13 05 27@2x

CleanShot 2026-04-03 at 13 07 37@2x

thebiglabasky
thebiglabasky previously approved these changes Apr 2, 2026
Copy link
Copy Markdown
Contributor

@thebiglabasky thebiglabasky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

pmallol added 2 commits April 3, 2026 13:11
Pad continuation lines in renderDetailFields so multi-line values
align with the first line. Only include description in synthesize
payload when explicitly set, preventing API rejection.
@pmallol pmallol requested a review from thebiglabasky April 3, 2026 14:23
thebiglabasky
thebiglabasky previously approved these changes Apr 3, 2026
Copy link
Copy Markdown
Contributor

@thebiglabasky thebiglabasky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good though couldn't test since on the go, but that looks harmless 👍

Escape pipe characters and newlines in markdown table cells to prevent
broken output. Use nullish checks instead of falsy checks so empty-string
descriptions are preserved rather than collapsed to hidden/dash.
@pmallol pmallol merged commit ba1f06d into main Apr 3, 2026
6 of 7 checks passed
@pmallol pmallol deleted the paula/add-check-description-prop branch April 3, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants