Skip to content

Register existing file state into best-effort deployment history - #7171

Draft
shreyas-goenka wants to merge 1 commit into
shreyas-goenka_data/shreyas/history-best-effort-defaultfrom
shreyas-goenka_data/shreyas/history-best-effort-migration
Draft

shreyas-goenka wants to merge 1 commit into
shreyas-goenka_data/shreyas/history-best-effort-defaultfrom
shreyas-goenka_data/shreyas/history-best-effort-migration

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Enabling best-effort deployment history on existing direct state now attempts INITIAL_REGISTER for the selected file snapshot before normal deployment planning. IDs, payloads, and dependency edges stay in resources.json; migration adds the enforced-history marker instead of replacing the file with a DMS tombstone.

Adapted from #6989:

  • Back up remote state and commit registration as a separate phase, so later planning failure or declined approval does not repeat it.
  • Claim the registration version at max(file serial, latest DMS version) + 1; ordinary deployment follows in its own version.
  • Warn on history registration errors and continue with authoritative file state. Local/remote state persistence errors still fail normally.
  • Preserve file state for planning without reopening resources from DMS. Reject saved plans only when initial registration is required; Terraform state must first migrate to direct with history disabled.

Stack: #7151 → #7169 → #7171 (this PR).

Validation:

  • Race tests for migration phases, state management, state DB, DMS helpers, and testserver.
  • All DMS, migration, state, and WAL acceptance groups passed without changing unrelated snapshots.
  • Acceptance cases cover backups, original IDs/dependencies, independent commit across planning failure/decline, repeated registration, and fail-open registration followed by successful deployment.
  • Scoped Go lint passed.

@github-actions

Copy link
Copy Markdown
Contributor

Commit: 575fdedd0 | Workflow run

Regression test report

Selected 20 changed tests (limit=20, 4 not selected)

20 tests: regression=17 unreleased=0 coverage=3 failing=0

