-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Print migration changes to the console when migrating config file #4548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+518
−182
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5686e63
Bump generics dependency
stefanhaller bf13e0b
Cleanup: use assert.NoError
stefanhaller da5789b
Cleanup: flip conditions for less indentation
stefanhaller 4f959da
Cleanup: fix formatting of test cases
stefanhaller 0249d4c
Cleanup: return didChange bool from computeMigratedConfig
stefanhaller df805f3
Add tests for migration of renamed keys
stefanhaller 61822b7
Add tests for migrating null keybindings to <disabled>
stefanhaller ffda510
Print migration hints only when GUI hasn't started yet
stefanhaller 48305c1
Cleanup: remove redundant if statement
stefanhaller caa8c92
Make RenameYamlKey return a bool
stefanhaller a4f43cb
Log a list of migration changes to the console
stefanhaller cabcd54
Include migration changes in the error message if we can't log them
stefanhaller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to switch to returning
nil
in all cases when we don't make changes, could we just use a check againstchangedContent == nill
instead?No strong preference for that, I just thought of the idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, that's what I initially did. It has the theoretical problem that if we ever write a migrator that only removes a key without replacement, then you can't distinguish the case that nothing was done from the case that the config file only contained that key, and we removed it. (You might argue that the Yaml library will probably return an empty bytes slice instead of nil in that case, so we could still distinguish that, but I'm actually not sure if that's really the case, and I don't think we should rely on it.)
The extra bool is a bit clearer and safer.