You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stacked on #6138 — review that first. Based on its branch so this diff shows only the reporting change; rebase onto main once #6138 merges.
Problem
config-remote-sync leaves a change unapplied when it cannot be attributed to a single source location. That is the right call — the command runs unattended, and a guessed location is worse than nothing. But every drop path is a log.Debugf, while the command still prints the full detected changeset and exits 0.
So a run that dropped an edit is indistinguishable from one that applied it, and the in-workspace UI reports "written back" for changes that were not. split/keyed_rename in this repo has been dropping two changes with no visible signal.
Solution
ResolveChanges returns the skipped changes alongside the resolved ones, and the caller reports them: a Not written back section in the text output, a skipped array in the JSON output (omitted when empty, so existing consumers are unaffected), a warn-level log line per drop, and a skipped_changes_count telemetry counter.
Only paths where a real user edit is discarded are counted. The OperationRemove-on-an-undefined-field path is deliberately excluded — a field absent from config has nothing to remove, so that drop is correct rather than a lost edit, and counting it would fire on ordinary runs.
Tests
split/keyed_rename already triggers the unpaired-rename path, so it gains the reporting assertions rather than a new directory — its golden previously showed two changes as detected with no indication they were dropped. It now asserts the text section, and a second run with -o json asserts the skipped array. No other golden changes.
Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.
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
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.
Problem
config-remote-syncleaves a change unapplied when it cannot be attributed to a single source location. That is the right call — the command runs unattended, and a guessed location is worse than nothing. But every drop path is alog.Debugf, while the command still prints the full detected changeset and exits 0.So a run that dropped an edit is indistinguishable from one that applied it, and the in-workspace UI reports "written back" for changes that were not.
split/keyed_renamein this repo has been dropping two changes with no visible signal.Solution
ResolveChangesreturns the skipped changes alongside the resolved ones, and the caller reports them: aNot written backsection in the text output, askippedarray in the JSON output (omitted when empty, so existing consumers are unaffected), a warn-level log line per drop, and askipped_changes_counttelemetry counter.Only paths where a real user edit is discarded are counted. The
OperationRemove-on-an-undefined-field path is deliberately excluded — a field absent from config has nothing to remove, so that drop is correct rather than a lost edit, and counting it would fire on ordinary runs.Tests
split/keyed_renamealready triggers the unpaired-rename path, so it gains the reporting assertions rather than a new directory — its golden previously showed two changes as detected with no indication they were dropped. It now asserts the text section, and a second run with-o jsonasserts theskippedarray. No other golden changes.