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
{{ message }}
Repository navigation
Commit 7fb73fa
Browse filesBrowse the repository at this point in the historyBrowse files
Refuse to apply a plan that keeps a modified snapshot under --force
`bundle deploy --plan plan.json --force` reused the zip staged when the
plan was produced. If the snapshot was untouched at plan time and the
content had not changed, that zip carries the previous snapshot's name
and the plan holds a skip, so the forced deploy stayed on the snapshot
that was modified in the workspace, contrary to what --force promises.
Detect this case and ask the user to rerun `bundle plan --force`, which
moves the deployment to a fresh snapshot.
Co-authored-by: Isaac <no-reply@databricks.com>
*`bundle deploy --plan --force` now fails instead of staying on a snapshot that was modified in the workspace after the plan was created; run `bundle plan --force` again.
OK: the saved plan moved the deployment to a new snapshot
56
56
57
+
=== Save a plan without changes, then break the glass before deploying it
58
+
>>> [CLI] bundle plan -o json
59
+
60
+
>>> [CLI] api post /api/2.0/snapshots:breakGlass --json {"snapshot_content_path": "/Workspace/Users/[UUID]/.snapshots/[SNAPSHOT_HASH]/[SNAPSHOT_HASH]-[UUID]/snapshot"}
61
+
true
62
+
63
+
=== Deploying the saved plan with --force fails, since it keeps the modified snapshot
returndiag.Errorf("the last deployment was modified in the workspace since the plan was created; run 'bundle plan --force' again to move to a new snapshot")
// Nothing to protect when no snapshot is there: the deployment predates the content
274
284
// subfolder, or the snapshot was deleted out of band, or an earlier deploy never created it.
275
285
// Failing here would also be a dead end, since this runs before the --force check and so
276
286
// could not be forced past.
277
287
iferrors.Is(err, apierr.ErrNotFound) {
278
-
returnnil, nil
288
+
returnnil, false, nil
279
289
}
280
290
iferr!=nil {
281
-
returnnil, err
291
+
returnnil, false, err
282
292
}
283
293
if!status.Dirty {
284
-
return&prev, nil
294
+
return&state, false, nil
285
295
}
286
296
if!b.Config.Bundle.Force {
287
-
returnnil, errors.New("the last deployment was modified in the workspace. Changes might be overwritten by this deployment. To confirm it, use the --force flag")
297
+
returnnil, false, errors.New("the last deployment was modified in the workspace. Changes might be overwritten by this deployment. To confirm it, use the --force flag")
0 commit comments