terraform-provider-snowflake
terraform-provider-snowflake copied to clipboard
feat: Task resource v1 readiness
Changes
- Mostly done task resource refactor
- Sweepers test fixed (they always added errors even when they're nil)
- Minor changes in SDK (find out the bug with alter task and right now we're only supporting upper-cased warehouse names; added that to the field description)
- Acceptance tests
- The enabled field is not a three-valued boolean because it created certain issues when updating the task. The task status is very important for their management and working, so I decided to have them as regular boolean values that are either true or false, nothing in between.
Next prs
- Apply comments from https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/3086
- Data source
- Move some of the logic to SDK
- Refactor SDK suspend root logic for tasks (and overall suspend logic in SDK/resource)
- Examples, documentation, and migration guide
- More test cases for complicated DAG structures to show the resource can handle more complex structures
- Analyze non-deterministic test cases
- Refactor task resuming in task resource (most likely with the use of defer) because currently, there may be cases that error can cause tasks to be not resumed.
- Test and see how the DAG of tasks could be owned by a role other than the one created with Terraform (also with less privileges, only to run the task).
- Make config without $$ escapes needed
- Check if more helper functions from user resource could be used in task resource.
- Check in one acceptance test why finalizer task in show_output is not set (is that Snowflake or mapping error).
- More tests for calling (
as
field) - https://github.com/Snowflake-Labs/terraform-provider-snowflake/pull/3113#discussion_r1789900590 - Re-generate and list all the issues with asserts and models
- check test tasks_gen_integration_test.go:937 (and see why it's non deterministic).