Skip to content
Merged
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 NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### Bundles
* Remove `experimental-jobs-as-code` template, superseded by `pydabs` ([#4999](https://github.com/databricks/cli/pull/4999)).
* engine/direct: Added support for Vector Search Endpoints ([#4887](https://github.com/databricks/cli/pull/4887))
* engine/direct: Exclude deploy-only fields (e.g. `lifecycle`) from the Apps update mask so requests that change both `description` and `lifecycle.started` in the same deploy no longer fail with `INVALID_PARAMETER_VALUE`.

### Dependency updates

Expand Down
36 changes: 34 additions & 2 deletions acceptance/bundle/resources/apps/lifecycle-started/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,23 @@ Deploying resources...
Updating deployment state...
Deployment complete!

>>> print_requests.py //deployments
>>> print_requests.py //apps
{
"method": "POST",
"path": "/api/2.0/apps/[UNIQUE_NAME]/stop",
"body": {}
}
{
"method": "POST",
"path": "/api/2.0/apps/[UNIQUE_NAME]/update",
"body": {
"app": {
"description": "MY_APP_DESCRIPTION_2",
"name": "[UNIQUE_NAME]"
},
"update_mask": "description"
}
}

>>> errcode [CLI] apps get [UNIQUE_NAME]
"STOPPED"
Expand All @@ -87,7 +103,23 @@ Deploying resources...
Updating deployment state...
Deployment complete!

>>> print_requests.py //deployments
>>> print_requests.py //apps
{
"method": "POST",
"path": "/api/2.0/apps/[UNIQUE_NAME]/update",
"body": {
"app": {
"description": "MY_APP_DESCRIPTION_3",
"name": "[UNIQUE_NAME]"
},
"update_mask": "description"
}
}
{
"method": "POST",
"path": "/api/2.0/apps/[UNIQUE_NAME]/start",
"body": {}
}
{
"method": "POST",
"path": "/api/2.0/apps/[UNIQUE_NAME]/deployments",
Expand Down
4 changes: 2 additions & 2 deletions acceptance/bundle/resources/apps/lifecycle-started/script
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ title "Stop app externally, then deploy with started=false: app stays stopped"
trace update_file.py databricks.yml "started: true" "started: false"
trace update_file.py databricks.yml MY_APP_DESCRIPTION MY_APP_DESCRIPTION_2
trace errcode $CLI bundle deploy
trace print_requests.py //deployments
trace print_requests.py //apps
rm -f out.requests.txt
{ trace errcode $CLI apps get $UNIQUE_NAME | jq '.compute_status.state'; } || true

title "Deploy with started=true: compute restarted and code deployed"
trace update_file.py databricks.yml "started: false" "started: true"
trace update_file.py databricks.yml MY_APP_DESCRIPTION_2 MY_APP_DESCRIPTION_3
trace errcode $CLI bundle deploy
trace print_requests.py //deployments
trace print_requests.py //apps
rm -f out.requests.txt
{ trace errcode $CLI apps get $UNIQUE_NAME | jq '.compute_status.state'; } || true
3 changes: 3 additions & 0 deletions bundle/direct/dresources/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ func (r *ResourceApp) DoUpdate(ctx context.Context, id string, config *AppState,
for i, fieldPath := range fieldPaths {
fieldPaths[i] = truncateAtIndex(fieldPath)
}
fieldPaths = slices.DeleteFunc(fieldPaths, func(p string) bool {
return deployOnlyFields[p]
})
updateMask := strings.Join(fieldPaths, ",")
request := apps.AsyncUpdateAppRequest{
App: &config.App,
Expand Down