Skip to content

feat: validate that monitors are configured for single retry only [sc-24878] #1106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sorccu
Copy link
Member

@sorccu sorccu commented Jul 11, 2025

This PR adds validation to make sure that monitors only use retry strategies they support.

A similar change is implemented for CheckGroups and Checks. Without delving too deep into the types, the following snippet should give you the general idea:

export type MonitorRetryStrategy =
  | SingleRetryStrategy
  | NoRetriesRetryStrategy

export type CheckRetryStrategy =
  | LinearRetryStrategy
  | ExponentialRetryStrategy
  | FixedRetryStrategy
  | SingleRetryStrategy
  | NoRetriesRetryStrategy

export type GroupRetryStrategy =
  | CheckRetryStrategy
  | MonitorRetryStrategy

The RetryStrategyBuilder has been updated to return compatible structs.

All of these changes are backwards compatible with the following exceptions:

  1. Using extra properties on a retry strategy (think maxRetries when type: 'NO_RETRIES') will now result in a compilation error. Therefore, if a user had used an invalid combination before, that will now fail (depending on the TypeScript loader type - jiti will not error).
  2. The recently released monitors will no longer support most retry strategies.
    • This also means that if an incompatible default retryStrategy has been specified in the Checkly config file, the user will now get a validation error on deploy/test/etc.

Affected Components

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

Resolves #[issue-number]

New Dependency Submission

@sorccu sorccu force-pushed the simokinnunen/sc-24878/cli-apply-retry-strategy-limits-for-monitors branch from bc7eab9 to e03ea69 Compare July 11, 2025 20:21
@sorccu sorccu force-pushed the simokinnunen/sc-24878/cli-apply-retry-strategy-limits-for-monitors branch from f7a2616 to a231ec9 Compare July 13, 2025 22:52
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.

1 participant