fix: allow disabling smart retries [gh-943] #944
Merged
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.
I hereby confirm that I followed the code guidelines found at engineering guidelines
Affected Components
Notes for the Reviewer
Resolves #943
Currently it's not straightforward to disable smart retries. Setting
retryStrategy: null
for a check gives a type error when using TypeScript (type 'null' is not assignable to type 'RetryStrategy | undefined'
). When using JS, the backend Joi default ofdoubleCheck: true
shows in the UI as a linear retry strategy. Currently to disable all retries you need to set bothretryStrategy: null
anddoubleCheck: false
.This PR makes it simpler to disable smart retries. To disable smart retries, the user can just set
retryStrategy: null
on a check or a group - there's no need to also setdoubleCheck: false
. When a user setsretryStrategy: null
and doesn't setdoubleCheck
, the CLI will setdoubleCheck: false
to avoid the Joi default.This approach of fixing the issue on the CLI side should minimize the breaking changes for users. The only breaking change is that any users that had
retryStrategy: null
and that weren't setting explicitly settingdoubleCheck
will have their retries disabled when upgrading to the new CLI version (since thedoubleCheck: true
default is removed). This shouldn't really have an impact, though.The PR also adds a
RetryStrategyBuilder.noRetries()
method to make it more clear/explicit how to disable retries.