Skip to content

direct: Exclude deploy-only fields from Apps update mask#5042

Merged
simonfaltum merged 1 commit intomainfrom
simonfaltum/apps-update-mask-fix
Apr 21, 2026
Merged

direct: Exclude deploy-only fields from Apps update mask#5042
simonfaltum merged 1 commit intomainfrom
simonfaltum/apps-update-mask-fix

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

Why

When an Apps resource changes both description and lifecycle.started in the same deploy, the direct engine produces an update_mask of "description,lifecycle". The Apps Update API rejects it:

Error: cannot update resources.apps.myapp: updating id=...: Invalid update mask.
Only description, budget_policy_id, usage_policy_id, resources, user_api_scopes,
compute_size, compute_min_instances, compute_max_instances, git_repository,
telemetry_export_destinations are allowed.
Supplied update mask: description, lifecycle
(400 INVALID_PARAMETER_VALUE)

lifecycle is a deploy-only field managed by the CLI (via start/stop + the Deployments API), not by the App Update endpoint.

This surfaced in the nightly run lifecycle-started/DATABRICKS_BUNDLE_ENGINE=direct acceptance test. Locally the mock server does not validate the update mask, so the bug slipped through.

Changes

Before: DoUpdate collected every Update path in the plan entry, truncated each to its top-level field, and joined them into the mask. Deploy-only fields (source_code_path, config, git_source, lifecycle) leaked into the mask whenever they changed alongside a real App field.

Now: filter deployOnlyFields out of the collected paths before building the mask. The hasAppChanges gate already applies the same filter to decide whether to call Update at all; this matches the mask to the same set of fields.

Also updated lifecycle-started acceptance test to print //apps instead of only //deployments for the two steps that toggle started and change description together, so the update_mask now appears in the recorded output. Without the fix the mask shows "description,lifecycle"; with the fix it shows "description" only.

Test plan

  • go test ./bundle/direct/... passes
  • go test ./acceptance -run 'TestAccept/bundle/resources/apps/' passes (all engines)
  • make checks passes
  • Nightly lifecycle-started/direct + related tests pass on cloud

The Apps Update API rejects update_mask values containing fields like
lifecycle that are managed via the Deploy API. DoUpdate was collecting
every changed path (including deploy-only ones), so when a deploy changed
both description and lifecycle.started, the mask became
"description,lifecycle" and the request failed with
INVALID_PARAMETER_VALUE.

Filter deployOnlyFields out of the collected paths before building the
update mask. The hasAppChanges gate already applies the same filter to
decide whether to call Update at all; this matches the mask to the same
set of fields.

Co-authored-by: Isaac
@simonfaltum simonfaltum added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 5187c58 Apr 21, 2026
24 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/apps-update-mask-fix branch April 21, 2026 10:04
bernardo-rodriguez pushed a commit to bernardo-rodriguez/b-cli that referenced this pull request Apr 22, 2026
## Summary
- Add Lakebase destroy/recreate prompt (databricks#5052) and fail-on-active-runs
deleted-resource fix (databricks#5044) to the Bundles section.
- Note the `jobs list` / `jobs list-runs` `--page-size` rename that came
with the repo-wide `--limit` flag from the SDK v0.127.0 bump.
- Attribute the Apps update-mask change to databricks#5042 and databricks#5051 (the
follow-up that made the mask a fixed allowlist).
- Clean up inconsistencies: drop the empty `Notable Changes` and `API
Changes` sections, normalize trailing periods, and tighten blank lines
under section headers.
deco-sdk-tagging Bot added a commit that referenced this pull request Apr 22, 2026
## Release v0.298.0

### CLI
* Added `--limit` flag to all paginated list commands for client-side result capping ([#4984](#4984)). On `jobs list` and `jobs list-runs` the former API page-size flag was renamed to `--page-size` (hidden) to avoid collision.
* Accept `yes` in addition to `y` for confirmation prompts, and show `[y/N]` to indicate that no is the default.
* Cache `/.well-known/databricks-config` lookups under `~/.cache/databricks/<version>/host-metadata/` so repeat CLI invocations against the same host skip the ~700ms discovery round trip.
* Deprecated `auth env`. The command is hidden from help listings and prints a deprecation warning to stderr; it will be removed in a future release.

### Bundles
* Remove `experimental-jobs-as-code` template, superseded by `pydabs` ([#4999](#4999)).
* Prompt before destroying or recreating Lakebase resources (database instances, synced database tables, postgres projects and branches) ([#5052](#5052)).
* Treat deleted resources as not running in the `fail-on-active-runs` check ([#5044](#5044)).
* engine/direct: Added support for Vector Search Endpoints ([#4887](#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` ([#5042](#5042), [#5051](#5051)).
* engine/direct: Fix phantom diffs from `depends_on` reordering in job tasks ([#4990](#4990)).

### Dependency updates
* Bump `github.com/databricks/databricks-sdk-go` from v0.126.0 to v0.128.0 ([#4984](#4984), [#5031](#5031)).
* Bump Go toolchain to 1.25.9 ([#5004](#5004)).
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