Skip to content

fix(runtime): expose all autocli services, not just the last - #26820

Open
riba2534 wants to merge 1 commit into
cosmos:mainfrom
riba2534:fix/autocli-multi-service-26469
Open

riba2534 wants to merge 1 commit into
cosmos:mainfrom
riba2534:fix/autocli-multi-service-26469

Conversation

@riba2534

Copy link
Copy Markdown
Contributor

Description

Fixes #26469

autocliServiceRegistrar stored a single serviceName and overwrote it on every RegisterService call. A module that registers more than one msg or query service therefore had all but the last service silently dropped from the AutoCLI command tree.

The ServiceCommandDescriptor proto already supports this: service may be left empty when sub_commands are used for modules with multiple tx/query services. This wires the registrar up to that support.

Change

  • Accumulate every registered service name instead of keeping only the last.
  • Build the descriptor via newServiceCommandDescriptor: first service stays primary (single-service modules unchanged); additional services become sub-commands keyed by lowercased short name, falling back to the fully qualified name on collision.

Testing

go test ./runtime/services/
ok  github.com/cosmos/cosmos-sdk/runtime/services

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.02%. Comparing base (8f265eb) to head (a38dfe3).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #26820      +/-   ##
==========================================
+ Coverage   64.97%   65.02%   +0.04%     
==========================================
  Files         785      785              
  Lines       55413    55425      +12     
==========================================
+ Hits        36007    36038      +31     
+ Misses      19406    19387      -19     
Files with missing lines Coverage Δ
runtime/services/autocli.go 68.65% <100.00%> (+21.38%) ⬆️

... and 5 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

autocli: multi-service modules silently expose only the last registered service

1 participant