Skip to content

fix: rewrite canister settings show to only output settings#499

Merged
lwshang merged 4 commits intomainfrom
lwshang/SDK-2666_settings_show_only
Apr 13, 2026
Merged

fix: rewrite canister settings show to only output settings#499
lwshang merged 4 commits intomainfrom
lwshang/SDK-2666_settings_show_only

Conversation

@lwshang
Copy link
Copy Markdown
Contributor

@lwshang lwshang commented Apr 13, 2026

Summary

  • icp canister settings show previously output a full canister status header (canister ID, module hash, status, memory size, cycles) in addition to the settings fields, which was inconsistent with the command name
  • Rewrote the command to query canister_status but display only the settings portion of the response
  • Added --json flag to output settings as JSON

Test plan

  • cargo test -p icp-cli --test canister_settings_tests -- canister_settings_show
  • cargo test -p icp-cli --test canister_settings_tests (full suite)

🤖 Generated with Claude Code

lwshang and others added 4 commits April 13, 2026 11:14
Previously the command delegated entirely to `canister status`, which
fell back to public state-tree data when the caller was not a controller
and showed the full status result. The command now calls
`canister_status` directly, errors on non-controller callers, and
outputs only the settings fields using `DefiniteCanisterSettings`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r all settings fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lwshang lwshang marked this pull request as ready for review April 13, 2026 15:54
@lwshang lwshang requested a review from a team as a code owner April 13, 2026 15:54
@lwshang lwshang merged commit 240e8dd into main Apr 13, 2026
93 checks passed
@lwshang lwshang deleted the lwshang/SDK-2666_settings_show_only branch April 13, 2026 16:06
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