databricks-cli/bundle/deploy/terraform/tfdyn
shreyas-goenka 4e8e027380
Sort tasks by `task_key` before generating the Terraform configuration (#1776)
## Changes
Sort the tasks in the resultant `bundle.tf.json`. This is important
because configuration from one task can leak into another if the tasks
are not sorted.

For more details see:
1.
https://github.com/databricks/terraform-provider-databricks/issues/3951
2.
https://github.com/databricks/terraform-provider-databricks/issues/4011

## Tests
Unit test and manually.

For manual testing I used the following configuration:
```
resources:
  jobs:
    foo:
      tasks: 
        - task_key: task-Z
          notebook_task: 
            notebook_path: nb.py
            source: GIT
          existing_cluster_id: 0715-133738-ju0ma84z

        - task_key: task-1
          notebook_task: 
            notebook_path: ${workspace.file_path}/local.py
            source: WORKSPACE
          existing_cluster_id: 0715-133738-ju0ma84z
          depends_on: 
            - task_key: task-Z


      git_source: 
        git_provider: gitHub
        git_url: https://github.com/shreyas-goenka/job-source-tmp.git
        git_branch: main
```

Steps (1):
1. Deploy this bundle.
2. Comment out "source: GIT"
3. Deploy again

Before:
Deploying this bundle twice would fail. This is because the "source:
GIT" would carry over to the next deployment.

After:
There was no error on the subsequent deployment.

Steps (2):
1. Deploy once
2. Deploy again

Before:
Works correctly but leads to a update API call every time.

After:
No diff is detected by terraform.
2024-09-26 13:22:22 +00:00
..
convert.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_cluster.go Added support for creating all-purpose clusters (#1698) 2024-09-23 10:42:34 +00:00
convert_cluster_test.go Added support for creating all-purpose clusters (#1698) 2024-09-23 10:42:34 +00:00
convert_experiment.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_experiment_test.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_grants.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_grants_test.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_job.go Sort tasks by `task_key` before generating the Terraform configuration (#1776) 2024-09-26 13:22:22 +00:00
convert_job_test.go Sort tasks by `task_key` before generating the Terraform configuration (#1776) 2024-09-26 13:22:22 +00:00
convert_model.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_model_serving_endpoint.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_model_serving_endpoint_test.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_model_test.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_permissions.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_permissions_test.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_pipeline.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_pipeline_test.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_quality_monitor.go Add support for Lakehouse monitoring in bundles (#1307) 2024-05-31 09:42:25 +00:00
convert_quality_monitor_test.go Add support for Lakehouse monitoring in bundles (#1307) 2024-05-31 09:42:25 +00:00
convert_registered_model.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_registered_model_test.go Use `dyn.Value` as input to generating Terraform JSON (#1218) 2024-02-16 20:54:38 +00:00
convert_schema.go Add resource for UC schemas to DABs (#1413) 2024-07-31 12:16:28 +00:00
convert_schema_test.go Add resource for UC schemas to DABs (#1413) 2024-07-31 12:16:28 +00:00
rename_keys.go Return `dyn.InvalidValue` instead of `dyn.NilValue` when errors happen (#1514) 2024-06-21 14:22:42 +00:00