test branch main (bef6321) latest (v1.22.1)
TestAccept/bundle/dms/bind-unbind-unsupported/DMS=true ✅ ✅ ✅
TestAccept/bundle/dms/declined-deploy/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/depends-on/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/deployment-metadata-change/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/empty-grants/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/failed-delete/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/failed-recreate/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/failed-update-permissions/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/migration-before-deploy/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/migration-fails-open/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/migration/DMS= ✅ ❌ ❌
TestAccept/bundle/dms/multiple-resources/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/no-drift/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/no-resources/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/operation-upload-fails-once/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/plan-without-dms/DMS= ✅ ✅ ✅
TestAccept/bundle/dms/repeated-migration/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/stale-local-state/DMS= ✅ ✅ ✅
TestAccept/bundle/dms/state-features/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/version-never-created/DMS=true ✅ ❌ ❌
TestAccept/bundle/dms/declined-deploy/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/declined-deploy/output.txt
        +++ /tmp/TestAcceptbundledmsdeclined-deployDMS=true2273202690/002/output.txt
        @@ -67,7 +67,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -81,8 +81,16 @@
         }
         {
           "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
        +{
        +  "method": "GET",
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]"
         }
        +{
        +  "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
         
         >>> print_state.py --no-dms
         {
        @@ -91,17 +97,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.schemas.foo": {
        -   "__id__": "main.dms_declined_deploy_schema_[UNIQUE_NAME]",
        -   "state": {
        -    "catalog_name": "main",
        -    "name": "dms_declined_deploy_schema_[UNIQUE_NAME]"
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === A destructive change without --auto-approve is declined: this console cannot prompt
        @@ -124,6 +121,10 @@
           "method": "GET",
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]"
         }
        +{
        +  "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
         
         === The recorded resources are unchanged by the decline: the schema is still at version 1
         >>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        @@ -160,6 +161,10 @@
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]"
         }
         {
        +  "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
        +{
           "method": "POST",
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions",
           "q": {
        
    acceptance_test.go:1114: 
        LOG.catalog: {
        LOG.catalog:   "catalog_type": "MANAGED_CATALOG",
        LOG.catalog:   "created_at": 1792769259093,
        LOG.catalog:   "created_by": "tester@databricks.com",
        LOG.catalog:   "full_name": "dms_other_43lnas3zgbdnhd2hibz47vzsiu",
        LOG.catalog:   "metastore_id": "7a06310e-183f-e253-7a06-310e183fe388",
        LOG.catalog:   "name": "dms_other_43lnas3zgbdnhd2hibz47vzsiu",
        LOG.catalog:   "owner": "tester@databricks.com",
        LOG.catalog:   "updated_at": 1792769259093,
        LOG.catalog:   "updated_by": "tester@databricks.com"
        LOG.catalog: }

latest (v1.22.1):

acceptance_test.go:1307: Diff:
        --- bundle/dms/declined-deploy/output.txt
        +++ /tmp/TestAcceptbundledmsdeclined-deployDMS=true1068474799/002/output.txt
        @@ -67,7 +67,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -81,8 +81,16 @@
         }
         {
           "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
        +{
        +  "method": "GET",
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]"
         }
        +{
        +  "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
         
         >>> print_state.py --no-dms
         {
        @@ -91,17 +97,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.schemas.foo": {
        -   "__id__": "main.dms_declined_deploy_schema_[UNIQUE_NAME]",
        -   "state": {
        -    "catalog_name": "main",
        -    "name": "dms_declined_deploy_schema_[UNIQUE_NAME]"
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === A destructive change without --auto-approve is declined: this console cannot prompt
        @@ -124,6 +121,10 @@
           "method": "GET",
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]"
         }
        +{
        +  "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
         
         === The recorded resources are unchanged by the decline: the schema is still at version 1
         >>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        @@ -160,6 +161,10 @@
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]"
         }
         {
        +  "method": "GET",
        +  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/resources"
        +}
        +{
           "method": "POST",
           "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions",
           "q": {
        
    acceptance_test.go:1114: 
        LOG.catalog: {
        LOG.catalog:   "catalog_type": "MANAGED_CATALOG",
        LOG.catalog:   "created_at": 1792769274781,
        LOG.catalog:   "created_by": "tester@databricks.com",
        LOG.catalog:   "full_name": "dms_other_6tdgkdizzvdejj4jvvxebr5w6y",
        LOG.catalog:   "metastore_id": "7a063111-bf4d-753c-7a06-3111bf4d7654",
        LOG.catalog:   "name": "dms_other_6tdgkdizzvdejj4jvvxebr5w6y",
        LOG.catalog:   "owner": "tester@databricks.com",
        LOG.catalog:   "updated_at": 1792769274781,
        LOG.catalog:   "updated_by": "tester@databricks.com"
        LOG.catalog: }
FAIL
TestAccept/bundle/dms/depends-on/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/depends-on/output.txt
        +++ /tmp/TestAcceptbundledmsdepends-onDMS=true3055678259/002/output.txt
        @@ -3,7 +3,10 @@
         >>> [CLI] bundle plan -o json
         {
           "plan_version": [PLAN_VERSION],
        -  "cli_version": "[CLI_VERSION]"
        +  "cli_version": "[CLI_VERSION]",
        +  "features": {
        +    "deployment_history": {}
        +  }
         }
         
         >>> [CLI] bundle plan
        @@ -58,7 +61,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -88,53 +91,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.jobs.child": {
        -   "__id__": "[CHILD_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-depends-on-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "description": "depends on [PARENT_ID]",
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "child",
        -    "queue": {
        -     "enabled": true
        -    }
        -   },
        -   "depends_on": [
        -    {
        -     "node": "resources.jobs.parent",
        -     "label": "${resources.jobs.parent.id}"
        -    }
        -   ]
        -  },
        -  "resources.jobs.parent": {
        -   "__id__": "[PARENT_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-depends-on-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "parent",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  }
        - }
        + "state": {}
         }
         
         >>> [CLI] bundle destroy --auto-approve

latest (v1.22.1): same output as main (bef6321)

TestAccept/bundle/dms/deployment-metadata-change/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/deployment-metadata-change/output.txt
        +++ /tmp/TestAcceptbundledmsdeployment-metadata-changeDMS=true1568465068/002/output.txt
        @@ -67,7 +67,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -128,7 +128,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }

latest (v1.22.1): same output as main (bef6321)

TestAccept/bundle/dms/empty-grants/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/empty-grants/output.txt
        +++ /tmp/TestAcceptbundledmsempty-grantsDMS=true833563094/002/output.txt
        @@ -138,7 +138,7 @@
           "lineage": "[UUID]",
           "serial": 2,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -163,17 +163,9 @@
          "lineage": "[UUID]",
          "serial": 2,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.schemas.foo": {
        -   "__id__": "main.dms_empty_grants_[UNIQUE_NAME]",
        -   "state": {
        -    "catalog_name": "main",
        -    "name": "dms_empty_grants_[UNIQUE_NAME]"
        -   }
        -  }
        - }
        + "state": {}
         }
         
         >>> [CLI] bundle destroy --auto-approve

latest (v1.22.1): same output as main (bef6321)

TestAccept/bundle/dms/failed-delete/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/failed-delete/output.txt
        +++ /tmp/TestAcceptbundledmsfailed-deleteDMS=true2245442470/002/output.txt
        @@ -67,7 +67,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -92,28 +92,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.jobs.stuck": {
        -   "__id__": "[STUCK_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-failed-delete-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "stuck",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === A resource that fails to delete is recorded as a failed operation carrying the error, so the history says why rather than showing the resource gone
        @@ -201,30 +181,11 @@
          "state_version": 3,
          "cli_version": "[CLI_VERSION]",
          "lineage": "[UUID]",
        - "serial": 1,
        + "serial": 2,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.jobs.stuck": {
        -   "__id__": "[STUCK_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-failed-delete-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "stuck",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === The remote checkpoint stays at serial 1 while DMS advances to version 2

