-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Changes - Instead of doing 2 passes on variable resolution, do a loop until there are no more updates (or we reach count 100). - Stacked on top of #2163 which is a regression test for this: acceptance/bundle/variables/complex-transitive-deep ## Tests Existing tests, new regression tests. These tests already passed before, added for completeness: - acceptance/bundle/variables/cycle - acceptance/bundle/variables/complex-cross-ref
- Loading branch information
Showing
15 changed files
with
156 additions
and
12 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
acceptance/bundle/variables/complex-cross-ref/databricks.yml
This file contains 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,12 @@ | ||
bundle: | ||
name: complex-cross-ref | ||
|
||
variables: | ||
a: | ||
default: | ||
a_1: 500 | ||
a_2: ${var.b.b_2} | ||
b: | ||
default: | ||
b_1: ${var.a.a_1} | ||
b_2: 2.5 |
This file contains 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,22 @@ | ||
{ | ||
"a": { | ||
"default": { | ||
"a_1": 500, | ||
"a_2": 2.5 | ||
}, | ||
"value": { | ||
"a_1": 500, | ||
"a_2": 2.5 | ||
} | ||
}, | ||
"b": { | ||
"default": { | ||
"b_1": 500, | ||
"b_2": 2.5 | ||
}, | ||
"value": { | ||
"b_1": 500, | ||
"b_2": 2.5 | ||
} | ||
} | ||
} |
This file contains 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 @@ | ||
$CLI bundle validate -o json | jq .variables |
7 changes: 7 additions & 0 deletions
7
acceptance/bundle/variables/complex-cycle-self/databricks.yml
This file contains 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,7 @@ | ||
bundle: | ||
name: cycle | ||
|
||
variables: | ||
a: | ||
default: | ||
hello: ${var.a} |
This file contains 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,9 @@ | ||
Warning: Detected unresolved variables after 11 resolution rounds | ||
|
||
Name: cycle | ||
Target: default | ||
Workspace: | ||
User: $USERNAME | ||
Path: /Workspace/Users/$USERNAME/.bundle/cycle/default | ||
|
||
Found 1 warning |
This file contains 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 @@ | ||
$CLI bundle validate |
This file contains 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,10 @@ | ||
bundle: | ||
name: cycle | ||
|
||
variables: | ||
a: | ||
default: | ||
hello: ${var.b} | ||
b: | ||
default: | ||
hello: ${var.a} |
This file contains 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,9 @@ | ||
Warning: Detected unresolved variables after 11 resolution rounds | ||
|
||
Name: cycle | ||
Target: default | ||
Workspace: | ||
User: $USERNAME | ||
Path: /Workspace/Users/$USERNAME/.bundle/cycle/default | ||
|
||
Found 1 warning |
This file contains 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 @@ | ||
$CLI bundle validate |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"spark.databricks.sql.initial.catalog.name": "${var.catalog}" | ||
"spark.databricks.sql.initial.catalog.name": "hive_metastore" | ||
} |
This file contains 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,8 @@ | ||
bundle: | ||
name: cycle | ||
|
||
variables: | ||
a: | ||
default: ${var.b} | ||
b: | ||
default: ${var.a} |
This file contains 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,14 @@ | ||
Error: cycle detected in field resolution: variables.a.default -> var.b -> var.a -> var.b | ||
|
||
{ | ||
"a": { | ||
"default": "${var.b}", | ||
"value": "${var.b}" | ||
}, | ||
"b": { | ||
"default": "${var.a}", | ||
"value": "${var.a}" | ||
} | ||
} | ||
|
||
Exit code: 1 |
This file contains 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 @@ | ||
$CLI bundle validate -o json | jq .variables |
This file contains 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 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