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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ bundle:

include:
- targets/*.yml
- resources/*.yml

variables:
mode:
Expand Down
96 changes: 94 additions & 2 deletions acceptance/bundle/summary/show-full-config/output.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,107 @@

>>> [CLI] bundle summary --show-full-config
>>> [CLI] bundle summary --show-full-config --include-locations
{
"__locations": {
"files": [
"databricks.yml",
"resources/my_dashboard.dashboard.yml",
"targets/default.yml",
"targets/not_default.yml",
"targets/variable_default.yml",
"targets/variable_mode.yml"
],
"locations": {
"bundle": [
[
0,
2,
3
]
],
"include": [
[
0,
5,
3
]
],
"resources": [
[
1,
2,
3
]
],
"resources.dashboards": [
[
1,
3,
5
]
],
"resources.dashboards.my_dashboard": [
[
1,
4,
7
]
],
"targets": [
[
0,
15,
3
],
[
2,
2,
3
],
[
3,
2,
3
],
[
4,
2,
3
],
[
5,
2,
3
]
],
"variables": [
[
0,
9,
3
]
]
},
"version": 1
},
"bundle": {
"name": "test-bundle"
},
"include": [
"targets/default.yml",
"targets/not_default.yml",
"targets/variable_default.yml",
"targets/variable_mode.yml"
"targets/variable_mode.yml",
"resources/my_dashboard.dashboard.yml"
],
"resources": {
"dashboards": {
"my_dashboard": {
"display_name": "My Dashboard",
"file_path": "../src/my_dashboard.lvdash.json",
"warehouse_id": "[NUMID]abcdef"
}
}
},
"targets": {
"also_default": {
"default": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resources:
dashboards:
my_dashboard:
display_name: My Dashboard
file_path: ../src/my_dashboard.lvdash.json
warehouse_id: 1234567890abcdef
2 changes: 1 addition & 1 deletion acceptance/bundle/summary/show-full-config/script
Original file line number Diff line number Diff line change
@@ -1 +1 @@
trace $CLI bundle summary --show-full-config
trace $CLI bundle summary --show-full-config --include-locations
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
12 changes: 10 additions & 2 deletions cmd/bundle/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Useful after deployment to see what was created and where to find it.`,
cmd.SetContext(ctx)
logdiag.SetSeverity(ctx, diag.Warning)

err = showFullConfig(ctx, cmd)
err = showFullConfig(ctx, cmd, includeLocations)
if err != nil {
return err
}
Expand Down Expand Up @@ -68,7 +68,7 @@ Useful after deployment to see what was created and where to find it.`,
return cmd
}

func showFullConfig(ctx context.Context, cmd *cobra.Command) error {
func showFullConfig(ctx context.Context, cmd *cobra.Command, includeLocations bool) error {
// call `MustLoad` directly instead of `MustConfigureBundle` because the latter does
// validation that we're not interested in here
b := bundle.MustLoad(ctx)
Expand All @@ -81,6 +81,14 @@ func showFullConfig(ctx context.Context, cmd *cobra.Command) error {
return nil
}

if includeLocations {
// Include location information in the output
bundle.ApplyContext(ctx, b, mutator.PopulateLocations())
if logdiag.HasError(ctx) {
return nil
}
}

err := renderJsonOutput(cmd, b)
if err != nil {
return err
Expand Down