latest (v1.22.1): same output as main (bef6321)

TestAccept/bundle/dms/failed-recreate/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/failed-recreate/output.txt
        +++ /tmp/TestAcceptbundledmsfailed-recreateDMS=true4018281981/002/output.txt
        @@ -67,7 +67,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -92,18 +92,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.schemas.foo": {
        -   "__id__": "main.dms_failed_recreate_schema_[UNIQUE_NAME]",
        -   "state": {
        -    "catalog_name": "main",
        -    "comment": "v1",
        -    "name": "dms_failed_recreate_schema_[UNIQUE_NAME]"
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === A recreate deletes and then fails to create. The delete went through, so the resource really is gone: the failed operation clears its state (self-contained, not assuming the delete's own write reached the service), rather than describing the resource as it was before the deploy
        @@ -188,7 +178,7 @@
          "lineage": "[UUID]",
          "serial": 2,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
          "state": {}
         }
        
    acceptance_test.go:1114: 
        LOG.catalog: {
        LOG.catalog:   "catalog_type": "MANAGED_CATALOG",
        LOG.catalog:   "created_at": 1792769255881,
        LOG.catalog:   "created_by": "tester@databricks.com",
        LOG.catalog:   "full_name": "dms_other_c7wbvurp7fdxpokujlo5nopiz4",
        LOG.catalog:   "metastore_id": "7a06310d-58cb-a5b8-7a06-310d58cba6bf",
        LOG.catalog:   "name": "dms_other_c7wbvurp7fdxpokujlo5nopiz4",
        LOG.catalog:   "owner": "tester@databricks.com",
        LOG.catalog:   "updated_at": 1792769255881,
        LOG.catalog:   "updated_by": "tester@databricks.com"
        LOG.catalog: }
    acceptance_test.go:1114: 
        LOG.plan_final: create schemas.foo
        LOG.plan_final: 
        LOG.plan_final: Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged

latest (v1.22.1):

acceptance_test.go:1307: Diff:
        --- bundle/dms/failed-recreate/output.txt
        +++ /tmp/TestAcceptbundledmsfailed-recreateDMS=true618326319/002/output.txt
        @@ -67,7 +67,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -92,18 +92,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.schemas.foo": {
        -   "__id__": "main.dms_failed_recreate_schema_[UNIQUE_NAME]",
        -   "state": {
        -    "catalog_name": "main",
        -    "comment": "v1",
        -    "name": "dms_failed_recreate_schema_[UNIQUE_NAME]"
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === A recreate deletes and then fails to create. The delete went through, so the resource really is gone: the failed operation clears its state (self-contained, not assuming the delete's own write reached the service), rather than describing the resource as it was before the deploy
        @@ -188,7 +178,7 @@
          "lineage": "[UUID]",
          "serial": 2,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
          "state": {}
         }
        
    acceptance_test.go:1114: 
        LOG.catalog: {
        LOG.catalog:   "catalog_type": "MANAGED_CATALOG",
        LOG.catalog:   "created_at": 1792769272698,
        LOG.catalog:   "created_by": "tester@databricks.com",
        LOG.catalog:   "full_name": "dms_other_tgmsvhol7ndc3lycv7fos732tu",
        LOG.catalog:   "metastore_id": "7a063111-4325-9409-7a06-31114325952d",
        LOG.catalog:   "name": "dms_other_tgmsvhol7ndc3lycv7fos732tu",
        LOG.catalog:   "owner": "tester@databricks.com",
        LOG.catalog:   "updated_at": 1792769272698,
        LOG.catalog:   "updated_by": "tester@databricks.com"
        LOG.catalog: }
    acceptance_test.go:1114: 
        LOG.plan_final: create schemas.foo
        LOG.plan_final: 
        LOG.plan_final: Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged
TestAccept/bundle/dms/failed-update-permissions/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/failed-update-permissions/output.txt
        +++ /tmp/TestAcceptbundledmsfailed-update-permissionsDMS=true2810519273/002/output.txt
        @@ -15,7 +15,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -45,50 +45,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.jobs.foo": {
        -   "__id__": "[FOO_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-failed-update-permissions-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "foo",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.foo.permissions": {
        -   "__id__": "/jobs/[FOO_ID]",
        -   "state": {
        -    "object_id": "/jobs/[FOO_ID]",
        -    "__embed__": [
        -     {
        -      "level": "CAN_VIEW",
        -      "user_name": "viewer@example.com"
        -     },
        -     {
        -      "level": "IS_OWNER",
        -      "user_name": "[USERNAME]"
        -     }
        -    ]
        -   },
        -   "depends_on": [
        -    {
        -     "node": "resources.jobs.foo",
        -     "label": "${resources.jobs.foo.id}"
        -    }
        -   ]
        -  }
        - }
        + "state": {}
         }
         
         === A permissions update that fails records the failure with the permissions it still has. The resource ID here is a path rather than a number, and the state is the embedded permission list, so this covers a shape the resource tests do not
        @@ -139,52 +97,11 @@
          "state_version": 3,
          "cli_version": "[CLI_VERSION]",
          "lineage": "[UUID]",
        - "serial": 1,
        + "serial": 2,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.jobs.foo": {
        -   "__id__": "[FOO_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-failed-update-permissions-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "foo",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.foo.permissions": {
        -   "__id__": "/jobs/[FOO_ID]",
        -   "state": {
        -    "object_id": "/jobs/[FOO_ID]",
        -    "__embed__": [
        -     {
        -      "level": "CAN_VIEW",
        -      "user_name": "viewer@example.com"
        -     },
        -     {
        -      "level": "IS_OWNER",
        -      "user_name": "[USERNAME]"
        -     }
        -    ]
        -   },
        -   "depends_on": [
        -    {
        -     "node": "resources.jobs.foo",
        -     "label": "${resources.jobs.foo.id}"
        -    }
        -   ]
        -  }
        - }
        + "state": {}
         }
         
         >>> print_requests.py --dms //api/2.0/bundle --oneline

