PrefectHQ / terraform-provider-prefect

Terraform Provider for Prefect Cloud
https://registry.terraform.io/providers/PrefectHQ/prefect/latest/docs
Apache License 2.0
33 stars 17 forks source link

Replace usage of deprecated `xattr.TypeWithValidate` interface #231

Closed mitchnielsen closed 4 months ago

mitchnielsen commented 4 months ago

Summary

In https://github.com/hashicorp/terraform-plugin-framework/releases/tag/v1.8.0, there's a note about a deprecated interface:

attr/xattr: The TypeWithValidate interface has been deprecated in preference of the ValidateableAttribute interface. A ValidatableParameter interface has also been added to the function package (https://github.com/hashicorp/terraform-plugin-framework/issues/968)

We use this in two places:

  1. https://github.com/PrefectHQ/terraform-provider-prefect/blob/37502a647233631ef85c34f811367f255349dbc5/internal/provider/customtypes/timestamp_type.go#L18
  2. https://github.com/PrefectHQ/terraform-provider-prefect/blob/37502a647233631ef85c34f811367f255349dbc5/internal/provider/customtypes/uuid_type.go#L18

In https://developer.hashicorp.com/terraform/plugin/framework/validation#defining-value-validation, it discusses this:

Value validation should be used in preference to Type validation. Refer to Value Validation for more information.

It might make sense to simply remove the type validation and keep the value validation we already have, but will need to confirm.

Acceptance criteria