Skip to content

Commit 30849a3

Browse files
authored
Add hidden "bundle debug refschema" command (#3555)
## Changes - New hidden command "bundle ref-schema". - Acceptance test that records full output of it. Requires #3531 ## Why Track bundle schema changes. Unlike jsonschema, this includes not just input yaml but stored state and remote resource types. This will help us notice when something disappears or changes type in the state or remote, as this has potential of breaking existing deployments. It is also in greppable format, could be useful for debugging complex $resources.jobs.foo.tasks[0].something.something else references. ## Tests I also added recording of "bundle debug" output under acceptance/bundle/debug.
1 parent a0b55e7 commit 30849a3

File tree

17 files changed

+2717
-8
lines changed

17 files changed

+2717
-8
lines changed

acceptance/acceptance_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const (
8484
EntryPointScript = "script"
8585
CleanupScript = "script.cleanup"
8686
PrepareScript = "script.prepare"
87-
MaxFileSize = 100_000
87+
MaxFileSize = 1_000_000
8888
// Filename to save replacements to (used by diff.py)
8989
ReplsFile = "repls.json"
9090
// Filename for materialized config (used as golden file)

acceptance/bundle/debug/output.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
Name: test-bundle
2-
Target: default
3-
Workspace:
4-
User: [USERNAME]
5-
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
1+
Debug information about bundles
62

7-
Validation OK!
3+
Usage:
4+
databricks bundle debug [command]
5+
6+
Available Commands:
7+
refschema Dump all relevant fields all bundle resources
8+
9+
Flags:
10+
-h, --help help for debug
11+
12+
Global Flags:
13+
--debug enable debug logging
14+
-o, --output type output type: text or json (default text)
15+
-p, --profile string ~/.databrickscfg profile
16+
-t, --target string bundle target to use (if applicable)
17+
--var strings set values for variables defined in bundle config. Example: --var="foo=bar"
18+
19+
Use "databricks bundle debug [command] --help" for more information about a command.

acceptance/bundle/debug/script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
$CLI bundle validate --debug 2> out.stderr.$DATABRICKS_CLI_DEPLOYMENT.txt
1+
$CLI bundle debug
File renamed without changes.
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Local = true
2+
Cloud = false
3+
4+
[EnvMatrix]
5+
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Name: test-bundle
2+
Target: default
3+
Workspace:
4+
User: [USERNAME]
5+
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
6+
7+
Validation OK!

acceptance/bundle/debuglog/script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$CLI bundle validate --debug 2> out.stderr.$DATABRICKS_CLI_DEPLOYMENT.txt

0 commit comments

Comments
 (0)