fix(bundle/direct): construct UpdateApp update_mask dynamically based on changed fields (#6400) - #6424
Conversation
Approval status: pending
|
… on changed fields (databricks#6400)
99e9496 to
59c46b4
Compare
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
This explains the mechanism but does not explain the motivation. What behaviour change are trying to elicit? Have you observed current implementation not being able to deploy some valid configs or not pick up changes in databricks.yml on the subsequent deploy? |
Changes
update_maskinResourceApp.DoUpdateusingcollectUpdatePathsWithPrefix(entry.Changes, "").source_code_path,config,git_source,lifecycle,lifecycle.*) fromupdate_mask.updateMaskvariable string inbundle/direct/dresources/app.go.acceptance/bundle/resources/apps/update/out.requests.direct.json..nextchanges/bundles/app_update_mask.md.Why
Previously,
ResourceApp.DoUpdatesent a fixedupdate_maskstring containing all updatableapps.Appfields (includingcompute_size,compute_min_instances,compute_max_instances, etc.) on everyUpdateAppcall regardless of what was specified in the bundle config. Becauseapps.Appfields useomitempty, omitted fields were dropped from the request body while still being specified inupdate_mask. Building theupdate_maskdynamically ensures it strictly matches the fields modified inentry.Changes.Tests
acceptance/bundle/resources/apps/update/out.requests.direct.jsonfixture to verify that updating onlydescriptionyields"update_mask": "description".TestAppDoUpdate_UpdateMaskHasAllFieldsinbundle/direct/dresources/app_test.go.