Unclear if this is precisely the path we want to take to handle possible partial repo initialization so feel free to leave suggestions if a different behavior would be better Update the repo init logic to continue if the repo is marked as already existing. If it already exists then the process will try to update persistent config info in the repo. If the repo already exists but some connection credential is incorrect then stack errors such that both the reason for the connect failure and the fact that the repo already exists are both visible. Manually tested attempting to initialize a repo that was already initialized but using a different passphrase and got the output: ```text Error: initializing repository: a repository was already initialized with that configuration: connecting to kopia repo: unable to create format manager: invalid repository password: repo already exists: repository already initialized exit status 1 ``` Attempting to initialize a repo again using the same passphrase resulted in a success message with no errors reported Unfortunately I can't really add unit tests to ensure the config ends up the way we expect because I have no way to trigger an error partway through kopia's init logic (or even just after it) without some non-trivial code refactoring --- #### Does this PR need a docs update or release note? - [x] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [ ] ⛔ No #### Type of change - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Test Plan - [x] 💪 Manual - [x] ⚡ Unit test - [ ] 💚 E2E
SRC Directory
/pkg
API and Components which are exposed for external usage.
-
/pkg/repository
Control layer for coordinating connections and communication with storage provider repositories. -
/pkg/storage
Manages compilation and validation of repository configuration and consts. Both those that are specific to storage providers, and those that are provider-agnostic.
/cli
Command Line Interface controller. Utilizes /pkg/repository as an external dependency.
/internal
Packages which are only intended for use within Corso.