Repository navigation
Avoid syncing cluster policy values into shared bundle config - #7170
Draft
ilyakuz-db wants to merge 8 commits into
Draft
ilyakuz-db wants to merge 8 commits into
ilyakuz-db wants to merge 8 commits into
Conversation
Contributor
|
Commit: Regression test reportSelected 6 changed tests (limit=20, 0 not selected) 12 tests: regression=10 unreleased=0 coverage=2 failing=0
TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) TestAccept/bundle/config-remote-sync/cluster_policy_cross_target/DMS=true: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) TestAccept/bundle/config-remote-sync/cluster_policy_remote_addition/DMS=true: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): TestAccept/bundle/config-remote-sync/cluster_policy_replaces_array/DMS=: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) TestAccept/bundle/config-remote-sync/cluster_policy_replaces_array/DMS=true: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS=: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) TestAccept/bundle/config-remote-sync/external_cluster_policy_cross_target/DMS=true: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) TestAccept/bundle/config-remote-sync/missing_cluster_policy_structural_changes/DMS=: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) TestAccept/bundle/config-remote-sync/missing_cluster_policy_structural_changes/DMS=true: branch ✅ | main (270b2d0) ❌ | latest (v1.22.1) ❌main (270b2d0): latest (v1.22.1): same output as main (270b2d0) |
Collaborator
Integration test reportCommit: 7519bf2
Top 10 slowest tests (at least 2 minutes):
|
This branch has not been deployed
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.
Changes
config-remote-synccan copy policy-injected cluster values into shared YAML when syncing an unrelated UI edit. Add a read-only policy filter after the existing bundle-plan extraction and resource selection steps, using the effective policy read by the remote cluster's policy ID.The plan, existing extraction/selection code, and their tests remain unchanged. The filter returns new changes, preserves authored values, and uses existing keyed-slice metadata when inspecting nested fields of whole-object changes. For policy-backed clusters, keyed identities must be nonempty and unique in both snapshots; ambiguity and unexpected authored-config lookup errors fail before saving. Only genuine field absence is treated as unauthored. Clusters without a policy bypass these checks. Policy lookups are lazy and cached per sync. Replace the blanket tag/log-default exclusions with value-based policy filtering so genuine UI additions can sync.
Preserve required fields and array positions. A wholly policy-supplied replacement removes the obsolete authored value. Missing policies skip affected fields; structural changes or removals paired with a missing-policy skip leave the whole resource unchanged. Other lookup errors abort before saving. Missing policies reuse JSON status
skippedwith structuredskippedChanges; safe edits may still be present infilesandchanges. Successful policy filtering remainssuccess. Text output identifies the unsynced fields/resources. UI consumers still need reason-aware messaging and handling of unsynced changes before rollout.Why
Syncing a description-only UI edit can copy one target's policy values into shared YAML. Deploying that YAML to a target with different policy constraints then fails validation. A missing policy should allow independent edits to sync without silently copying unclassified fields.
Policy matching uses the current effective definition because remote values do not carry provenance. Values from an older policy definition may not be recognized. Partial arrays and required objects retain values when removing them would invalidate their structure; semantic dependencies between separate scalar edits are not validated.
Tests
Cross-target acceptance coverage for bundle-managed and external policies, including description-only edits and UI-added tags that deploy with the destination target's policy values.
Acceptance coverage for whole-object additions, policy-only replacements, deleted policies, structural changes, and autoscale-to-fixed-worker switches; permission errors stop before saving, and unselected resources trigger no policy lookups.
Config-sync acceptance runs in both DMS modes, including partial safe saves and skipped-only results after policy deletion.
Focused unit coverage for effective family definitions, authored false/zero values, required fields, keyed reordering, lookup caching, later fatal errors, plan/input-change immutability, ambiguous/empty identities, and unexpected authored-config lookup failures.
Acceptance status assertions and identity/lookup regression tests were added first and failed before the follow-up fix.
Repository formatting, checks, lint and unit tests pass. The full local acceptance run passed all 4,440 cases (5 skipped); all 50 config-sync scenarios were rerun in both DMS modes after review refinements.
This PR was written with assistance from Codex.