fix(cli): include room description in debug config output#375
Merged
Conversation
`riverctl debug config` (the command literally named "Show room
configuration") printed the room name and every limit but silently
dropped the description. The only way to see a room's description from
the CLI was `riverctl room config <OWNER>` with no flags, which is
non-obvious. Ian noticed the gap while fixing the Freenet Official room
description.
Add `description: Option<String>` to the `RoomConfig` view, populated via
a new testable `RoomConfig::from_configuration` constructor, and print it
in both the human and JSON branches ("(none)" / `null` when unset). The
description is rendered lossily and not unsealed for private rooms,
matching the existing no-flags `room config` display.
Regression tests pin that the description survives both the struct and
the JSON projection, and that an unset description serializes as null.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmZ2TuM1ofhLTndJ1AUnMH
518097c to
6e443e9
Compare
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.
Problem
riverctl debug config <OWNER>— the command literally named "Show room configuration" — printed the room name and every limit but silently dropped the description. The only way to see a room's description from the CLI wasriverctl room config <OWNER>with no flags, which is non-obvious. Ian hit this gap while fixing the Freenet Official room's description (a broken Dashboard link in the room header).Approach
Add
description: Option<String>to theRoomConfigview and print it in both the human and JSON branches ofdebug config("(none)" /nullwhen unset).The construction is extracted into a small testable
RoomConfig::from_configurationconstructor (previously an inline struct literal in the handler). The description is rendered lossily and not unsealed for private rooms — this matches the existing no-flagsroom configdisplay and keepsdebug configa pure read-only view.Scope kept deliberately narrow: only
debug configis touched.debug room-stateremains a counts summary.Testing
room_config_includes_description— pins that a set description survives both the struct and the JSON projection.room_config_description_none_when_unset— pins that an unset description serializes asnull(and renders "(none)" viaunwrap_or).cargo test -p riverctl --lib debug::green (4 passed).cargo clippy -p riverctlclean.debug configanddebug config -f jsonnow show the description.[AI-assisted - Claude]