Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for storing a “default tenant” in CLI config and using it as the implicit tenant filter unless explicitly overridden.
Changes:
- Add
tenantto persistedClientConfigand expose it viaconfig get/set. - Add
--tenant/--no-tenantbehavior to user listing (and default to config tenant when unspecified). - Use config tenant as a fallback during provisioning/connect flow.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| smartcontract/sdk/rs/src/config.rs | Add tenant to config model and adjust config path resolution behavior. |
| smartcontract/cli/src/user/list.rs | Add --no-tenant and default tenant-from-config filtering logic + test. |
| smartcontract/cli/src/config/set.rs | Allow setting/clearing default tenant and display it in output + tests. |
| smartcontract/cli/src/config/get.rs | Display configured default tenant in config get output. |
| client/doublezero/src/command/connect.rs | Fall back to config tenant when CLI tenant isn’t provided. |
| CHANGELOG.md | Document default tenant support addition. |
Comments suppressed due to low confidence (2)
smartcontract/cli/src/config/set.rs:1
unwrap_or(...)here consumesconfig.websocket_url,config.program_id, andconfig.tenant(moves them out ofconfig). It works today becauseconfigisn’t used afterwards, but it’s brittle and makes future edits error-prone. Prefer formatting without moving fields (e.g.,as_deref()/as_ref()+unwrap_or(...), orclone().unwrap_or_else(...)), and useunwrap_or_else/as_derefto avoid allocating\"(not set)\"each time.
use crate::doublezerocommand::CliCommand;
smartcontract/cli/src/config/get.rs:1
- Same issue as
config set: formatting viaunwrap_or(...)moves values out ofconfigand allocates a new String for\"(not set)\". Preferas_deref()/as_ref()+unwrap_or(...)(orunwrap_or_else) to keepconfigintact and avoid unnecessary allocations.
use crate::doublezerocommand::CliCommand;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a persistent `tenant` field to the CLI config so users don't need to specify --tenant on every command. The config tenant is used as a fallback when no tenant is provided via CLI args in `connect` and `user list`.
ad8a015 to
b9e19ef
Compare
vihu
approved these changes
Feb 10, 2026
ben-dz
pushed a commit
that referenced
this pull request
Feb 10, 2026
## Summary of Changes * Adds the ability to set a default tenant in config * `doublezero config set --tenant XXX` * `doublezero config set --no-tenant` ## Testing Verification * new unit tests --------- Co-authored-by: Juan Olveira <juan@malbeclabs.com>
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 of Changes
doublezero config set --tenant XXXdoublezero config set --no-tenantTesting Verification