fix(#286): correct eternal storage CLI examples and catch unknown-tie…#301
fix(#286): correct eternal storage CLI examples and catch unknown-tie…#301sshekhar563 wants to merge 3 commits into
Conversation
prakashUXtech
left a comment
There was a problem hiding this comment.
Good, focused fix. The README and RFC-005 examples now match the real flags (archive -t ipfs -t arweave, recover <ref> --tier --output), and the unknown-tier case is caught with a clean message that lists the available tiers instead of a traceback. Removing local from the docs rather than half-wiring it was the right minimal call, and it is consistent everywhere.
One thing to finish it: the same broken example still lives in docs/cli-reference.md:1304:
soul archive .soul/ --tiers ipfs arweave
That is the exact bug from the issue (with multiple=True, Click takes only ipfs and errors on arweave), and cli-reference is the doc people copy from most. One line: soul archive .soul/ -t ipfs -t arweave.
Optional, non-blocking: the archive-failed path prints the error but returns exit 0, so a script would not detect the failure. It matches the existing recover behavior, so it is not a regression, but a raise SystemExit(1) on both would make failures scriptable. And an (#286) Updated header line on main.py and the new test file, per convention.
Tight PR otherwise.
prakashUXtech
left a comment
There was a problem hiding this comment.
The blocker is fixed: the broken soul archive .soul/ --tiers ipfs arweave example in cli-reference is corrected to the repeated-flag form, and I swept the whole tree (docs, README, rfc, scripts) to confirm no broken --tiers a b or --source example survives anywhere. The optional asks are done too: the archive-failed path now does raise SystemExit(1) so failures are scriptable, and the (#286) header lines are on both files.
One thing to fix before merge, introduced by this push rather than the original work: adding the (#286) header line to cli/main.py also deleted eight earlier # Updated: entries (#231, #192, #142, #191, #203, #201, #189, #160), about 50 lines of changelog history. I diffed against dev to be sure. It's non-functional and CI can't see it, but it erases other people's entries, so please restore those eight and just prepend your #286 line above them. Everything from #42 down is still intact.
Non-blocking: a one-line test asserting the documented -t ipfs -t arweave two-flag form works would round it out, since the new test only covers the single-flag and failure cases. Otherwise this is clean.
Resolves #286
Description
The eternal storage CLI examples in README.md and RFC-005 contained three bugs that caused errors when copy-pasted by new users.
Bugs Fixed
--source→--tier:soul recoveruses--tier, not--source. It also takes a positional reference hash (not a.soulpath) and requires--output.--tiers local,ipfs→-t ipfs -t arweave: Click'smultiple=Truerequires repeated flags, not comma-separated values. Additionally, nolocalprovider is registered — onlyipfs,arweave, andblockchainexist.ValueErrortraceback: Whenarchiveis called with an unknown tier,EternalStorageManager.archive()raisesValueError. The CLI now catches this and prints a clean error message instead of a raw traceback.Changes
README.mdrfc/RFC-005-ETERNAL-STORAGE-PROVIDER.mdsrc/soul_protocol/cli/main.pytry/except ValueErrorinarchivecommandtests/test_eternal/test_cli_eternal.pytest_archive_unknown_tier(clean error, no traceback)Verification
test_cli_eternal.py)