[fix][cli] Correct admin command documentation generation - #26649
Merged
Merged
Conversation
Print generated documentation once, use each subcommand’s visible options and defaults, and keep option tables consistent. Reset alias tracking between invocations and cover single, multiple, and repeated generation with regression tests. Assisted-by: Codex
dao-jun
approved these changes
Sep 19, 2026
nodece
approved these changes
Sep 20, 2026
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.
Motivation
pulsar-admin documents generate brokersprints the entire growing document after each subcommand. This produces 13 progressively longer copies of the brokers documentation and repeated entries in the reference site's sidebar. Generating multiple modules also repeats earlier modules.The generator reads options from the command group instead of each subcommand, so generated reference pages omit actual command flags such as
--primary,--secondary, and--unload-scope.Modifications
Verifying this change
This change added tests and was verified locally with:
All five tests and the checks passed. The regression tests reproduced duplicate headings before the fix. Also generated all 21 admin command groups using the updated CLI: each document has one top-level heading, retains its subcommands, and has consistent option table columns. Checked the rendered brokers reference page in a local site preview.
Does this pull request potentially affect one of the following parts: