-
Notifications
You must be signed in to change notification settings - Fork 153
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,8 @@ | |
| } | ||
| } | ||
| ], | ||
| "max_concurrent_runs": 1, | ||
| "name": "Untitled", | ||
| "permissions": [], | ||
| "queue": { | ||
| "enabled": true | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,8 @@ | |
| } | ||
| } | ||
| ], | ||
| "max_concurrent_runs": 1, | ||
| "name": "Untitled", | ||
| "permissions": [], | ||
| "queue": { | ||
| "enabled": true | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,8 @@ | |
| } | ||
| } | ||
| ], | ||
| "max_concurrent_runs": 1, | ||
| "name": "Untitled", | ||
| "permissions": [], | ||
| "queue": { | ||
| "enabled": true | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.