Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bundle generate variant for dashboards #1847

Merged
merged 50 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3461c66
Add DABs support for AI/BI dashboards
pietern Sep 3, 2024
cc3bcf9
dashboard example
pietern Sep 4, 2024
b7a952d
wip
pietern Sep 6, 2024
7403101
Merge remote-tracking branch 'origin/main' into dashboards
pietern Sep 9, 2024
6dadf66
Merge remote-tracking branch 'origin/main' into dashboards
pietern Sep 12, 2024
7a9355c
Merge remote-tracking branch 'origin/main' into dashboards
pietern Sep 27, 2024
ff15a04
Merge remote-tracking branch 'origin/main' into dashboards
pietern Sep 27, 2024
3a1d92c
Comments
pietern Sep 27, 2024
802be90
Coverage for conversion logic
pietern Sep 30, 2024
08f7f3b
Add resource path field to bundle workspace configuration
pietern Sep 30, 2024
c123cca
Merge branch 'workspace-resource-path' into dashboards
pietern Oct 1, 2024
0f22ec6
Remove generate changes from this branch
pietern Oct 1, 2024
0e0f421
Remove examples
pietern Oct 1, 2024
c911f79
Move test
pietern Oct 1, 2024
a2a794e
Configure the default parent path for dashboards
pietern Oct 1, 2024
8186da8
Simplify
pietern Oct 1, 2024
0301854
Comment
pietern Oct 1, 2024
b63e943
Rename mutator
pietern Oct 1, 2024
b54c10b
Remove embed_credentials default from tfdyn
pietern Oct 1, 2024
37b0039
Never swallow errors
pietern Oct 1, 2024
43f9155
Merge remote-tracking branch 'origin/main' into dashboards
pietern Oct 18, 2024
5fb35e3
Add dashboards to summary output
pietern Oct 18, 2024
1b51c0c
Update run_as tests for dashboards
pietern Oct 18, 2024
379d263
Undo changes to convert_test.go
pietern Oct 18, 2024
3201821
Don't double-index
pietern Oct 18, 2024
e13fae7
Update comment
pietern Oct 18, 2024
25a151c
Include dashboards in Terraform conversion logic
pietern Oct 18, 2024
ba182c4
Remove assumptions tests from core PR
pietern Oct 18, 2024
c1e4360
Add test coverage for dashboard prefix
pietern Oct 21, 2024
96c6f52
Check for remote modification of dashboards
pietern Oct 21, 2024
0f48c98
Work on bundle generate command
pietern Oct 21, 2024
e19f9b7
Work on generate command
pietern Oct 22, 2024
6057c13
Specialize error when the path points to a legacy dashboard
pietern Oct 22, 2024
5b6a7b2
Interpolate references to the dashboard resource correctly
pietern Oct 22, 2024
ef6b2ea
Generate file as key.dashboard.yml
pietern Oct 22, 2024
b8e9a29
Merge remote-tracking branch 'origin/main' into dashboards
pietern Oct 24, 2024
866bfc5
Include JSON schema for dashboards
pietern Oct 24, 2024
93155f1
Inline SDK struct
pietern Oct 24, 2024
c4df41c
Rename remote modification check
pietern Oct 24, 2024
a3e32c0
Marshal contents of 'serialized_dashboard' if not a string
pietern Oct 24, 2024
72078bb
Add integration test
pietern Oct 25, 2024
3be89df
Merge remote-tracking branch 'origin/main' into dashboards
pietern Oct 25, 2024
21dabe8
Quote path when passing to TF
pietern Oct 25, 2024
2348e85
Update schema
pietern Oct 25, 2024
9397c03
Merge branch 'dashboards' into dashboards-generate
pietern Oct 25, 2024
bfa9c3a
Completion for the resource flag
pietern Oct 28, 2024
1f26c68
Comments
pietern Oct 29, 2024
901f0fe
Merge branch 'main' into dashboards-generate
pietern Oct 29, 2024
d1cc35f
Test coverage
pietern Oct 29, 2024
7cb624d
Merge remote-tracking branch 'origin/dashboards-generate' into dashbo…
pietern Oct 29, 2024
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
18 changes: 18 additions & 0 deletions bundle/config/generate/dashboard.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package generate

import (
"github.com/databricks/cli/libs/dyn"
"github.com/databricks/databricks-sdk-go/service/dashboards"
)

func ConvertDashboardToValue(dashboard *dashboards.Dashboard, filePath string) (dyn.Value, error) {
// The majority of fields of the dashboard struct are read-only.
// We copy the relevant fields manually.
dv := map[string]dyn.Value{
"display_name": dyn.NewValue(dashboard.DisplayName, []dyn.Location{{Line: 1}}),
"warehouse_id": dyn.NewValue(dashboard.WarehouseId, []dyn.Location{{Line: 2}}),
"file_path": dyn.NewValue(filePath, []dyn.Location{{Line: 3}}),
}

return dyn.V(dv), nil
}
1 change: 1 addition & 0 deletions cmd/bundle/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func newGenerateCommand() *cobra.Command {

cmd.AddCommand(generate.NewGenerateJobCommand())
cmd.AddCommand(generate.NewGeneratePipelineCommand())
cmd.AddCommand(generate.NewGenerateDashboardCommand())
cmd.PersistentFlags().StringVar(&key, "key", "", `resource key to use for the generated configuration`)
return cmd
}
Loading
Loading