Skip to content
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

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

Merged

Conversation

clample
Copy link
Contributor

@clample clample commented Feb 26, 2024

Affected Components

  • Resources
  • Test
  • Docs
  • Tooling
  • Other

Pre-Requisites

  • Terraform code is formatted with terraform fmt
  • Go code is formatted with go fmt
  • plan & apply command of demo/main.tf file do not produce diffs

Notes for the Reviewer

Resolves #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.

Copy link

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

@clample clample marked this pull request as draft February 26, 2024 14:34
@clample clample force-pushed the chrislample/sc-19433/update-multi-step-runtime-validation branch from 6aa47d4 to ac0d656 Compare February 26, 2024 15:02
Antoine-C
Antoine-C previously approved these changes Feb 26, 2024
@clample clample force-pushed the chrislample/sc-19433/update-multi-step-runtime-validation branch from ac0d656 to 8211875 Compare February 26, 2024 16:23
@clample clample marked this pull request as ready for review February 26, 2024 16:25
@clample clample merged commit aec6a22 into main Feb 27, 2024
6 checks passed
@clample clample deleted the chrislample/sc-19433/update-multi-step-runtime-validation branch February 27, 2024 15:37
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.

bug: Terraform Apply failing on creating checkly check
2 participants