configsync: don't sync policy-injected custom_tags and cluster_log_conf#5610
Merged
Conversation
Collaborator
Integration test reportCommit: 05ddd2d
24 interesting tests: 15 SKIP, 7 RECOVERED, 2 flaky
Top 26 slowest tests (at least 2 minutes):
|
| // This is a temporary solution until the bundle plan issue is resolved. | ||
| // Fields mapped to alwaysSkip are always considered defaults regardless of value. | ||
| // Other fields are compared using reflect.DeepEqual. | ||
| var serverSideDefaults = map[string]any{ |
Contributor
There was a problem hiding this comment.
We store these defaults or maps for direct deployments as well. Does it make sense to leverage backend_defaults from bundle/direct/dresources/resources.yml to reduce maintainence?
Contributor
Author
There was a problem hiding this comment.
100% makes sense, I have an abandoned PR to do that #4677
The implementation is good but we need to test it more with cluster policies to avoid unexpected side-effects in bundle plan, I'm going to return to this PR soon
Contributor
Author
There was a problem hiding this comment.
And this PR is a quick fix
Cluster policies inject fixed values for custom_tags and cluster_log_conf when the user omits them, so these fields exist only remotely. config-remote-sync wrote them back into databricks.yml as adds, leaking one environment's policy values into shared config and causing deploys in other environments to be rejected by their own policy. Skip these fields in configsync when they are absent from config, via a new backendDefault marker (skip regardless of remote value when not set locally), while still syncing them for users who manage them explicitly. Add an acceptance test that simulates policy injection via jobs reset and verifies the fields are no longer written back, while a legitimate edit still syncs.
5cced42 to
05ddd2d
Compare
pietern
approved these changes
Jun 17, 2026
Collaborator
Integration test reportCommit: fad22d7
502 interesting tests: 421 MISS, 38 FAIL, 29 RECOVERED, 4 KNOWN, 4 PANIC, 4 flaky, 2 SKIP
Top 50 slowest tests (at least 2 minutes):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cluster policies inject fixed values for
custom_tagsandcluster_log_confwhen the user omits them in their bundle config. These values exist only on the backend, soconfig-remote-syncdetected them as additions and wrote them back intodatabricks.yml. When the synced file is shared across environments, one environment's policy-injected values leak into another and cause deploys there to be rejected by their own cluster policy.Changes
backendDefaultmarker to configsync'sserverSideDefaults. A field mapped to it is skipped during change detection when it is absent from config, regardless of its remote value. Fields the user manages explicitly (present in config) continue to sync normally.custom_tagsandcluster_log_confon job task clusters, job clusters, and standalone clusters.This change is scoped to
config-remote-sync. The longer-term plan is to express these asbackend_defaultsin the direct engine lifecycle metadata (resources.yml) once configsync filtering is migrated to consume that metadata; aTODOmarks the spot.Testing
bundle/config-remote-sync/policy_injected_cluster_fieldsdeploys a job with these cluster fields unset, simulates policy injection viajobs reset, then runsconfig-remote-sync --save. It verifies the injected fields are not written back while a legitimate edit still syncs. Runs on both the direct and terraform engines.