Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .nextchanges/bundles/app-source-code-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For apps deployed with the direct engine, `source_code_path` and `git_source` are now also sent as part of the Create/Update App request (in addition to the app Deploy API), so they are recorded on the app and drift-detected. The Terraform engine is unchanged (its `databricks_app` resource cannot manage these input-only fields).
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
},
"body": {
"description": "",
"name": "test-app-direct"
"name": "test-app-direct",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/direct/files/app"
}
}
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state"
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/delete",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal",
"recursive": true
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal"
}
}
{
"method": "POST",
"path": "/api/2.0/apps",
"q": {
"no_compute": "true"
},
"body": {
"description": "best app",
"name": "myapp",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/app"
}
}
{
"method": "POST",
"path": "/api/2.0/pipelines",
"body": {
"channel": "CURRENT",
"deployment": {
"kind": "BUNDLE",
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
},
"edition": "ADVANCED",
"name": "app url is myapp-123.cloud.databricksapps.com"
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/delete",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state"
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/delete",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal",
"recursive": true
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal"
}
}
{
"method": "POST",
"path": "/api/2.0/apps",
"q": {
"no_compute": "true"
},
"body": {
"description": "best app",
"name": "myapp"
}
}
{
"method": "POST",
"path": "/api/2.0/pipelines",
"body": {
"channel": "CURRENT",
"deployment": {
"kind": "BUNDLE",
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
},
"edition": "ADVANCED",
"name": "app url is myapp-123.cloud.databricksapps.com"
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/delete",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock"
}
}
53 changes: 0 additions & 53 deletions acceptance/bundle/resource_deps/remote_app_url/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,59 +31,6 @@ Files: 1 uploaded, 0 deleted
Resources: 2 created, 0 changed, 0 deleted, 0 unchanged

>>> print_requests.py ^//import-file/
{
"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state"
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/delete",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal",
"recursive": true
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/mkdirs",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal"
}
}
{
"method": "POST",
"path": "/api/2.0/apps",
"q": {
"no_compute": "true"
},
"body": {
"description": "best app",
"name": "myapp"
}
}
{
"method": "POST",
"path": "/api/2.0/pipelines",
"body": {
"channel": "CURRENT",
"deployment": {
"kind": "BUNDLE",
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
},
"edition": "ADVANCED",
"name": "app url is myapp-123.cloud.databricksapps.com"
}
}
{
"method": "POST",
"path": "/api/2.0/workspace/delete",
"body": {
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock"
}
}

>>> [CLI] bundle destroy --auto-approve
The following resources will be deleted:
Expand Down
4 changes: 3 additions & 1 deletion acceptance/bundle/resource_deps/remote_app_url/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ trace $CLI bundle plan
trace print_requests.py '^//import-file/'

trace $CLI bundle deploy
trace print_requests.py '^//import-file/'
# The app create body diverges by engine (the direct engine sends source_code_path,
# the Terraform provider cannot manage it), so record these requests per engine.
trace print_requests.py '^//import-file/' > out.requests.$DATABRICKS_BUNDLE_ENGINE.json

trace $CLI bundle destroy --auto-approve
trace print_requests.py --sort '^//import-file/'
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Created apps.myapp
Files: 0 uploaded, 0 deleted
Resources: 1 created, 0 changed, 0 deleted, 0 unchanged

=== Plan is a no-op: config/source_code_path drift is skipped while the app has no active deployment
=== Plan is a no-op: config drift is skipped (no active deployment); source_code_path is input-only
>>> [CLI] bundle plan
Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged

=== Both deploy-only fields are skipped with reason "no active deployment"
=== config skipped with "no active deployment"; source_code_path skipped as input_only
>>> [CLI] bundle plan -o json
{
"config": {
Expand Down Expand Up @@ -43,8 +43,9 @@ Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
},
"source_code_path": {
"action": "skip",
"reason": "no active deployment",
"reason": "spec:input_only",
"old": "/Workspace/Users/[USERNAME]/.bundle/app-config-no-deployment/default/files/app",
"new": "/Workspace/Users/[USERNAME]/.bundle/app-config-no-deployment/default/files/app"
"new": "/Workspace/Users/[USERNAME]/.bundle/app-config-no-deployment/default/files/app",
"remote": ""
}
}
4 changes: 2 additions & 2 deletions acceptance/bundle/resources/apps/config-no-deployment/script
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ echo "*" > .gitignore
title "Deploy: app created with no_compute; config is not deployed until the app starts"
trace $CLI bundle deploy

title "Plan is a no-op: config/source_code_path drift is skipped while the app has no active deployment"
title "Plan is a no-op: config drift is skipped (no active deployment); source_code_path is input-only"
trace $CLI bundle plan | contains.py "Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged"

title "Both deploy-only fields are skipped with reason \"no active deployment\""
title "config skipped with \"no active deployment\"; source_code_path skipped as input_only"
trace $CLI bundle plan -o json | jq '.plan[].changes | {config, source_code_path}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"method": "POST",
"path": "/api/2.0/apps",
"q": {
"no_compute": "true"
},
"body": {
"description": "",
"name": "myappname",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"method": "POST",
"path": "/api/2.0/apps",
"q": {
"no_compute": "true"
},
"body": {
"description": "",
"name": "myappname"
}
}
11 changes: 0 additions & 11 deletions acceptance/bundle/resources/apps/default_description/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,3 @@ Files: 5 uploaded, 0 deleted
Resources: 1 created, 0 changed, 0 deleted, 0 unchanged

