Skip to content

feat: add support for the --all to proxy remove#834

Merged
thewhaleking merged 12 commits intoopentensor:stagingfrom
eureka928:feat/proxy-remove-all-v2
Mar 19, 2026
Merged

feat: add support for the --all to proxy remove#834
thewhaleking merged 12 commits intoopentensor:stagingfrom
eureka928:feat/proxy-remove-all-v2

Conversation

@eureka928
Copy link
Contributor

@eureka928 eureka928 commented Feb 23, 2026

Summary

Refactor of #791, addressing reviewer feedback from @thewhaleking.

This PR adds the --all flag to btcli proxy remove so users can remove all proxies in a single operation. The two review comments on #791 have been addressed:

  1. Error on conflicting args instead of warning (comment): Providing --delegate together with --all now returns an error instead of silently ignoring the delegate.
  2. Combine into single function with a flag (comment): The separate remove_proxies() function has been merged into the existing remove_proxy() function using a remove_all: bool = False parameter, reducing code duplication.

Type of change

  • New feature (non-breaking)
  • Refactor (addresses code review feedback)

What's changed

File Change
`bittensor_cli/cli.py` Added `--all` flag to `proxy_remove` command; validation rejects conflicting `--delegate` + `--all`; routes `remove_all` flag to the unified function
`bittensor_cli/src/commands/proxy.py` Combined `remove_proxies()` into `remove_proxy()` with `remove_all` flag; branches prompt, call composition, and extrinsic based on the flag
`tests/e2e_tests/test_proxy.py` E2E tests: remove all proxies, validation errors, single proxy removal
`tests/unit_tests/test_cli.py` Unit tests: missing args error, conflicting args error, `--all` flag routing, single delegate routing

CLI validation flow

  1. Neither `--delegate` nor `--all` provided → error
  2. Both `--delegate` and `--all` provided → error
  3. `--all` only → calls `remove_proxy(..., remove_all=True)`
  4. `--delegate` only → calls `remove_proxy(..., remove_all=False)`

Usage

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

Contribution by Gittensor, learn more at https://gittensor.io/

@eureka928 eureka928 changed the title refactor: combine remove_proxies into remove_proxy with remove_all flag feat: add support for the --all to proxy remove Feb 23, 2026
@eureka928
Copy link
Contributor Author

Hi @thewhaleking would you review my PR?
Thank you

@eureka928 eureka928 force-pushed the feat/proxy-remove-all-v2 branch from f576009 to 874e5e6 Compare February 23, 2026 15:45
@thewhaleking thewhaleking requested a review from a team February 23, 2026 15:51
thewhaleking
thewhaleking previously approved these changes Mar 19, 2026
@eureka928
Copy link
Contributor Author

@thewhaleking thank you for you review and time

@eureka928
Copy link
Contributor Author

Passed all CI and ready to merge 😉

@thewhaleking
Copy link
Contributor

Sorry @eureka928 ,
We actually now require all commits to be GPG signed before we can merge.

@eureka928 eureka928 force-pushed the feat/proxy-remove-all-v2 branch from 3056d50 to ff85629 Compare March 19, 2026 13:28
@eureka928 eureka928 force-pushed the feat/proxy-remove-all-v2 branch from ff85629 to 2a6174b Compare March 19, 2026 13:29
@eureka928
Copy link
Contributor Author

Sorry @eureka928 , We actually now require all commits to be GPG signed before we can merge.

Signed and pushed again

@thewhaleking thewhaleking merged commit aead6a6 into opentensor:staging Mar 19, 2026
88 checks passed
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