Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 214
Add defaults on jobs that terraform applies#2767
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export PYTHONDONTWRITEBYTECODE=1 | ||
| uv venv -q .venv | ||
| venv_activate | ||
| uv pip install -q setuptools |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,6 +2,7 @@ Local = false | ||
| CloudSlow = true | ||
| Ignore = [ | ||
| ".databricks", | ||
| ".venv", | ||
| "build", | ||
| "dist", | ||
| "my_test_code", | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -24,6 +24,8 @@ | ||
| } | ||
| } | ||
| ], | ||
| "max_concurrent_runs": 1, | ||
| "name": "Untitled", | ||
| "permissions": [], | ||
| "queue": { | ||
| "enabled": true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -22,6 +22,8 @@ | ||
| } | ||
| } | ||
| ], | ||
| "max_concurrent_runs": 1, | ||
| "name": "Untitled", | ||
| "permissions": [], | ||
| "queue": { | ||
| "enabled": true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -58,6 +58,8 @@ | ||
| } | ||
| } | ||
| ], | ||
| "max_concurrent_runs": 1, | ||
| "name": "Untitled", | ||
| "permissions": [], | ||
| "queue": { | ||
| "enabled": true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -51,6 +51,26 @@ func applyInitializeMutators(ctx context.Context, b *bundle.Bundle) diag.Diagnos | ||
| {"resources.dashboards.*.parent_path", b.Config.Workspace.ResourcePath}, | ||
| {"resources.dashboards.*.embed_credentials", false}, | ||
| {"resources.volumes.*.volume_type", "MANAGED"}, | ||
| // Jobs: | ||
| // The defaults are the same as for terraform provider latest version (v1.75.0) | ||
| // https://github.com/databricks/terraform-provider-databricks/blob/v1.75.0/jobs/resource_job.go#L532 | ||
| {"resources.jobs.*.name", "Untitled"}, | ||
| {"resources.jobs.*.max_concurrent_runs", 1}, | ||
| {"resources.jobs.*.schedule.pause_status", "UNPAUSED"}, | ||
| {"resources.jobs.*.trigger.pause_status", "UNPAUSED"}, | ||
| {"resources.jobs.*.continuous.pause_status", "UNPAUSED"}, | ||
| // This is converted from single-task to multi-task | ||
| {"resources.jobs.*.task[*].dbt_task.schema", "default"}, | ||
| {"resources.jobs.*.task[*].for_each_task.task.dbt_task.schema", "default"}, | ||
| // https://github.com/databricks/terraform-provider-databricks/blob/v1.75.0/clusters/resource_cluster.go | ||
| // This triggers SingleNodeCluster() cluster validator. It needs to be run before applying defaults. | ||
| //{"resources.jobs.*.job_clusters[*].new_cluster.num_workers", 0}, | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious to know why this is a TF default to begin with. Can you check in with the TF team to figure this out? | ||
| {"resources.jobs.*.job_clusters[*].new_cluster.workload_type.clients.notebooks", true}, | ||
| {"resources.jobs.*.job_clusters[*].new_cluster.workload_type.clients.jobs", true}, | ||
| } | ||
| for _, defaultDef := range defaults { | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this is the diff between dev and prod, indicating that the default was not sent for prod.
Can you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed a diff between dev and prod output for "validate -o json" and the pause_status=UNPAUSED is now sent for prod but it was not before:
(NEW) pause_status: UNPAUSED is present in prod configuration. It comes from defaults added in this PR. It matches what terraform would add anyway. (We'll be able to verify that better once RecordRequests for integration tests by @shreyas-goenka is landed Add support for recording requests in integration acceptance tests #2720)
(UNCHANGED) pause_status: PAUSED is present in dev configuration. It comes from ApplyTargetMode.