latest (v1.22.1): same output as main (bef6321)

TestAccept/bundle/dms/migration-before-deploy/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/migration-before-deploy/output.txt
        +++ /tmp/TestAcceptbundledmsmigration-before-deployDMS=true2528876889/002/output.txt
        @@ -6,74 +6,10 @@
         >>> fault.py GET /api/2.2/jobs/get* 403 0 1
         
         >>> musterr [CLI] bundle deploy -qq
        -Enabling deployment history...
        -Deployment history enabled: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=2
        -Error: cannot plan resources.jobs.job: reading id="[JOB_ID]": Fault injected by test. (403 INJECTED)
        +Error: deployment history setting (true) does not match the existing state (false)
         
        -Endpoint: GET [DATABRICKS_URL]/api/2.2/jobs/get?job_id=[JOB_ID]
        -HTTP Status: 403 Forbidden
        -API error_code: INJECTED
        -API message: Fault injected by test.
        +Update experimental.deployment_history to match the existing deployment, or run "databricks bundle destroy" to start over
         
        -Error: planning failed
        +Error: Path (/Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.deployment.json) doesn't exist.
         
        -
        -=== Request order: complete migration -> upload full file state -> plan jobs
        ->>> print_requests.py --dms --get //api/2.0/bundle //jobs/get //workspace/import //workspace-files/import-file --oneline
        -{"method":"POST","path":"/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/2/complete"}
        -{"method":"POST","path":"/Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json"}
        -{"method":"GET","path":"/api/2.2/jobs/get"}
        -
        -=== Remote state: version 2 file state with resources; original snapshot preserved in the backup
        ->>> MSYS_NO_PATHCONV=1 [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json --format AUTO --file .databricks/resources.marker.json
        -
        ->>> jq -c {serial, features, state} .databricks/resources.marker.json
        -{"serial":2,"features":{"deployment_history_best_effort":{}},"state":{"resources.jobs.job":{"__id__":"[JOB_ID]","state":{"deployment":{"kind":"BUNDLE","metadata_file_path":"/Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/metadata.json"},"edit_mode":"UI_LOCKED","format":"MULTI_TASK","max_concurrent_runs":1,"name":"migration-before-deploy","queue":{"enabled":true}}},"resources.schemas.schema":{"__id__":"[SCHEMA_ID]","state":{"catalog_name":"main","name":"dms_migration_before_deploy_[UNIQUE_NAME]"}}}}
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json.backup --format AUTO --file .databricks/resources.backup.json
        -
        ->>> cmp .databricks/resources.before-migration.json .databricks/resources.backup.json
        -
        -=== Migration result: only completed version 2, with INITIAL_REGISTER operations
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-operations deployments/[DEPLOYMENT_ID]/versions/2 -o json
        -[{"resource_key":"jobs.job","action_type":"OPERATION_ACTION_TYPE_INITIAL_REGISTER","status":"OPERATION_STATUS_SUCCEEDED"},{"resource_key":"schemas.schema","action_type":"OPERATION_ACTION_TYPE_INITIAL_REGISTER","status":"OPERATION_STATUS_SUCCEEDED"}]
        -
        -=== 2. Retry without approval
        -Expect: deployment declined; migration stays at version 2 and is not repeated.
        ->>> musterr [CLI] bundle deploy -qq
        -
        -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        -  recreate resources.schemas.schema
        -Error: the deployment requires destructive actions, but the current console does not support prompting.
        -Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        -To proceed, use --auto-approve after reviewing the plan above.
        -
        -
        -=== Local and remote markers must stay byte-for-byte unchanged
        ->>> cmp .databricks/resources.marker.json .databricks/bundle/default/resources.json
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json --format AUTO --file .databricks/resources.after-decline.json
        -
        ->>> cmp .databricks/resources.marker.json .databricks/resources.after-decline.json
        -
        -=== No DMS writes and no extra version on the declined retry
        ->>> print_requests.py --dms //api/2.0/bundle
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        -
        -=== 3. Approve deployment
        -Expect: ordinary deployment version 3; version 2 remains the only migration.
        ->>> [CLI] bundle deploy --auto-approve -qq
        -
        -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        -  recreate resources.schemas.schema
        -
        ->>> [CLI] bundle summary -o json
        -{"latest_version_id":3}
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"},{"version_id":"3","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        +Exit code: 1
        
    acceptance_test.go:1114: 
        LOG.cleanup: Warn: planning resources.jobs.job: reading resources.jobs.job id="8792769254590434502": Fault injected by test.
        LOG.cleanup: The following resources will be deleted:
        LOG.cleanup:   delete resources.jobs.job
        LOG.cleanup:   delete resources.schemas.schema
        LOG.cleanup: 
        LOG.cleanup: This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
        LOG.cleanup:   delete resources.schemas.schema
        LOG.cleanup: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/dms-migration-before-deploy-ljllsg5apveavir7pvyftkywg4/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 2 deleted
    acceptance_test.go:1114: 
        LOG.setup: {
        LOG.setup:   "catalog_type": "MANAGED_CATALOG",
        LOG.setup:   "created_at": 1792769254703,
        LOG.setup:   "created_by": "tester@databricks.com",
        LOG.setup:   "full_name": "dms_other_ljllsg5apveavir7pvyftkywg4",
        LOG.setup:   "metastore_id": "7a06310d-1290-4485-7a06-310d12904661",
        LOG.setup:   "name": "dms_other_ljllsg5apveavir7pvyftkywg4",
        LOG.setup:   "owner": "tester@databricks.com",
        LOG.setup:   "updated_at": 1792769254703,
        LOG.setup:   "updated_by": "tester@databricks.com"
        LOG.setup: }

latest (v1.22.1):

acceptance_test.go:1307: Diff:
        --- bundle/dms/migration-before-deploy/output.txt
        +++ /tmp/TestAcceptbundledmsmigration-before-deployDMS=true3184979163/002/output.txt
        @@ -6,74 +6,10 @@
         >>> fault.py GET /api/2.2/jobs/get* 403 0 1
         
         >>> musterr [CLI] bundle deploy -qq
        -Enabling deployment history...
        -Deployment history enabled: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=2
        -Error: cannot plan resources.jobs.job: reading id="[JOB_ID]": Fault injected by test. (403 INJECTED)
        +Error: deployment history setting (true) does not match the existing state (false)
         
        -Endpoint: GET [DATABRICKS_URL]/api/2.2/jobs/get?job_id=[JOB_ID]
        -HTTP Status: 403 Forbidden
        -API error_code: INJECTED
        -API message: Fault injected by test.
        +Update experimental.deployment_history to match the existing deployment, or run "databricks bundle destroy" to start over
         
        -Error: planning failed
        +Error: Path (/Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.deployment.json) doesn't exist.
         
        -
        -=== Request order: complete migration -> upload full file state -> plan jobs
        ->>> print_requests.py --dms --get //api/2.0/bundle //jobs/get //workspace/import //workspace-files/import-file --oneline
        -{"method":"POST","path":"/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/2/complete"}
        -{"method":"POST","path":"/Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json"}
        -{"method":"GET","path":"/api/2.2/jobs/get"}
        -
        -=== Remote state: version 2 file state with resources; original snapshot preserved in the backup
        ->>> MSYS_NO_PATHCONV=1 [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json --format AUTO --file .databricks/resources.marker.json
        -
        ->>> jq -c {serial, features, state} .databricks/resources.marker.json
        -{"serial":2,"features":{"deployment_history_best_effort":{}},"state":{"resources.jobs.job":{"__id__":"[JOB_ID]","state":{"deployment":{"kind":"BUNDLE","metadata_file_path":"/Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/metadata.json"},"edit_mode":"UI_LOCKED","format":"MULTI_TASK","max_concurrent_runs":1,"name":"migration-before-deploy","queue":{"enabled":true}}},"resources.schemas.schema":{"__id__":"[SCHEMA_ID]","state":{"catalog_name":"main","name":"dms_migration_before_deploy_[UNIQUE_NAME]"}}}}
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json.backup --format AUTO --file .databricks/resources.backup.json
        -
        ->>> cmp .databricks/resources.before-migration.json .databricks/resources.backup.json
        -
        -=== Migration result: only completed version 2, with INITIAL_REGISTER operations
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-operations deployments/[DEPLOYMENT_ID]/versions/2 -o json
        -[{"resource_key":"jobs.job","action_type":"OPERATION_ACTION_TYPE_INITIAL_REGISTER","status":"OPERATION_STATUS_SUCCEEDED"},{"resource_key":"schemas.schema","action_type":"OPERATION_ACTION_TYPE_INITIAL_REGISTER","status":"OPERATION_STATUS_SUCCEEDED"}]
        -
        -=== 2. Retry without approval
        -Expect: deployment declined; migration stays at version 2 and is not repeated.
        ->>> musterr [CLI] bundle deploy -qq
        -
        -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        -  recreate resources.schemas.schema
        -Error: the deployment requires destructive actions, but the current console does not support prompting.
        -Deleting data assets such as schemas, pipelines, or volumes may cause permanent data loss and should be carefully reviewed.
        -To proceed, use --auto-approve after reviewing the plan above.
        -
        -
        -=== Local and remote markers must stay byte-for-byte unchanged
        ->>> cmp .databricks/resources.marker.json .databricks/bundle/default/resources.json
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/dms-migration-before-deploy-[UNIQUE_NAME]/default/state/resources.json --format AUTO --file .databricks/resources.after-decline.json
        -
        ->>> cmp .databricks/resources.marker.json .databricks/resources.after-decline.json
        -
        -=== No DMS writes and no extra version on the declined retry
        ->>> print_requests.py --dms //api/2.0/bundle
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        -
        -=== 3. Approve deployment
        -Expect: ordinary deployment version 3; version 2 remains the only migration.
        ->>> [CLI] bundle deploy --auto-approve -qq
        -
        -This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
        -  recreate resources.schemas.schema
        -
        ->>> [CLI] bundle summary -o json
        -{"latest_version_id":3}
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"},{"version_id":"3","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        +Exit code: 1
        
    acceptance_test.go:1114: 
        LOG.cleanup: Warn: planning resources.jobs.job: reading resources.jobs.job id="8792769270797971045": Fault injected by test.
        LOG.cleanup: The following resources will be deleted:
        LOG.cleanup:   delete resources.jobs.job
        LOG.cleanup:   delete resources.schemas.schema
        LOG.cleanup: 
        LOG.cleanup: This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
        LOG.cleanup:   delete resources.schemas.schema
        LOG.cleanup: 
        LOG.cleanup: All files and directories at the following location will be deleted: /Workspace/Users/tester@databricks.com/.bundle/dms-migration-before-deploy-obrp3l2cgfbcpplspjptje7lay/default
        LOG.cleanup: 
        LOG.cleanup: Destroy: 2 deleted
    acceptance_test.go:1114: 
        LOG.setup: {
        LOG.setup:   "catalog_type": "MANAGED_CATALOG",
        LOG.setup:   "created_at": 1792769270898,
        LOG.setup:   "created_by": "tester@databricks.com",
        LOG.setup:   "full_name": "dms_other_obrp3l2cgfbcpplspjptje7lay",
        LOG.setup:   "metastore_id": "7a063110-d7de-52ef-7a06-3110d7de53fb",
        LOG.setup:   "name": "dms_other_obrp3l2cgfbcpplspjptje7lay",
        LOG.setup:   "owner": "tester@databricks.com",
        LOG.setup:   "updated_at": 1792769270898,
        LOG.setup:   "updated_by": "tester@databricks.com"
        LOG.setup: }
TestAccept/bundle/dms/migration-fails-open/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/migration-fails-open/output.txt
        +++ /tmp/TestAcceptbundledmsmigration-fails-openDMS=true466304391/002/output.txt
        @@ -15,37 +15,9 @@
         >>> update_file.py databricks.yml name: one name: updated
         
         >>> [CLI] bundle deploy
        -Enabling deployment history...
        -Warn: Initial history registration was incomplete; continuing with file state: recording migration version: recording operation for resources.jobs.one: Fault injected by test.
        -Deployment history enabled: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=2
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-migration-fails-open-[UNIQUE_NAME]/default/files...
        -Updated jobs.one
        -Updated jobs.two
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 2 changed, 0 deleted, 0 unchanged
        +Error: deployment history setting (true) does not match the existing state (false)
         
        -=== The file still owns both resources, with the original IDs
        ->>> jq {serial, features, resources: (.state | keys), names: (.state | with_entries(.value = .value.state.name))} .databricks/bundle/default/resources.json
        -{
        -  "serial": 3,
        -  "features": {
        -    "deployment_history_best_effort": {}
        -  },
        -  "resources": [
        -    "resources.jobs.one",
        -    "resources.jobs.two"
        -  ],
        -  "names": {
        -    "resources.jobs.one": "updated",
        -    "resources.jobs.two": "two"
        -  }
        -}
        +Update experimental.deployment_history to match the existing deployment, or run "databricks bundle destroy" to start over
         
        ->>> cmp .databricks/ids.before.json .databricks/ids.after.json
         
        -=== Migration failed, but the following deployment completed successfully
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","completion_reason":"VERSION_COMPLETE_FAILURE"},{"version_id":"3","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        -
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-operations deployments/[DEPLOYMENT_ID]/versions/2 -o json
        -[{"resource_key":"jobs.one","status":"OPERATION_STATUS_PENDING"},{"resource_key":"jobs.two","status":"OPERATION_STATUS_SUCCEEDED"}]
        +Exit code: 1

latest (v1.22.1): same output as main (bef6321)

TestAccept/bundle/dms/migration/DMS=: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/migration/output.txt
        +++ /tmp/TestAcceptbundledmsmigrationDMS=4155653531/002/output.txt
        @@ -18,157 +18,21 @@
         >>> update_file.py databricks.yml name: one name: updated
         
         >>> musterr [CLI] bundle deploy --plan .databricks/before-history.plan.json
        -Error: enabling deployment history on existing state does not support --plan; run 'bundle deploy' without --plan
        +Error: deployment history setting (true) does not match the existing state (false)
         
        ->>> [CLI] bundle deploy
        -Enabling deployment history...
        -Deployment history enabled: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=2
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-migration-[UNIQUE_NAME]/default/files...
        -Current Deployment Version: [DATABRICKS_URL]/deployments/[DEPLOYMENT_ID]?version=3
        -Updated jobs.one
        -Updated jobs.two
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 2 changed, 0 deleted, 0 unchanged
        +Update experimental.deployment_history to match the existing deployment, or run "databricks bundle destroy" to start over
         
        -=== 3. Check local state
        -Expect: serial=3; history enforced; full resource state remains in the file; no WAL.
        ->>> find.py resources[.]json[.]wal --expect 0
         
        ->>> jq {serial, features, state} .databricks/bundle/default/resources.json
        -{
        -  "serial": 3,
        -  "features": {
        -    "deployment_history_best_effort": {}
        -  },
        -  "state": {
        -    "resources.jobs.one": {
        -      "__id__": "[ONE_ID]",
        -      "state": {
        -        "deployment": {
        -          "deployment_id": "[DEPLOYMENT_ID]",
        -          "kind": "BUNDLE",
        -          "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-migration-[UNIQUE_NAME]/default/state/metadata.json",
        -          "version_id": "3"
        -        },
        -        "edit_mode": "UI_LOCKED",
        -        "format": "MULTI_TASK",
        -        "max_concurrent_runs": 1,
        -        "name": "updated",
        -        "queue": {
        -          "enabled": true
        -        }
        -      }
        -    },
        -    "resources.jobs.two": {
        -      "__id__": "[TWO_ID]",
        -      "state": {
        -        "deployment": {
        -          "deployment_id": "[DEPLOYMENT_ID]",
        -          "kind": "BUNDLE",
        -          "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-migration-[UNIQUE_NAME]/default/state/metadata.json",
        -          "version_id": "3"
        -        },
        -        "edit_mode": "UI_LOCKED",
        -        "format": "MULTI_TASK",
        -        "max_concurrent_runs": 1,
        -        "name": "two",
        -        "queue": {
        -          "enabled": true
        -        },
        -        "tasks": [
        -          {
        -            "run_job_task": {
        -              "job_id": [ONE_ID]
        -            },
        -            "task_key": "run_one"
        -          }
        -        ]
        -      },
        -      "depends_on": [
        -        {
        -          "node": "resources.jobs.one",
        -          "label": "${resources.jobs.one.id}"
        -        }
        -      ]
        -    }
        -  }
        -}
        +>>> [CLI] bundle deploy
        +Error: deployment history setting (true) does not match the existing state (false)
         
        -=== 4. Check backup
        -Expect: original IDs, names and dependencies; exact pre-migration bytes.
        ->>> MSYS_NO_PATHCONV=1 [CLI] workspace export /Workspace/Users/[USERNAME]/.bundle/dms-migration-[UNIQUE_NAME]/default/state/resources.json.backup --format AUTO --file .databricks/resources.backup.first.json
        +Update experimental.deployment_history to match the existing deployment, or run "databricks bundle destroy" to start over
         
        ->>> cat .databricks/resources.backup.first.json
        -{
        - "state_version": 3,
        - "cli_version": "[CLI_VERSION]",
        - "lineage": "[UUID]",
        - "serial": 1,
        - "state": {
        -  "resources.jobs.one": {
        -   "__id__": "[ONE_ID]",
        -   "state": {
        -    "deployment": {
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-migration-[UNIQUE_NAME]/default/state/metadata.json"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "one",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.two": {
        -   "__id__": "[TWO_ID]",
        -   "state": {
        -    "deployment": {
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-migration-[UNIQUE_NAME]/default/state/metadata.json"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "two",
        -    "queue": {
        -     "enabled": true
        -    },
        -    "tasks": [
        -     {
        -      "run_job_task": {
        -       "job_id": [ONE_ID]
        -      },
        -      "task_key": "run_one"
        -     }
        -    ]
        -   },
        -   "depends_on": [
        -    {
        -     "node": "resources.jobs.one",
        -     "label": "${resources.jobs.one.id}"
        -    }
        -   ]
        -  }
        - }
        -}
        ->>> cmp .databricks/resources.before-dms.json .databricks/resources.backup.first.json
        +contains error: '?version=2' not found in the output.
        +contains error: '?version=3' not found in the output.
        +contains error: 'Current Deployment Version: ' not found in the output.
        +contains error: 'Deployment history enabled: ' not found in the output.
        +contains error: 'Enabling deployment history...' not found in the output.
        +contains error: 'Resources: 0 created' not found in the output.
         
        -=== 5. Check DMS records
        -Expect: completed versions 2 and 3; original job IDs and dependency preserved.
        -=== Version history: migration 2 completes before deployment 3
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-versions deployments/[DEPLOYMENT_ID] -o json
        -[{"version_id":"2","previous_version_id":null,"version_type":"VERSION_TYPE_DEPLOY","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"},{"version_id":"3","previous_version_id":"2","version_type":"VERSION_TYPE_DEPLOY","status":"VERSION_STATUS_COMPLETED","completion_reason":"VERSION_COMPLETE_SUCCESS"}]
        -
        -=== Migration 2: register the original job IDs (INITIAL_REGISTER)
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-operations deployments/[DEPLOYMENT_ID]/versions/2 -o json
        -[{"resource_key":"jobs.one","resource_id":"[ONE_ID]","action_type":"OPERATION_ACTION_TYPE_INITIAL_REGISTER","status":"OPERATION_STATUS_SUCCEEDED"},{"resource_key":"jobs.two","resource_id":"[TWO_ID]","action_type":"OPERATION_ACTION_TYPE_INITIAL_REGISTER","status":"OPERATION_STATUS_SUCCEEDED"}]
        -
        -=== Deployment 3: record updates separately
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-operations deployments/[DEPLOYMENT_ID]/versions/3 -o json
        -[{"resource_key":"jobs.one","resource_id":"[ONE_ID]","action_type":"OPERATION_ACTION_TYPE_UPDATE","status":"OPERATION_STATUS_SUCCEEDED"},{"resource_key":"jobs.two","resource_id":"[TWO_ID]","action_type":"OPERATION_ACTION_TYPE_UPDATE","status":"OPERATION_STATUS_SUCCEEDED"}]
        -
        -=== Current resources: new name, original IDs, and job two still depends on job one
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        -[{"resource_key":"jobs.one","resource_id":"[ONE_ID]","last_action_type":"OPERATION_ACTION_TYPE_UPDATE","last_version_id":"3","state":{"name":"updated","tasks":[],"depends_on":[]}},{"resource_key":"jobs.two","resource_id":"[TWO_ID]","last_action_type":"OPERATION_ACTION_TYPE_UPDATE","last_version_id":"3","state":{"name":"two","tasks":[{"task_key":"run_one","job_id":[ONE_ID]}],"depends_on":[{"node":"resources.jobs.one","label":"${resources.jobs.one.id}"}]}}]
        +Exit code: 1

latest (v1.22.1): same output as main (bef6321)

TestAccept/bundle/dms/multiple-resources/DMS=true: branch ✅ | main (bef6321) ❌ | latest (v1.22.1) ❌

main (bef6321):

acceptance_test.go:1307: Diff:
        --- bundle/dms/multiple-resources/output.txt
        +++ /tmp/TestAcceptbundledmsmultiple-resourcesDMS=true2494874969/002/output.txt
        @@ -25,7 +25,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -70,100 +70,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.jobs.five": {
        -   "__id__": "[FIVE_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "five",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.four": {
        -   "__id__": "[FOUR_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "four",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.one": {
        -   "__id__": "[ONE_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "one",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.three": {
        -   "__id__": "[THREE_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "three",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.two": {
        -   "__id__": "[TWO_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "two",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === Redeploy with no changes: nothing is applied, so no version is created at all - the deployment's version tracks state changes, like serial
        @@ -182,7 +90,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_best_effort": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -227,98 +135,7 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_best_effort": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.jobs.five": {
        -   "__id__": "[FIVE_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "five",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.four": {
        -   "__id__": "[FOUR_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "four",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.one": {
        -   "__id__": "[ONE_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "one",
        -    "queue": {
        -     "enabled": true
        -    }
        -   }
        -  },
        -  "resources.jobs.three": {
        -   "__id__": "[THREE_ID]",
        -   "state": {
        -    "deployment": {
        -     "deployment_id": "[DEPLOYMENT_ID]",
        -     "kind": "BUNDLE",
        -     "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/dms-multiple-resources-[UNIQUE_NAME]/default/state/metadata.json",
        -     "version_id": "1"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "three",
        -    "queue": {
... (25 more lines truncated, raise DATABRICKS_CLI_TEST_MAX_LOG to see more)

latest (v1.22.1): same output as main (bef6321)

6 more failure details omitted, see the full report in the run.

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 575fded

Run: 39977408250

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 310 25 4:49
✅​ aws-windows-latest-4core-16gb 312 23 8:59
✅​ azure linux-2core-8gb 309 25 4:34
✅​ azure-windows-latest-4core-16gb 311 23 9:02
✅​ gcp linux-2core-8gb 310 25 4:38
✅​ gcp-windows-latest-4core-16gb 312 23 9:04
Top 3 slowest tests (at least 2 minutes):
duration env testname
7:11 azure-windows-latest-4core-16gb TestAccept
7:07 aws-windows-latest-4core-16gb TestAccept
7:04 gcp-windows-latest-4core-16gb TestAccept

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants