-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Description
Parent Issue: #84
Estimated Time: ~25 minutes
Phase: 3 (Parallel with Sub-Issue 4)
Goal
Auto-migrate config on first run - create user config with vault_location and migrate oauth.client_id from repo config.
Files
- Modify:
.workspace/scripts/config.py(add migration function) - Modify:
.workspace/config.yaml(remove oauth.client_id during migration) - Test:
.workspace/tests/test_config_migration.py(new file)
Dependencies
Requires: Sub-Issues 1 & 2 completed
Phase: Phase 3 (parallel with Sub-Issue 4)
Implementation Steps
See full implementation steps in issue #84 under "Sub-Issue 3: Implement Auto-Migration Logic"
Summary
- Write failing tests for migration (4 tests)
- Implement
_migrate_config()function - Add migration call to
load_config() - Run tests to verify they pass
- Test migration with real config
- Run type checker
- Commit changes
- Close this sub-issue
Key Requirements
- CRITICAL: Use atomic writes (temp file → chmod 0o600 → os.replace)
- Never delete or corrupt existing files
- Follow OAuth storage pattern (
.workspace/scripts/oauth/storage.py:136-175) - Set 0o600 permissions on user config
- Preserve user config if it already exists
Acceptance Criteria
- Creates
~/.config/vipunen/config.yamlon first run - Sets vault_location from cwd
- Moves oauth.client_id from repo to user config
- Removes oauth section from repo config
- Sets 0o600 permissions on user config
- Preserves existing user config (no overwrite)
- All tests pass
- Type checking passes
Testing Commands
uv run pytest .workspace/tests/test_config_migration.py -v
uv run pyright .workspace/scripts/config.pyMetadata
Metadata
Assignees
Labels
No labels