mirror of https://github.com/databricks/cli.git
Move merge fix-ups after variable resolution (#2125)
## Changes Move mutator.Merge{JobClusters,JobParameters,JobTasks,PipelineClusters} after variable resolution. This helps with the case when key contains a variable. @pietern mentioned here https://github.com/databricks/cli/pull/2101#pullrequestreview-2539168762 it should be safe. ## Tests Existing acceptance that was capturing the bug is updated with corrected output.
This commit is contained in:
parent
cae21b36de
commit
1ead1b2e36
|
@ -20,7 +20,6 @@ targets:
|
|||
jobs:
|
||||
foo:
|
||||
job_clusters:
|
||||
# This does not work because merging is done before resolution
|
||||
- job_cluster_key: "${var.mykey}"
|
||||
new_cluster:
|
||||
node_type_id: i3.xlarge
|
||||
|
|
|
@ -9,17 +9,12 @@
|
|||
"edit_mode": "UI_LOCKED",
|
||||
"format": "MULTI_TASK",
|
||||
"job_clusters": [
|
||||
{
|
||||
"job_cluster_key": "key",
|
||||
"new_cluster": {
|
||||
"spark_version": "13.3.x-scala2.12"
|
||||
}
|
||||
},
|
||||
{
|
||||
"job_cluster_key": "key",
|
||||
"new_cluster": {
|
||||
"node_type_id": "i3.xlarge",
|
||||
"num_workers": 1
|
||||
"num_workers": 1,
|
||||
"spark_version": "13.3.x-scala2.12"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -51,17 +46,12 @@ Validation OK!
|
|||
"edit_mode": "UI_LOCKED",
|
||||
"format": "MULTI_TASK",
|
||||
"job_clusters": [
|
||||
{
|
||||
"job_cluster_key": "key",
|
||||
"new_cluster": {
|
||||
"spark_version": "13.3.x-scala2.12"
|
||||
}
|
||||
},
|
||||
{
|
||||
"job_cluster_key": "key",
|
||||
"new_cluster": {
|
||||
"node_type_id": "i3.2xlarge",
|
||||
"num_workers": 4
|
||||
"num_workers": 4,
|
||||
"spark_version": "13.3.x-scala2.12"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
@ -33,10 +33,6 @@ func Initialize() bundle.Mutator {
|
|||
// If it is an ancestor, this updates all paths to be relative to the sync root path.
|
||||
mutator.SyncInferRoot(),
|
||||
|
||||
mutator.MergeJobClusters(),
|
||||
mutator.MergeJobParameters(),
|
||||
mutator.MergeJobTasks(),
|
||||
mutator.MergePipelineClusters(),
|
||||
mutator.InitializeWorkspaceClient(),
|
||||
mutator.PopulateCurrentUser(),
|
||||
mutator.LoadGitDetails(),
|
||||
|
@ -70,6 +66,12 @@ func Initialize() bundle.Mutator {
|
|||
"workspace",
|
||||
"variables",
|
||||
),
|
||||
|
||||
mutator.MergeJobClusters(),
|
||||
mutator.MergeJobParameters(),
|
||||
mutator.MergeJobTasks(),
|
||||
mutator.MergePipelineClusters(),
|
||||
|
||||
// Provide permission config errors & warnings after initializing all variables
|
||||
permissions.PermissionDiagnostics(),
|
||||
mutator.SetRunAs(),
|
||||
|
|
Loading…
Reference in New Issue