Skip to content

fix(#286): correct eternal storage CLI examples and catch unknown-tie…#301

Open
sshekhar563 wants to merge 3 commits into
qbtrix:devfrom
sshekhar563:fix/issue-286-eternal-storage-docs
Open

fix(#286): correct eternal storage CLI examples and catch unknown-tie…#301
sshekhar563 wants to merge 3 commits into
qbtrix:devfrom
sshekhar563:fix/issue-286-eternal-storage-docs

Conversation

@sshekhar563

Copy link
Copy Markdown
Collaborator

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

  1. --source--tier: soul recover uses --tier, not --source. It also takes a positional reference hash (not a .soul path) and requires --output.
  2. --tiers local,ipfs-t ipfs -t arweave: Click's multiple=True requires repeated flags, not comma-separated values. Additionally, no local provider is registered — only ipfs, arweave, and blockchain exist.
  3. Unhandled ValueError traceback: When archive is called with an unknown tier, EternalStorageManager.archive() raises ValueError. The CLI now catches this and prints a clean error message instead of a raw traceback.

Changes

File Change
README.md Fixed eternal storage CLI examples
rfc/RFC-005-ETERNAL-STORAGE-PROVIDER.md Same fix
src/soul_protocol/cli/main.py Added try/except ValueError in archive command
tests/test_eternal/test_cli_eternal.py Added test_archive_unknown_tier (clean error, no traceback)

Verification

  • All 5 eternal storage CLI tests pass (test_cli_eternal.py)
  • Ruff format and lint clean on all changed files

@prakashUXtech prakashUXtech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prakashUXtech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants