Omit config values from write failure diagnostics - #541
Merged
selviarora merged 1 commit intoSep 15, 2026
Merged
Conversation
Assisted-By: devx/736bac94-4b2a-4b19-b5cc-1826ad565f21
donk-shopify
approved these changes
Sep 15, 2026
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.
When a config write fails,
ConfigWriteErrorcurrently includes old and new values in its message. This sends credentials to stderr and configured exception reporters during initial storage, rotation, or deletion. The exception also retains the complete old/new config contents, including unchanged values.Keep the section/key diagnostic and addition/removal markers, but omit every value and retain only the sanitized diff on the exception. Compare the attempted in-memory config directly so multiline values cannot be reparsed as diagnostic key or section names. Atomic writes, symlink handling, errno preservation, and
SystemCallErrorrescue compatibility remain covered.ConfigWriteErrornow takes parsed config hashes instead of serialized strings and no longer exposesold_contentornew_content; itsconfig_path,diff, anderrnoreaders remain available.Validation on Ruby 3.4.3 with the locked dependencies:
bundle exec rake test: 148 runs, 691 assertions, 0 failures/errors, 7 existing skips.bundle exec rake style: 62 files, no offenses.bundle exec srb tc: no errors.