feat: add support for the --all to proxy remove#834
Open
eureka928 wants to merge 10 commits intoopentensor:stagingfrom
Open
feat: add support for the --all to proxy remove#834eureka928 wants to merge 10 commits intoopentensor:stagingfrom
--all to proxy remove#834eureka928 wants to merge 10 commits intoopentensor:stagingfrom
Conversation
…d error on conflicting args
--all to proxy remove
Contributor
Author
|
Hi @thewhaleking would you review my PR? |
f576009 to
874e5e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactor of #791, addressing reviewer feedback from @thewhaleking.
This PR adds the
--allflag tobtcli proxy removeso users can remove all proxies in a single operation. The two review comments on #791 have been addressed:--delegatetogether with--allnow returns an error instead of silently ignoring the delegate.remove_proxies()function has been merged into the existingremove_proxy()function using aremove_all: bool = Falseparameter, reducing code duplication.Type of change
What's changed
CLI validation flow
Usage
```bash
Remove a single proxy
btcli proxy remove --delegate 5GDel... --proxy-type Transfer --delay 0
Remove all proxies (requires typing "REMOVE" to confirm)
btcli proxy remove --all
Remove all proxies without prompt
btcli proxy remove --all --no-prompt
```
Testing
Unit tests
```
$ pytest tests/unit_tests/test_cli.py -v -k proxy
tests/unit_tests/test_cli.py::test_proxy_remove_requires_delegate_or_all PASSED
tests/unit_tests/test_cli.py::test_proxy_remove_requires_delegate_or_all_json PASSED
tests/unit_tests/test_cli.py::test_proxy_remove_with_all_and_delegate_errors PASSED
tests/unit_tests/test_cli.py::test_proxy_remove_with_all_flag PASSED
tests/unit_tests/test_cli.py::test_proxy_remove_with_delegate_calls_remove_proxy PASSED
```
Lint
```
$ ruff format --check bittensor_cli tests
All checks passed!
```
Checklist
--allto proxy remove #791 addressedContribution by Gittensor, learn more at https://gittensor.io/