cli: migrate device, interface, link, and topology verbs to async#3787
Merged
Conversation
a5cf590 to
d39c02e
Compare
7146659 to
a0a4b34
Compare
8867305 to
cba3a76
Compare
a0a4b34 to
03dd64b
Compare
cba3a76 to
7f7b7d8
Compare
03dd64b to
9a9618b
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
Flip all 11 device and device interface verbs (device create, update, list, get, delete, set-health plus interface create, update, list, get, delete) and all 14 link and topology verbs (link accept, delete, wan-create, dzx-create, get, latency, list, set-health, update plus topology assign-node-segments, clear, create, delete, list) to the RFC-20 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. Test files gain a per-file block_on shim and cli_context_default_for_tests() import so the existing sync #[test] bodies drive the now-async execute. The doublezero binary, admin, and the serviceability dispatcher all forward ctx and await every device, interface, link, and topology arm. All 345 unit tests pass byte- identically (92 in the migrated modules: device 46, link 29, topology 17). Helper adoption lands opportunistically in follow-up PRs; the --wait polling flow needs special handling there.
…ogy verb 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.
9a9618b to
5026122
Compare
juan-malbeclabs
added a commit
that referenced
this pull request
May 29, 2026
…to async (#3789) ## Summary - Flip the 5 \`multicastgroup\` CRUD verbs, 6 \`multicastgroup allowlist\` verbs (publisher + subscriber \`add\`/\`list\`/\`remove\`), 6 foundation/QA \`allowlist\` verbs, 8 \`user\` verbs (\`create\`, \`create-subscribe\`, \`subscribe\`, \`request-ban\`, \`update\`, \`list\`, \`get\`, \`delete\`), and 9 \`globalconfig\` verbs / sub-tree verbs (\`get\`, \`set\`, \`set-version\`, \`airdrop\`, \`authority\`, \`feature-flags\`) to the RFC-20 \`pub async fn execute(self, ctx, client, out)\` signature. - \`MulticastGroupCommands::execute\` itself flips from sync to async and propagates \`ctx\` through its nested allowlist arms; the binary's \`Multicast\` arm becomes \`args.command.execute(&ctx, &client, &mut handle).await\` (single line). - Signature-only sweep. Verb bodies (\`--wait\` polling in \`user create-subscribe\`/\`subscribe\`, the bespoke \`multicastgroup update\` re-fetch flow, all requirement checks, all output) are unchanged. - Test files gain the per-file \`block_on\` shim and \`cli_context_default_for_tests()\` import. - Forward \`&ctx\` and \`.await\` every multicastgroup, allowlist, user, and globalconfig arm in the serviceability dispatcher, the \`doublezero\` binary, and \`controlplane/doublezero-admin\`. **Stacked on top of [#3787](#3787) → ... → [#3782](#3782 Review and merge in order; this is the last PR in the sequence — after it merges, **every** serviceability verb is on the RFC-20 \`async fn execute(self, ctx, client, out)\` contract. 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. - \`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 everywhere.
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 #3786 → #3785 → #3784 → #3783 → #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.
Testing Verification