You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEXT_CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@
7
7
### CLI
8
8
9
9
### Bundles
10
+
*`bundle deployment migrate` will now run a plan before migration to check if deployment was done ([#4088](https://github.com/databricks/cli/pull/4088))
Copy file name to clipboardExpand all lines: acceptance/bundle/migrate/default-python/output.txt
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,20 @@ Deployment complete!
22
22
23
23
>>> print_state.py
24
24
25
-
>>> [CLI] bundle deployment migrate
25
+
>>> musterr [CLI] bundle deployment migrate
26
+
Building python_artifact...
27
+
Note: Migration should be done after a full deploy. Running plan now to verify that deployment was done:
28
+
Building python_artifact...
29
+
update jobs.sample_job
30
+
31
+
Plan: 0 to add, 1 to change, 0 to delete, 1 unchanged
32
+
Error: 'databricks bundle plan' shows actions planned, aborting migration. Please run 'databricks bundle deploy' first to ensure your bundle is up to date, If actions persist after deploy, skip plan check with --noplancheck option
33
+
34
+
>>> [CLI] bundle deployment migrate --noplancheck
26
35
Building python_artifact...
27
36
Migrated 2 resources to direct engine state file: [TEST_TMP_DIR]/my_default_python/.databricks/bundle/dev/resources.json
28
37
29
-
Validate the migration by running "bundle plan", there should be no actions planned.
38
+
Validate the migration by running "databricks bundle plan", there should be no actions planned.
30
39
31
40
The state file is not synchronized to the workspace yet. To do that and finalize the migration, run "bundle deploy".
returnfmt.Errorf("bundle plan failed with %s, aborting migration. To proceed with migration anyway, re-run the command with --noplancheck option", msg)
65
+
}
66
+
67
+
if!strings.Contains(output, "Plan:") {
68
+
returnfmt.Errorf("cannot parse 'databricks bundle plan%s' output, aborting migration. Skip plan check with --noplancheck option", targetArgs)
69
+
}
70
+
71
+
if!strings.Contains(output, "Plan: 0 to add, 0 to change, 0 to delete") {
72
+
returnfmt.Errorf("'databricks bundle plan%s' shows actions planned, aborting migration. Please run 'databricks bundle deploy%s' first to ensure your bundle is up to date, If actions persist after deploy, skip plan check with --noplancheck option", targetArgs, targetArgs)
73
+
}
74
+
75
+
returnnil
76
+
}
77
+
22
78
funcnewMigrateCommand() *cobra.Command {
23
79
cmd:=&cobra.Command{
24
80
Use: "migrate",
@@ -36,7 +92,20 @@ WARNING: Both direct deployment engine and this command are experimental and not
36
92
Args: root.NoArgs,
37
93
}
38
94
95
+
varnoPlanCheckbool
96
+
cmd.Flags().BoolVar(&noPlanCheck, "noplancheck", false, "Skip running bundle plan before migration.")
0 commit comments