Conversation
tis24dev
commented
Feb 4, 2026
- Log updated missing config keys after upgrade
- Insert missing template keys respecting user order
- Group unanchored missing keys into upgrade section
- Improve casing conflict warning wording
- Track/preserve keys that differ only by case
- Populate MissingKeys when none found
- Translate comments and docs from Italian to English
After running the configuration upgrade, log an informational message when missing keys were added. Adds a conditional that checks sessionLogger and cfgUpgradeResult and logs the count and comma-separated list of cfgUpgradeResult.MissingKeys to help surface which keys were introduced during the upgrade.
Improve config upgrade logic to preserve user key positions and insert missing template entries near related user keys. parseEnvValues now records key ranges (keyRange) for each user entry and returns them; computeConfigUpgrade collects template entries, computes missing entries, and builds ordered insert operations (using sort) to merge template lines into the original file without unnecessary rewrites. Also adjust handling for block (multi-line) values, preserve extra keys and casing warnings, and update tests (rename and expectations) to reflect preserved extra keys and original casing for blocks.
Add an index field to templateEntry to track template order and use it for insert ordering. When missing template entries have no nearby anchor, collect them and append a single "# Added by upgrade" section (with a separating blank line if appropriate) at the append index instead of trying to insert them in-place. Adjust insertOp ordering accordingly. Add a test (TestUpgradeConfigAddsMissingKeysUnderUpgradeSectionWhenNoAnchor) to verify legacy keys are preserved and missing keys are added under the upgrade section.
Update the warning emitted in computeConfigUpgrade when a config key differs only by case from a template key. The message now says the entry is "preserved with original casing" instead of "preserved as custom entry" to more accurately describe the behavior and reduce confusion. Affects internal/config/upgrade.go.
Add handling for keys that differ only by case from template keys. Introduce CaseConflictKeys on UpgradeResult and populate it in computeConfigUpgrade, update warnings to note case-only differences, and preserve those keys in-place. Update CLI output (cmd/proxsave) to print case-conflict summaries for dry-run and upgrade flows. Adjust tests to assert CaseConflictKeys instead of treating them as ExtraKeys. Also clarify ExtraKeys are preserved in-place in comments.
Ensure UpgradeResult.MissingKeys is assigned in the branch where no missing keys are detected. Previously MissingKeys was left unset when len(missingKeys) == 0, which could lead to inconsistent result state for callers; this change sets it to the empty slice alongside other result fields in computeConfigUpgrade (internal/config/upgrade.go).
Translate Italian comments and user-facing text to English across the codebase and docs. Changes touch docs/RESTORE_GUIDE.md, internal/* files (backup/archiver.go, config/config.go, config/templates/backup.env, orchestrator/deps_test.go, orchestrator/extensions.go, pbs/namespaces.go, types/exit_codes.go). These are comment/text updates and template comment translations only; no functional logic was modified.
There was a problem hiding this comment.
Pull request overview
This pull request syncs the dev branch to main, incorporating several improvements to the configuration upgrade system and translating Italian comments/documentation to English.
Changes:
- Added logging for missing config keys after upgrade completion
- Refactored config upgrade logic to insert missing template keys while respecting user key order and grouping unanchored keys under an "# Added by upgrade" section
- Enhanced case conflict handling by tracking keys that differ only by case from template keys via new
CaseConflictKeysfield - Improved warning message clarity for case conflicts
- Translated Italian comments and documentation to English across multiple files
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/types/exit_codes.go | Translated Italian comment to English for Int() method |
| internal/pbs/namespaces.go | Translated Italian comments to English for Namespace type and ListNamespaces function |
| internal/orchestrator/extensions.go | Translated Italian comments to English for interface types and registration methods |
| internal/orchestrator/deps_test.go | Translated Italian comment to English for FakePrompter type |
| internal/config/upgrade_test.go | Renamed test function for clarity, updated assertions for CaseConflictKeys, removed check for custom section header, added new test for unanchored keys |
| internal/config/upgrade.go | Major refactoring: added CaseConflictKeys tracking, implemented anchor-based insertion logic, added keyRange tracking, enhanced parseEnvValues signature |
| internal/config/templates/backup.env | Translated Italian comments to English for security and permissions section |
| internal/config/config.go | Translated Italian comments to English for Config type, LoadConfig, parse, Get, and Set functions (contains duplicate comment) |
| internal/backup/archiver.go | Translated Italian comments to English for WithLookPathOverride and CompressionError |
| docs/RESTORE_GUIDE.md | Translated Italian text to English in FAQ section |
| cmd/proxsave/upgrade.go | Added logging for missing config keys and output for CaseConflictKeys count |
| cmd/proxsave/main.go | Added output for CaseConflictKeys in both dry-run and actual upgrade modes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| result.Warnings = warnings | ||
| result.ExtraKeys = extraKeys | ||
| result.PreservedValues = preserved |
There was a problem hiding this comment.
The early return when content hasn't changed is missing the MissingKeys and CaseConflictKeys fields. These should be populated even when Changed is false to maintain consistency with the behavior at line 281-288.
| result.Warnings = warnings | |
| result.ExtraKeys = extraKeys | |
| result.PreservedValues = preserved | |
| result.MissingKeys = missingKeys | |
| result.ExtraKeys = extraKeys | |
| result.CaseConflictKeys = caseConflictKeys | |
| result.PreservedValues = preserved | |
| result.Warnings = warnings |
| // parse interprets raw configuration values. | ||
| // It supports both legacy and new backup.env formats. |
There was a problem hiding this comment.
The comment block for the parse function is duplicated. Lines 331-332 repeat exactly what's on lines 329-330.
| // parse interprets raw configuration values. | |
| // It supports both legacy and new backup.env formats. |