cli: migrate accesspass, resource, and leaf verbs to async#3786
Merged
Conversation
a5cf590 to
d39c02e
Compare
9041a53 to
34ba4d8
Compare
d39c02e to
8867305
Compare
5ebd7de to
24012de
Compare
8867305 to
cba3a76
Compare
24012de to
f24a7ec
Compare
cba3a76 to
7f7b7d8
Compare
ben-dz
approved these changes
May 29, 2026
Flip all six accesspass verbs (set, close, list, get, user-balances, fund), all six resource verbs (allocate, create, deallocate, get, close, verify), and the eight leaf single-file verbs (address, balance, init, migrate, keygen, export, config get, config set) to the RFC-20 async fn execute(self, ctx, client, out) signature. The five small leaf verbs (address, balance, init, migrate, keygen) adopt require! and print_signature where applicable. The larger and more idiosyncratic verbs (config get/set, export, all accesspass and resource verbs) keep their existing bodies for now and only get the signature flip; helper adoption lands opportunistically in follow-ups. accesspass fund's bespoke R: BufRead signature is preserved; the _ctx parameter is inserted after self. config get/set tests gain a per-file block_on shim so the existing sync #[test] bodies can still drive the now-async execute. The doublezero binary, admin, and the serviceability dispatcher all forward ctx and await every accesspass, resource, and leaf arm. All 345 unit tests pass byte-identically.
…erb tests Drop the per-verb local block_on copies in favor of the doublezero_cli_core::testing::block_on helper lifted in the location PR, matching the location reference verb.
7f7b7d8 to
7b4c9bc
Compare
juan-malbeclabs
added a commit
that referenced
this pull request
May 29, 2026
) ## Summary - Flip all 11 \`device\` and \`device interface\` verbs and all 14 \`link\` and \`topology\` verbs to the RFC-20 \`pub async fn execute(self, ctx, client, out)\` signature. - Signature-only sweep. Verb bodies (including \`--wait\` polling via \`poll_for_*_activated\`, per-verb requirement checks, and \`Signature:\` writes) are unchanged. Helper adoption (\`require!\`, \`render_collection\`, \`render_record\`, \`print_signature\`) lands opportunistically in follow-ups; the \`--wait\` polling flow needs special handling there. - Test files gain a per-file \`block_on\` shim and \`cli_context_default_for_tests()\` import so the existing sync \`#[test]\` bodies can drive the now-async \`execute\`. - Forward \`&ctx\` and \`.await\` every device, interface, link, and topology arm in the serviceability dispatcher, the \`doublezero\` binary, and \`controlplane/doublezero-admin\`. **Stacked on top of [#3786](#3786) → [#3785](#3785) → [#3784](#3784) → [#3783](#3783) → [#3782](#3782 Review and merge in order. Note on size: this PR is mechanical sweep across 29 files (~700 LOC of net new code, mostly per-file \`block_on\` shims). It exceeds the usual 500-LOC budget because bundling these resources cuts down the PR count, per the project's preference for fewer, related PRs. Related RFC: [RFC-20 CLI standardization](https://github.com/malbeclabs/doublezero/blob/main/rfcs/rfc20-cli-standardization.md). ## Testing Verification - All 345 unit tests in \`doublezero-serviceability-cli\` pass without assertion changes (92 in the migrated modules: device 46, link 29, topology 17). - \`make rust-lint\` clean across all 9 clippy invocations with \`-Dclippy::all -Dwarnings\`. - \`cargo build -p doublezero -p doublezero-admin\` clean — the binary and admin dispatchers compile against the new async signatures.
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
Stacked on top of #3785 → #3784 → #3783 → #3782. Review and merge in order.
Related RFC: RFC-20 CLI standardization.
Testing Verification