Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions acceptance/bundle/includes/yml_outside_root/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Validation OK!
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "include_outside_root",
"permissions": [],
"queue": {
Expand Down
5 changes: 5 additions & 0 deletions acceptance/bundle/integration_whl/script.prepare
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
1 change: 1 addition & 0 deletions acceptance/bundle/integration_whl/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Local = false
CloudSlow = true
Ignore = [
".databricks",
".venv",
"build",
"dist",
"my_test_code",
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/override/job_cluster/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}
}
],
"max_concurrent_runs": 1,
"name": "job",
"permissions": [],
"queue": {
Expand Down Expand Up @@ -45,6 +46,7 @@
}
}
],
"max_concurrent_runs": 1,
"name": "job",
"permissions": [],
"queue": {
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/override/job_cluster_var/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}
}
],
"max_concurrent_runs": 1,
"name": "job",
"permissions": [],
"queue": {
Expand Down Expand Up @@ -54,6 +55,7 @@ Validation OK!
}
}
],
"max_concurrent_runs": 1,
"name": "job",
"permissions": [],
"queue": {
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/override/job_tasks/output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"max_concurrent_runs": 1,
"name": "job",
"permissions": [],
"queue": {
Expand Down Expand Up @@ -34,6 +35,7 @@ Error: file test1.py not found

Exit code: 1
{
"max_concurrent_runs": 1,
"name": "job",
"permissions": [],
"queue": {
Expand Down
1 change: 1 addition & 0 deletions acceptance/bundle/paths/git_source_jobs/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"git_provider": "gitHub",
"git_url": "https://github.com/foo"
},
"max_concurrent_runs": 1,
"name": "my_job",
"permissions": [],
"queue": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "include_outside_root",
"permissions": [],
"queue": {
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/python/mutator-ordering/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
1 change: 1 addition & 0 deletions acceptance/bundle/python/resolve-variable/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "abc",
"permissions": [],
"queue": {
Expand Down
3 changes: 3 additions & 0 deletions acceptance/bundle/python/resource-loading/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Job 1",
"permissions": [],
"queue": {
Expand All @@ -31,6 +32,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Job 2",
"permissions": [],
"queue": {
Expand All @@ -44,6 +46,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Job 3",
"permissions": [],
"queue": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ Validation OK!
+ "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/prod/state/metadata.json"
},
"edit_mode": "UI_LOCKED",
@@ -59,12 +51,8 @@
@@ -59,12 +51,9 @@
}
],
- "max_concurrent_runs": 4,
- "name": "[dev [USERNAME]] project_name_[UNIQUE_NAME]_job",
+ "max_concurrent_runs": 1,
+ "name": "project_name_[UNIQUE_NAME]_job",
"permissions": [],
"queue": {
Expand All @@ -182,20 +183,21 @@ Validation OK!
- "dev": "[USERNAME]"
},
"tasks": [
@@ -72,5 +60,5 @@
@@ -72,5 +61,5 @@
"job_cluster_key": "job_cluster",
"notebook_task": {
- "notebook_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/files/src/notebook"
+ "notebook_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/prod/files/src/notebook"
},
"task_key": "notebook_task"
@@ -107,5 +95,4 @@
@@ -107,5 +96,5 @@
],
"trigger": {
- "pause_status": "PAUSED",
+ "pause_status": "UNPAUSED",
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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:

"periodic": {
"interval": 1,
@@ -118,21 +105,20 @@
@@ -118,21 +107,20 @@
"project_name_[UNIQUE_NAME]_pipeline": {
"configuration": {
- "bundle.sourcePath": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/files/src"
Expand All @@ -222,7 +224,7 @@ Validation OK!
+ "schema": "project_name_[UNIQUE_NAME]_prod"
}
}
@@ -145,10 +131,10 @@
@@ -145,10 +133,10 @@
"targets": null,
"workspace": {
- "artifact_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/artifacts",
Expand Down Expand Up @@ -317,11 +319,12 @@ Resources:
+ "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/prod/state/metadata.json"
},
"edit_mode": "UI_LOCKED",
@@ -60,11 +56,7 @@
@@ -60,11 +56,8 @@
}
],
- "max_concurrent_runs": 4,
- "name": "[dev [USERNAME]] project_name_[UNIQUE_NAME]_job",
+ "max_concurrent_runs": 1,
+ "name": "project_name_[UNIQUE_NAME]_job",
"queue": {
"enabled": true
Expand All @@ -330,20 +333,21 @@ Resources:
- "dev": "[USERNAME]"
},
"tasks": [
@@ -72,5 +64,5 @@
@@ -72,5 +65,5 @@
"job_cluster_key": "job_cluster",
"notebook_task": {
- "notebook_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/files/src/notebook"
+ "notebook_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/prod/files/src/notebook"
},
"task_key": "notebook_task"
@@ -107,5 +99,4 @@
@@ -107,5 +100,5 @@
],
"trigger": {
- "pause_status": "PAUSED",
+ "pause_status": "UNPAUSED",
"periodic": {
"interval": 1,
@@ -119,21 +110,20 @@
@@ -119,21 +112,20 @@
"project_name_[UNIQUE_NAME]_pipeline": {
"configuration": {
- "bundle.sourcePath": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/files/src"
Expand All @@ -370,7 +374,7 @@ Resources:
+ "schema": "project_name_[UNIQUE_NAME]_prod",
"url": "[DATABRICKS_URL]/pipelines/[UUID]"
}
@@ -146,10 +136,10 @@
@@ -146,10 +138,10 @@
},
"workspace": {
- "artifact_path": "/Workspace/Users/[USERNAME]/.bundle/project_name_[UNIQUE_NAME]/dev/artifacts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Warning: unknown field: grants
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
3 changes: 3 additions & 0 deletions acceptance/bundle/validate/presets_name_prefix/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "prefix-job1",
"permissions": [],
"queue": {
Expand Down Expand Up @@ -47,6 +48,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "[prefix]job1",
"permissions": [],
"queue": {
Expand Down Expand Up @@ -82,6 +84,7 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "job1",
"permissions": [],
"queue": {
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/variables/complex/out.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
}
}
],
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/variables/complex/out.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
}
}
],
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
}
}
],
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Untitled",
"permissions": [],
"queue": {
"enabled": true
Expand Down
2 changes: 2 additions & 0 deletions acceptance/bundle/variables/resolve-nonstrings/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
},
"edit_mode": "UI_LOCKED",
"format": "MULTI_TASK",
"max_concurrent_runs": 1,
"name": "Untitled",
"notification_settings": {
"no_alert_for_canceled_runs": true,
"no_alert_for_skipped_runs": false
Expand Down
20 changes: 20 additions & 0 deletions bundle/config/mutator/resourcemutator/resource_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 {
Expand Down
Loading