feat(config): migrate config file to config.yaml with automatic migra…#4
Merged
feat(config): migrate config file to config.yaml with automatic migra…#4
Conversation
…tion - Change config filename from "config" to "config.yaml" for better format recognition - Implement automatic migration from old "config" to new "config.yaml" format - Add safety checks: YAML validation, backup creation, permission preservation - Migration only occurs when old file exists and new file doesn't exist - Old config file is backed up as "config.backup" (never deleted) - Add comprehensive test coverage for migration scenarios (26 tests pass) - Add LogMigration() method to audit logger for future use - Update README.md to reflect config.yaml filename Migration guarantees: - No data loss (backup file preserved) - No corruption (YAML validation before migration) - No overwrites (won't replace existing config.yaml) - Atomic operation (rollback on failure)
dkmnx
added a commit
that referenced
this pull request
Jan 30, 2026
Changed logAuditEvent to return errors instead of silently failing to stderr. This allows callers to decide whether audit failures should be warnings or fatal errors. All 7 callers now handle audit errors with ui.PrintWarn() to inform users without blocking the main operation. - Changed logAuditEvent signature to return error - Added defer logger.Close() for resource cleanup - Updated all callers with error handling pattern - Updated TestAuditLoggerErrorHandling for new behavior - Removed unused imports from test file Fixes: code review issue #4 (Low priority)
dkmnx
added a commit
that referenced
this pull request
Jan 30, 2026
- Update coverage metrics: cmd package at 53.4%, overall at 79.5% - Document why original 70% target was not achievable - Add comprehensive analysis of coverage gaps and integration test coverage - Add resolution summary showing all high/medium priority issues RESOLVED - Document new tests: cmd/audit_helpers_test.go (343 lines, 6 functions) High and medium priority security issues (#1, #2, #3, #4, #5, #10) are now RESOLVED.
dkmnx
added a commit
that referenced
this pull request
Feb 9, 2026
feat(config): migrate config file to config.yaml with automatic migra…
dkmnx
added a commit
that referenced
this pull request
Feb 9, 2026
Changed logAuditEvent to return errors instead of silently failing to stderr. This allows callers to decide whether audit failures should be warnings or fatal errors. All 7 callers now handle audit errors with ui.PrintWarn() to inform users without blocking the main operation. - Changed logAuditEvent signature to return error - Added defer logger.Close() for resource cleanup - Updated all callers with error handling pattern - Updated TestAuditLoggerErrorHandling for new behavior - Removed unused imports from test file Fixes: code review issue #4 (Low priority)
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.
Summary
configtoconfig.yamlfor better format recognition and editor supportChanges
Core Implementation
migrateConfigFile()function with automatic migration inLoadConfig()config.backup)Safety Guarantees
config.backup(never deleted)config.yamlTest Coverage
Documentation
config.yamlfilenameMigration Behavior
When a user with an old
configfile runs any Kairo command:config.yamlfileconfig.backupNo user intervention required - migration is transparent and automatic.
Test plan
Checklist