Update: round-trip withOverrides config and redact secrets in diffs#10
Merged
Conversation
Config migrations now transform the authored overrides of a withOverrides({...}) file and re-emit the wrapper (instead of flattening it to JSON and inlining defaults); plain object exports are unchanged and the baseline is skipped. Secrets are redacted in read-only/dry-run diffs, undefined-valued keys are preserved, multiple config migrations compose on one file, mutate() gets a context.merged arg, and a non-writable conf dir auto-degrades to report-only.
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 8, 2026
# [2.1.0](v2.0.0...v2.1.0) (2026-07-08) ### Chore * trigger add-to-project on reopened issues and PRs ([cd2ee80](cd2ee80)) ### Docs * Add README ([5c86395](5c86395)) * document dry-run mode and readOnlyConfig ([8b62995](8b62995)) * file the migrations guide under the development section (#8) ([036239f](036239f)), closes [#8](#8) * note DDL/transaction limitation on replica sets ([56708b1](56708b1)) ### Update * round-trip withOverrides config and redact secrets in diffs (#10) ([dd667c5](dd667c5)), closes [#10](#10)
|
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Update
Config migrations previously imported each
conf/*.config.jsdefault export and rewrote it as flatJSON.stringify(...). For an instance using thewithOverrides({...})baseline pattern that export is the fully merged object, so the rewrite inlined every inherited default and dropped the wrapper (and would break the baselinedefaults.config.jsitself). In read-only/dry-run modes the diff also printed raw secret values.This makes the engine round-trip both config styles and stop leaking secrets:
Symbol.for('adapt-authoring:configOverrides'/'…configDefaults')markers awithOverrideshelper attaches. Overrides files transform the authored overrides only and re-emitexport default withOverrides({...}); the baseline is skipped (hand-maintained per release); plain object exports keep their existing behaviour.logConfigDiffmasks sensitive leaf keys (secret/password/token/apiKey/connectionUri/…) as[redacted], recursively into nested values, with an additiveredactKeysconfig option.confdir (pre-flightW_OKcheck, plus a defensive catch ofEACCES/EROFS/EPERMon write) degrades to the report-only path automatically.readOnlyConfigremains as an override for writable-but-hands-off (version-controlled) conf.Fix
key: undefinedentries (used to unset an inherited default) by emitting valid JS instead of JSON, which dropped them.mutate(fn)receives a secondcontext.mergedarg (read baseline values on overrides installs); a null-unsafe mutate is now a per-file warning rather than a boot failure.Docs
docs/migrations.md.Testing
node --test),standardclean.runMigrations()against an isolated DB, secret redaction, and a real read-only (chmod 0555) conf dir degrading to report-only.