Skip to content

fix(sdk/cli): restore documented node status / epoch info commands - #8576

Open
Limm-web wants to merge 1 commit into
Scottcjn:mainfrom
Limm-web:fix/sdk-cli-node-epoch-grammar
Open

Limm-web wants to merge 1 commit into
Scottcjn:mainfrom
Limm-web:fix/sdk-cli-node-epoch-grammar

Conversation

@Limm-web

@Limm-web Limm-web commented Oct 4, 2026

Copy link
Copy Markdown

What Changed

The README (sdk/python/README.md:72-76) and the CLI's own usage header advertise rustchain node status and rustchain epoch info, but node and epoch were leaf commands with no positional arguments, so both documented forms exited 2 with Got unexpected extra argument.

  • sdk/python/rustchain_sdk/cli.py: turn node and epoch into click.group(invoke_without_command=True) with a single status / info subcommand.
  • Both the bare form (rustchain node, rustchain epoch) and the documented subcommand (rustchain node status, rustchain epoch info) now parse and run the same code path — existing scripts keep working, no compatibility shim needed.

Testing / Evidence

New regression test sdk/python/rustchain_sdk/tests/test_cli_grammar.py::TestNodeAndEpochGrammar (real CLI; only node/epoch seams are recording fakes).

# before (pinned source c3da95d):
node status -> exit 2  "Got unexpected extra argument (status)"
epoch info  -> exit 2  "Got unexpected extra argument (info)"
# after: all four exit 0 and reach the callback
node / node status / epoch / epoch info

Verified against the live node: rustchain node status → version 2.2.1-rip200, ok True; rustchain epoch info → epoch 305, enrolled_miners 14.

Full SDK suite: 105 passed (was 101; +4 new, no regressions).

BCOS Checklist (Required For Non-Doc PRs)

  • Tier label added: BCOS-L1
  • New code files include SPDX header
  • Test evidence provided above

Fixes #8565


AI assistance disclosure: this fix, its regression test, and the report above were prepared with AI assistance; all claims were reproduced locally against the pinned source before submission.

Wallet: RTC472c6fdc74ed1d43b5c80349c32d5399e7dca92f

The README and the CLI's own usage header advertise `rustchain node status`
and `rustchain epoch info`, but `node` and `epoch` were leaf commands with no
positional arguments, so both documented forms exited 2 with "Got unexpected
extra argument".

Turn `node` and `epoch` into groups with invoke_without_command=True and a
single `status` / `info` subcommand. Both the bare form (`rustchain node`,
`rustchain epoch`) and the documented subcommand now parse and run the same
code path, so existing scripts keep working.

Fixes Scottcjn#8565

Test: test_cli_grammar.py::TestNodeAndEpochGrammar (bare + subcommand for both).
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/M PR: 51-200 lines labels Oct 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python SDK README node status and epoch info commands fail in Click parser

1 participant