>>> print_requests.py //apps
{
"method": "POST",
"path": "/api/2.0/apps",
"q": {
"no_compute": "true"
},
"body": {
"description": "",
"name": "myappname"
}
}
4 changes: 3 additions & 1 deletion acceptance/bundle/resources/apps/default_description/script
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
trace $CLI bundle deploy
trace print_requests.py //apps
# The create body diverges by engine: the direct engine sends source_code_path, the
# Terraform provider cannot manage it (input_only), so record requests per engine.
trace print_requests.py //apps > out.requests.$DATABRICKS_BUNDLE_ENGINE.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

=== Deploy: app created with no_compute; git_source is not deployed until the app starts
=== Deploy: git_source is sent on Create; the app has no_compute so nothing is deployed yet
>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/app-git-source-no-deployment/default/files...
Created apps.myapp
Files: 0 uploaded, 0 deleted
Resources: 1 created, 0 changed, 0 deleted, 0 unchanged

=== Plan is a no-op: git_source drift is skipped while the app has no active deployment
=== Plan is a no-op: git_source is input-only, so its drift is suppressed
>>> [CLI] bundle plan
Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged

=== git_source is skipped with reason "no active deployment"
=== git_source is skipped as input_only
>>> [CLI] bundle plan -o json
{
"git_source": {
"action": "skip",
"reason": "no active deployment",
"reason": "spec:input_only",
"old": {
"branch": "main"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
echo "*" > .gitignore

title "Deploy: app created with no_compute; git_source is not deployed until the app starts"
title "Deploy: git_source is sent on Create; the app has no_compute so nothing is deployed yet"
trace $CLI bundle deploy

title "Plan is a no-op: git_source drift is skipped while the app has no active deployment"
title "Plan is a no-op: git_source is input-only, so its drift is suppressed"
trace $CLI bundle plan | contains.py "Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged"

title "git_source is skipped with reason \"no active deployment\""
title "git_source is skipped as input_only"
trace $CLI bundle plan -o json | jq '.plan[].changes | {git_source}'
3 changes: 2 additions & 1 deletion acceptance/bundle/resources/apps/immutable/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ You can access the app at my-immutable-app-123.cloud.databricksapps.com
},
"body": {
"description": "",
"name": "my-immutable-app"
"name": "my-immutable-app",
"source_code_path": "/Workspace/Users/[UUID]/.snapshots/[UUID]/[SNAPSHOT_HASH]/files/app"
}
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
},
"body": {
"description": "my_app_description",
"name": "[UNIQUE_NAME]"
"name": "[UNIQUE_NAME]",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/lifecycle-started-omitted-[UNIQUE_NAME]/default/files/app"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
{
"body": {
"description": "my_app_description",
"name": "[UNIQUE_NAME]"
"name": "[UNIQUE_NAME]",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/lifecycle-started-toggle-[UNIQUE_NAME]/default/files/app"
},
"method": "POST",
"path": "/api/2.0/apps",
Expand Down
13 changes: 8 additions & 5 deletions acceptance/bundle/resources/apps/lifecycle-started/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
"path": "/api/2.0/apps",
"body": {
"description": "my_app_description",
"name": "[UNIQUE_NAME]"
"name": "[UNIQUE_NAME]",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files/app"
}
}
{
Expand Down Expand Up @@ -88,9 +89,10 @@ Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
"body": {
"app": {
"description": "MY_APP_DESCRIPTION_2",
"name": "[UNIQUE_NAME]"
"name": "[UNIQUE_NAME]",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files/app"
},
"update_mask": "description,budget_policy_id,usage_policy_id,resources,user_api_scopes,forward_user_access_token,compute_size,compute_min_instances,compute_max_instances,git_repository,telemetry_export_destinations"
"update_mask": "description,budget_policy_id,usage_policy_id,resources,user_api_scopes,forward_user_access_token,compute_size,compute_min_instances,compute_max_instances,git_repository,git_source,source_code_path,telemetry_export_destinations"
}
}

Expand All @@ -115,9 +117,10 @@ Resources: 0 created, 1 changed, 0 deleted, 0 unchanged
"body": {
"app": {
"description": "MY_APP_DESCRIPTION_3",
"name": "[UNIQUE_NAME]"
"name": "[UNIQUE_NAME]",
"source_code_path": "/Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files/app"
},
"update_mask": "description,budget_policy_id,usage_policy_id,resources,user_api_scopes,forward_user_access_token,compute_size,compute_min_instances,compute_max_instances,git_repository,telemetry_export_destinations"
"update_mask": "description,budget_policy_id,usage_policy_id,resources,user_api_scopes,forward_user_access_token,compute_size,compute_min_instances,compute_max_instances,git_repository,git_source,source_code_path,telemetry_export_destinations"
}
}
{
Expand Down
Loading
Loading