Repository navigation
Prepare bundle bindings in memory before approval - #7765
shreyas-goenka wants to merge 1 commit into
Conversation
|
Commit: Regression test reportSelected 14 changed tests (limit=20, 0 not selected) 19 tests: regression=17 unreleased=0 coverage=2 failing=0
TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=/READPLAN=: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): same output as main (828e0b1) TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=/READPLAN=1: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): same output as main (828e0b1) TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=true/READPLAN=: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): same output as main (828e0b1) TestAccept/bundle/deployment/bind/dashboard/recreation/DMS=true/READPLAN=1: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): same output as main (828e0b1) TestAccept/bundle/deployment/bind/job/noop-job/DMS=: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): same output as main (828e0b1) TestAccept/bundle/deployment/bind/job/noop-job/DMS=true: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): TestAccept/bundle/dms_fault/complete_version/DMS=true: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): TestAccept/bundle/dms_fault/delete_deployment/DMS=true: branch ✅ | main (828e0b1) ❌ | latest (v1.27.0) ❌main (828e0b1): latest (v1.27.0): 9 more failure details omitted, see the full report in the run. |
✅ Integration test reportCommit: 4307a20
Top 50 slowest tests (at least 2 minutes):
|
758f928 to
8254700
Compare
| "cli_version": "[CLI_VERSION]", | ||
| "lineage": "[UUID]", | ||
| "serial": 2, | ||
| "serial": 1, |
There was a problem hiding this comment.
bundle deployment bind increments serial by 2. This PR fixes that - now the increment is 1. That's why the serial goes down here.
| >>> bundle deploy --auto-approve | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-fault-complete_version-commands-[UNIQUE_NAME]/files... | ||
| Current Deployment Version: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=9 | ||
| Current Deployment Version: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=7 |
There was a problem hiding this comment.
We bind a job and a pipeline in these tests. Because now the serial is only +1 then, the final version goes down by 2 (since 2 binds happened, +4 -> +2)
| return | ||
| } | ||
| resource := result.Resource | ||
| if err := db.SaveState(ctx, resourceKey, resource.ID, resource.State, resource.DependsOn); err != nil { |
There was a problem hiding this comment.
This is the crux and the setup for DMS. This SaveState call will also record the bind operation in DMS in a followup.
Without this refactor, we would need to keep StateDB as is here, and record the bind operation completely separately in an independent code path, once the bind was approved.
| logdiag.LogError(ctx, err) | ||
| return | ||
| } | ||
| if _, err := db.Finalize(ctx); err != nil { |
There was a problem hiding this comment.
This is now the +1 serial associated with bind.
| } | ||
|
|
||
| // Save state with ID and empty state (like migrate does) | ||
| err = b.StateDB.SaveState(ctx, resourceKey, resourceID, struct{}{}, nil) |
There was a problem hiding this comment.
first serial +1 previously. This just persists the resource ID into state. To set the stage to compute a plan and then use the state from the plan to persist into state.
| return nil, err | ||
| } | ||
|
|
||
| err = b.StateDB.SaveState(ctx, resourceKey, resourceID, compacted, dependsOn) |
There was a problem hiding this comment.
second serial +1, adding the computed state from plan into resources.json
8254700 to
7e80982
Compare
7e80982 to
83ec890
Compare
andrewnester
left a comment
There was a problem hiding this comment.
No blocking findings from a full pass; I'll take a manual look at the direct, phases changes before approving.
83ec890 to
4307a20
Compare
Changes
bundle deployment bindcurrently writes temporary state twice before asking for approval. Prepare both planning passes in isolated memory, then persist the approved binding through one StateDB transaction.This removes temporary binding files and changes the usual state serial increment from two to one. Resource previews, reference resolution, and approval behavior are preserved. This is the preparation layer beneath the deployment-history PRs.
Validation
Stack: this PR → shared DMS helpers #7766 → bind history #7400 → unbind history #7401.
This PR was written by Codex.