Skip to content

Commit d27fd75

Browse files
Support shadow deployment history in bundle generate (#7204)
Remove the dependence on DMS for bundle generate. The command should purely rely on resources.json to generate configuration.
1 parent 1d80643 commit d27fd75

9 files changed

Lines changed: 27 additions & 9 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Cloud = true
2-
EnvMatrix.DMS = [""]
2+
EnvMatrix.DMS = ["", "true"]

‎acceptance/bundle/generate/auto-bind/test.toml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ Ignore = [
1111
# C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI
1212
# Setting this environment variable prevents that conversion on windows.
1313
Env.MSYS_NO_PATHCONV = "1"
14-
15-
# bind is unsupported with deployment-history recording; pin DMS off so it runs on the plain cell.
16-
EnvMatrix.DMS = [""]

‎acceptance/bundle/generate/dashboard-inplace/output.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
2424
"warehouse_id": ""
2525
}
2626

27+
>>> fault.py GET /api/2.0/bundle/deployments/* 403 0 1 PERMISSION_DENIED
28+
2729
=== update the dashboard file using bundle generate
2830
>>> [CLI] bundle generate dashboard --resource test_dashboard --force
2931
Writing dashboard to dash.lvdash.json
@@ -32,3 +34,5 @@ Writing dashboard to dash.lvdash.json
3234
{
3335
"a": "b"
3436
}
37+
38+
>>> print_requests.py --dms //api/2.0/bundle --get --oneline

‎acceptance/bundle/generate/dashboard-inplace/script‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ dashboard_id=$($CLI bundle summary --output json | jq -r '.resources.dashboards.
77
title "update the dashboard"
88
trace $CLI lakeview update $dashboard_id --serialized-dashboard '{"a":"b"}'
99

10+
# Generating from file-backed state must not depend on the history service.
11+
rm -f "$OUT_REQUESTS"
12+
trace fault.py "GET /api/2.0/bundle/deployments/*" 403 0 1 PERMISSION_DENIED
13+
1014
title "update the dashboard file using bundle generate"
1115
trace $CLI bundle generate dashboard --resource test_dashboard --force
1216

1317
trace cat dash.lvdash.json
18+
19+
trace print_requests.py --dms //api/2.0/bundle --get --oneline

‎acceptance/bundle/generate/dashboard-inplace/test.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
RecordRequests = true
2+
Ignore = [".databricks"]
3+
14
[[Repls]]
25
Old = "[0-9a-f]{32}"
36
New = "[DASHBOARD_ID]"

‎acceptance/bundle/generate/genie_space_inplace/output.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
2020
"warehouse_id": "my-warehouse-1234"
2121
}
2222

23+
>>> fault.py GET /api/2.0/bundle/deployments/* 403 0 1 PERMISSION_DENIED
24+
2325
=== update the genie space file using bundle generate
2426
>>> [CLI] bundle generate genie-space --resource test_genie_space --force
2527
Writing genie space to space.geniespace.json
@@ -28,3 +30,5 @@ Writing genie space to space.geniespace.json
2830
{
2931
"a": "b"
3032
}
33+
34+
>>> print_requests.py --dms //api/2.0/bundle --get --oneline

‎acceptance/bundle/generate/genie_space_inplace/script‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ genie_space_id=$($CLI bundle summary --output json | jq -r '.resources.genie_spa
77
title "update the genie space"
88
trace $CLI genie update-space $genie_space_id --serialized-space '{"a":"b"}'
99

10+
# Generating from file-backed state must not depend on the history service.
11+
rm -f "$OUT_REQUESTS"
12+
trace fault.py "GET /api/2.0/bundle/deployments/*" 403 0 1 PERMISSION_DENIED
13+
1014
title "update the genie space file using bundle generate"
1115
trace $CLI bundle generate genie-space --resource test_genie_space --force
1216

1317
trace cat space.geniespace.json
18+
19+
trace print_requests.py --dms //api/2.0/bundle --get --oneline

‎acceptance/bundle/generate/genie_space_inplace/test.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
RecordRequests = true
2+
Ignore = [".databricks"]
3+
14
# Genie spaces are only deployed via the direct deployment engine.
25

36
[[Repls]]

‎cmd/bundle/utils/process.go‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -693,11 +693,6 @@ func OpenDirectStateForRead(ctx context.Context, b *bundle.Bundle, stateDesc *st
693693
if err := b.DeploymentBundle.StateDB.Open(ctx, localPath, dstate.ReadingFile, dstate.WithRecovery(true), dstate.OpenDmsArgs{}); err != nil {
694694
return err
695695
}
696-
if configuresDeploymentHistory(ctx, b) {
697-
if _, err := prepareDeploymentHistoryShadow(ctx, b); err != nil {
698-
log.Warnf(ctx, "Could not read deployment history: %s", err)
699-
}
700-
}
701696
return nil
702697
}
703698

0 commit comments

Comments
 (0)