Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds w3 rm <root-cid> cmd #20

Merged
merged 12 commits into from
Dec 16, 2022
Merged

feat: adds w3 rm <root-cid> cmd #20

merged 12 commits into from
Dec 16, 2022

Conversation

olizilla
Copy link
Contributor

@olizilla olizilla commented Dec 12, 2022

without --shards, w3 rm behaves like rm and silently removes the thing or errors.

$ w3 rm bafybeidpouz7j6to2p7ps4j262ii32ov5wnp3rj4slavvsm4dfvonvrc6q

with --shards, as there might be many, we print each one with a spinner as we delete them

$ ❯ w3 rm bafybeib5bn5onczh4n2qb25wqjvyemj6mwk6oshwiaibcef2testdboqra --shards
⁂ removing 4 shards
✔ bagbaieraxwxthv7ntlucs2lpghxv7wsrvoyca4gtna2ny4tg7mlkquqef7aq removed
✔ bagbaierawqhk2jn2qwzdm5ajdevwp2t5kari6d6qok7iu2jyfm6kndndemla removed
✔ bagbaierarihlji6ep47f42fv46atov4vh7kyhledn5shif5zwbpszsk3kltq removed
✔ bagbaieraz2bfnvj6rooqpjny2j3xjeqp2otndee5oylxl6jmdll7ydxa5lwq removed

License: MIT
Signed-off-by: Oli Evans oli@protocol.ai

WIP. needs update to `upload-api` to return the removed item so we may use it to identify the shards that need removing.

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
olizilla added a commit to storacha/w3infra that referenced this pull request Dec 12, 2022
Allows a caller to optionally call store/remove with the shards to
completely remove a thing.

Needed by storacha/w3cli#20

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
olizilla added a commit to storacha/w3up that referenced this pull request Dec 13, 2022
needed by storacha/w3cli#20 to find which shards to also remove when removing an upload

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
olizilla added a commit to storacha/w3up that referenced this pull request Dec 13, 2022
needed by storacha/w3cli#20 to find which
shards to also remove when removing an upload

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
@heyjay44 heyjay44 mentioned this pull request Dec 14, 2022
51 tasks
without `--shards`, `w3 rm` behaves like rm and silently removes the thing or errors.

```sh
$ w3 rm bafybeidpouz7j6to2p7ps4j262ii32ov5wnp3rj4slavvsm4dfvonvrc6q

```

with `--shards`, as there might be many, we print each one with a spinner as we delete them

```sh
$ ❯ w3 rm bafybeib5bn5onczh4n2qb25wqjvyemj6mwk6oshwiaibcef2testdboqra --shards
⁂ removing 4 shards
✔ bagbaieraxwxthv7ntlucs2lpghxv7wsrvoyca4gtna2ny4tg7mlkquqef7aq removed
✔ bagbaierawqhk2jn2qwzdm5ajdevwp2t5kari6d6qok7iu2jyfm6kndndemla removed
✔ bagbaierarihlji6ep47f42fv46atov4vh7kyhledn5shif5zwbpszsk3kltq removed
✔ bagbaieraz2bfnvj6rooqpjny2j3xjeqp2otndee5oylxl6jmdll7ydxa5lwq removed
```

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
@olizilla olizilla marked this pull request as ready for review December 15, 2022 14:52
License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
@olizilla
Copy link
Contributor Author

@alanshaw I think this is good enough to land. will want to iterate on it, and add json output later.

@olizilla
Copy link
Contributor Author

er, once i appease the lint

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
index.js Show resolved Hide resolved
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
@olizilla olizilla merged commit 899a4d4 into main Dec 16, 2022
@olizilla olizilla deleted the rm branch December 16, 2022 12:31
alanshaw pushed a commit that referenced this pull request Jan 11, 2023
🤖 I have created a release *beep* *boop*
---


##
[1.1.0](v1.0.1...v1.1.0)
(2023-01-11)


### Features

* add support for sharded CAR uploads
([#36](#36))
([b055c78](b055c78))
* adds `w3 rm &lt;root-cid&gt;` cmd
([#20](#20))
([899a4d4](899a4d4))


### Bug Fixes

* remove warnings using shebang
([#33](#33))
([f3a1aac](f3a1aac))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
gobengo pushed a commit to storacha/w3up that referenced this pull request Apr 11, 2023
needed by storacha/w3cli#20 to find which
shards to also remove when removing an upload

License: MIT
Signed-off-by: Oli Evans <oli@protocol.ai>
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