Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f2471e4
Integrate deployment metadata service for server-side locking and state
shreyas-goenka Mar 26, 2026
9d055f4
Fix correctness bugs and improve code quality from self-review
shreyas-goenka Mar 30, 2026
342fef8
Refactor to SDK-style tempdms package and unify deploy/destroy flows
shreyas-goenka Mar 30, 2026
29f5670
Fix query parameter handling for deployment metadata service API
shreyas-goenka Mar 31, 2026
aa11d7c
Fix remaining issues: enum naming, redundant param, add acceptance test
shreyas-goenka Mar 31, 2026
c21aee6
Update acceptance test to print all metadata service requests
shreyas-goenka Mar 31, 2026
1621bc2
Fix error masking and input validation from self-review
shreyas-goenka Mar 31, 2026
b1a9a0a
Add acceptance test golden files and fix SDK compatibility
shreyas-goenka Mar 31, 2026
8756548
Use string enums, report failed operations, and refactor lock acquisi…
shreyas-goenka Mar 31, 2026
8117d81
Inject liteswap traffic ID header when DATABRICKS_LITESWAP_ID is set
shreyas-goenka Apr 1, 2026
d648a9e
Remove unused liteswap env helper
shreyas-goenka Apr 1, 2026
fb92d36
Merge remote-tracking branch 'origin' into shreyas-goenka/deployment-…
shreyas-goenka Apr 7, 2026
3108d85
Delete deployment on destroy, use env.Get for liteswap, remove unused…
shreyas-goenka Apr 7, 2026
aad93ec
Move DeleteDeployment into cleanup closure, expand operation action m…
shreyas-goenka Apr 7, 2026
9292597
Add DeploymentLock and ResourceState interfaces for backend-agnostic …
shreyas-goenka Apr 7, 2026
2f9275d
Fix lint issues: errcheck, gofmt, gofumpt, perfsprint, exhaustive, go…
shreyas-goenka Apr 7, 2026
37d61ff
Rename and consolidate lock package files
shreyas-goenka Apr 7, 2026
89e02c1
Report INITIAL_REGISTER operations for existing resources on first DM…
shreyas-goenka Apr 7, 2026
cfcec21
Add acceptance test for INITIAL_REGISTER operation type
shreyas-goenka Apr 7, 2026
ef0335e
Rename filesystemLock to workspaceFilesystemLock
shreyas-goenka Apr 8, 2026
0f7c224
Make operation reporting non-best-effort and log lock release failures
shreyas-goenka Apr 8, 2026
0e5fdd3
Read deployment ID from workspace and skip state push for DMS
shreyas-goenka Apr 8, 2026
d4c032a
Add OCC, initial registration, backup state push, revert Manager inte…
shreyas-goenka Apr 8, 2026
defda06
Return error for force lock with DMS, fix stale comment and error mes…
shreyas-goenka Apr 8, 2026
83d4f17
Remove mapError, move liteswap transport to bundle, add test badness
shreyas-goenka Apr 10, 2026
ad6a2b1
Return error for force lock with DMS, fix stale comment and error mes…
shreyas-goenka Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions acceptance/bundle/dms/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bundle:
name: metadata-service-test

resources:
jobs:
test_job:
name: test-job
7 changes: 7 additions & 0 deletions acceptance/bundle/dms/deploy-error/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bundle:
name: metadata-service-error-test

resources:
jobs:
test_job:
name: test-job
6 changes: 6 additions & 0 deletions acceptance/bundle/dms/deploy-error/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions acceptance/bundle/dms/deploy-error/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

>>> musterr [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/metadata-service-error-test/default/files...
Deploying resources...
Error: cannot create resources.jobs.test_job: Invalid job configuration. (400 INVALID_PARAMETER_VALUE)

Endpoint: POST [DATABRICKS_URL]/api/2.2/jobs/create
HTTP Status: 400 Bad Request
API error_code: INVALID_PARAMETER_VALUE
API message: Invalid job configuration.

Updating deployment state...

>>> print_requests.py --get //bundle
{
"method": "POST",
"path": "/api/2.0/bundle/deployments",
"q": {
"deployment_id": "[UUID]"
},
"body": {
"target_name": "default"
}
}
{
"method": "GET",
"path": "/api/2.0/bundle/deployments/[UUID]"
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions",
"q": {
"version_id": "1"
},
"body": {
"cli_version": "[DEV_VERSION]",
"version_type": "VERSION_TYPE_DEPLOY",
"target_name": "default"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/operations",
"q": {
"resource_key": "resources.jobs.test_job"
},
"body": {
"resource_key": "resources.jobs.test_job",
"action_type": "OPERATION_ACTION_TYPE_CREATE",
"status": "OPERATION_STATUS_FAILED",
"error_message": "Invalid job configuration."
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/complete",
"body": {
"name": "deployments/[UUID]/versions/1",
"completion_reason": "VERSION_COMPLETE_FAILURE"
}
}
5 changes: 5 additions & 0 deletions acceptance/bundle/dms/deploy-error/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Deploy with the metadata service enabled, expecting a resource creation failure.
trace musterr $CLI bundle deploy

# Print the metadata service requests to verify the failed operation is reported.
trace print_requests.py --get //bundle
8 changes: 8 additions & 0 deletions acceptance/bundle/dms/deploy-error/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]
EnvMatrix.DATABRICKS_BUNDLE_MANAGED_STATE = ["true"]
RecordRequests = true

[[Server]]
Pattern = "POST /api/2.2/jobs/create"
Response.StatusCode = 400
Response.Body = '{"error_code": "INVALID_PARAMETER_VALUE", "message": "Invalid job configuration."}'
7 changes: 7 additions & 0 deletions acceptance/bundle/dms/initial-register/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bundle:
name: initial-register-test

resources:
jobs:
test_job:
name: test-job
6 changes: 6 additions & 0 deletions acceptance/bundle/dms/initial-register/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions acceptance/bundle/dms/initial-register/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/initial-register-test/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/initial-register-test/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> print_requests.py --get //bundle
{
"method": "POST",
"path": "/api/2.0/bundle/deployments",
"q": {
"deployment_id": "[UUID]"
},
"body": {
"target_name": "default"
}
}
{
"method": "GET",
"path": "/api/2.0/bundle/deployments/[UUID]"
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions",
"q": {
"version_id": "1"
},
"body": {
"cli_version": "[DEV_VERSION]",
"version_type": "VERSION_TYPE_DEPLOY",
"target_name": "default"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/operations",
"q": {
"resource_key": "resources.jobs.test_job"
},
"body": {
"resource_key": "resources.jobs.test_job",
"action_type": "OPERATION_ACTION_TYPE_INITIAL_REGISTER",
"resource_id": "[NUMID]",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/complete",
"body": {
"name": "deployments/[UUID]/versions/1",
"completion_reason": "VERSION_COMPLETE_SUCCESS"
}
}
11 changes: 11 additions & 0 deletions acceptance/bundle/dms/initial-register/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# First deploy without metadata service - creates the job using filesystem lock.
trace $CLI bundle deploy

# Enable metadata service and deploy again.
# Since this is the first DMS deployment (version 1) and the job hasn't changed
# (Skip action), it should be reported as INITIAL_REGISTER.
export DATABRICKS_BUNDLE_MANAGED_STATE=true
trace $CLI bundle deploy

# Print metadata service requests from the second deploy.
trace print_requests.py --get //bundle
5 changes: 5 additions & 0 deletions acceptance/bundle/dms/initial-register/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Override parent: start without managed state so the first deploy uses filesystem lock.
# The script enables managed state before the second deploy.
EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"]
EnvMatrix.DATABRICKS_BUNDLE_MANAGED_STATE = ["false"]
RecordRequests = true
6 changes: 6 additions & 0 deletions acceptance/bundle/dms/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 117 additions & 0 deletions acceptance/bundle/dms/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/metadata-service-test/default/files...
Deploying resources...
Updating deployment state...
Deployment complete!

>>> print_requests.py --get //bundle
{
"method": "POST",
"path": "/api/2.0/bundle/deployments",
"q": {
"deployment_id": "[UUID]"
},
"body": {
"target_name": "default"
}
}
{
"method": "GET",
"path": "/api/2.0/bundle/deployments/[UUID]"
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions",
"q": {
"version_id": "1"
},
"body": {
"cli_version": "[DEV_VERSION]",
"version_type": "VERSION_TYPE_DEPLOY",
"target_name": "default"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/operations",
"q": {
"resource_key": "resources.jobs.test_job"
},
"body": {
"resource_key": "resources.jobs.test_job",
"action_type": "OPERATION_ACTION_TYPE_CREATE",
"resource_id": "[NUMID]",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/complete",
"body": {
"name": "deployments/[UUID]/versions/1",
"completion_reason": "VERSION_COMPLETE_SUCCESS"
}
}

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
delete resources.jobs.test_job

All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/metadata-service-test/default

Deleting files...
Destroy complete!

>>> print_requests.py --get //bundle
{
"method": "POST",
"path": "/api/2.0/bundle/deployments",
"q": {
"deployment_id": "[UUID]"
},
"body": {
"target_name": "default"
}
}
{
"method": "GET",
"path": "/api/2.0/bundle/deployments/[UUID]"
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions",
"q": {
"version_id": "2"
},
"body": {
"cli_version": "[DEV_VERSION]",
"version_type": "VERSION_TYPE_DESTROY",
"target_name": "default"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/2/operations",
"q": {
"resource_key": "resources.jobs.test_job"
},
"body": {
"resource_key": "resources.jobs.test_job",
"action_type": "OPERATION_ACTION_TYPE_DELETE",
"resource_id": "[NUMID]",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/2/complete",
"body": {
"name": "deployments/[UUID]/versions/2",
"completion_reason": "VERSION_COMPLETE_SUCCESS"
}
}
{
"method": "DELETE",
"path": "/api/2.0/bundle/deployments/[UUID]"
}
11 changes: 11 additions & 0 deletions acceptance/bundle/dms/release-lock-error/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
bundle:
name: dms-release-lock-error

targets:
fail-complete:
default: true

resources:
jobs:
test_job:
name: test-job
6 changes: 6 additions & 0 deletions acceptance/bundle/dms/release-lock-error/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions acceptance/bundle/dms/release-lock-error/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-release-lock-error/fail-complete/files...
Deploying resources...
Updating deployment state...
Deployment complete!
Warn: Failed to release deployment lock: complete version: simulated complete version failure

>>> print_requests.py --get //bundle
{
"method": "POST",
"path": "/api/2.0/bundle/deployments",
"q": {
"deployment_id": "[UUID]"
},
"body": {
"target_name": "fail-complete"
}
}
{
"method": "GET",
"path": "/api/2.0/bundle/deployments/[UUID]"
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions",
"q": {
"version_id": "1"
},
"body": {
"cli_version": "[DEV_VERSION]",
"version_type": "VERSION_TYPE_DEPLOY",
"target_name": "fail-complete"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/operations",
"q": {
"resource_key": "resources.jobs.test_job"
},
"body": {
"resource_key": "resources.jobs.test_job",
"action_type": "OPERATION_ACTION_TYPE_CREATE",
"resource_id": "[NUMID]",
"status": "OPERATION_STATUS_SUCCEEDED"
}
}
{
"method": "POST",
"path": "/api/2.0/bundle/deployments/[UUID]/versions/1/complete",
"body": {
"name": "deployments/[UUID]/versions/1",
"completion_reason": "VERSION_COMPLETE_SUCCESS"
}
}
Loading