checkly / terraform-provider-checkly

Terraform provider for the Checkly monitoring service
https://registry.terraform.io/namespaces/checkly
44 stars 5 forks source link

fix: improve multi-step runtime validation [sc-19433] #288

Closed clample closed 8 months ago

clample commented 8 months ago

Affected Components

Pre-Requisites

Notes for the Reviewer

Resolves https://github.com/checkly/terraform-provider-checkly/issues/287

The Checkly TF Provider currently has validation to check that multi-step checks only use supported runtimes. This validation has a null-pointer-exception, though, since the runtime_id is an optional setting. To fix the error, this PR only validates the runtime ID if one is set.

Before, the validation was only performed when creating a resource. This PR also performs the validation for updating a resource, since someone might change the runtime ID.

Currently the validation just checks that runtime ID set for the check, and ignores any that might be set on a group. Since a runtime ID set at the check level overrides any runtime ID set at the group level, this should work fine for the edge case where one runtime ID is set on the check and another is set on the group.

If no runtime ID is set on the check, then no validation is performed. To add validation in that case, we would need to add code to check the group's runtime ID and the account's default runtime ID. I think that we can skip that for now.

shortcut-integration[bot] commented 8 months ago

This pull request has been linked to Shortcut Story #19433: Checkly Terraform provider segfault error.