diff --git a/acceptance/bundle/config-remote-sync/config_edits/output.txt b/acceptance/bundle/config-remote-sync/config_edits/output.txt index ff88716b3c..2a59c6f563 100644 --- a/acceptance/bundle/config-remote-sync/config_edits/output.txt +++ b/acceptance/bundle/config-remote-sync/config_edits/output.txt @@ -26,6 +26,7 @@ Resource: resources.jobs.my_job email_notifications.on_failure[0]: replace max_concurrent_runs: replace tags['env']: remove + timeout_seconds: remove @@ -41,15 +42,16 @@ Resource: resources.jobs.my_job + - remote-failure@example.com parameters: - name: catalog -@@ -35,7 +35,6 @@ +@@ -35,8 +35,6 @@ unit: DAYS tags: - env: config-production team: data-team - max_concurrent_runs: 3 +- timeout_seconds: 3600 + max_concurrent_runs: 5 - timeout_seconds: 3600 environments: + - environment_key: default >>> [CLI] bundle destroy --auto-approve The following resources will be deleted: diff --git a/bundle/configsync/defaults.go b/bundle/configsync/defaults.go index 9b0157bf03..166a6bb38f 100644 --- a/bundle/configsync/defaults.go +++ b/bundle/configsync/defaults.go @@ -97,12 +97,20 @@ var serverSideDefaults = map[string]any{ "resources.pipelines.*.continuous": false, } -func shouldSkipField(path string, value any) bool { +// shouldSkipField checks if a field should be skipped in change detection. +// When hasConfigValue is true (field is set in config or saved state), only +// "always skip" fields are skipped. Backend defaults are only skipped when the +// field is not in config/state, matching the behavior of shouldSkipBackendDefault +// in the direct deployment engine. +func shouldSkipField(path string, value any, hasConfigValue bool) bool { for pattern, expected := range serverSideDefaults { if matchPattern(pattern, path) { if _, ok := expected.(skipAlways); ok { return true } + if hasConfigValue { + return false + } if _, ok := expected.(skipIfZeroOrNil); ok { return value == nil || value == int64(0) } diff --git a/bundle/configsync/diff.go b/bundle/configsync/diff.go index 0d8bddc2e9..e483a3f943 100644 --- a/bundle/configsync/diff.go +++ b/bundle/configsync/diff.go @@ -70,7 +70,7 @@ func filterEntityDefaults(basePath string, value any) any { for key, val := range m { fieldPath := basePath + "." + key - if shouldSkipField(fieldPath, val) { + if shouldSkipField(fieldPath, val, false) { continue } @@ -91,7 +91,7 @@ func convertChangeDesc(path string, cd *deployplan.ChangeDesc) (*ConfigChangeDes return nil, fmt.Errorf("failed to normalize remote value: %w", err) } - if shouldSkipField(path, normalizedValue) { + if shouldSkipField(path, normalizedValue, hasConfigValue) { return &ConfigChangeDesc{ Operation: OperationSkip, }, nil