Wang1rrr opened a new pull request, #4779:
URL: https://github.com/apache/rocketmq-dashboard/pull/4779
### Which Issue(s) This PR Fixes
Fixes #4778
### Brief Description
Both `rmqctl message query` and `message query-by-topic` already receive
`resultMayBeTruncated` and `skippedCount`, but their nonempty table renderer
drops
those fields. Identical rows therefore look the same whether the result is
complete or provider/limit-bounded.
After successfully writing the existing table, emit a warning to stderr only
for
these two tools when `resultMayBeTruncated` is the boolean `true`. Include
`skippedCount` with its bounded meaning: rows omitted by the requested limit
from
the provider-bounded result, not the total number of messages missing from
the
broker. Warn even when the count is zero.
Table stdout remains byte-for-byte unchanged. JSON/YAML, the empty-table JSON
fallback, other tools and mutation summaries remain unchanged. Writer errors
are
propagated. No extra request, API/schema/flag change or dependency is
introduced.
Compatibility: a successful partial table query now has nonempty stderr while
still exiting 0. Scripts that equate any stderr with failure will observe the
warning. This is an output repair, not a change to server truncation
detection.
### How Did You Test This Change?
Windows amd64, Go 1.27.1, existing locked dependencies, isolated LF checkout.
The tests invoke the real CLI command path against a synthetic HTTP server:
- Two commands x three formats x four states: limit-truncated,
provider-bounded
with skippedCount=0, complete, and empty. Fixed expected table bytes and
structured payloads are checked, as is exactly one request.
- Other table and mutation output controls, stdout/stderr write failures, and
exact tool/boolean warning scope.
- Red/green: the unchanged renderer failed four missing-warning assertions;
the repaired renderer passes. The two command fixtures explicitly use
limit=1.
Verification from `rmqctl/`:
```text
gofmt -l . (no output)
go run ./internal/catalog/generate -input-dir
../server/src/main/resources/tool-catalog/tools -output
internal/catalog/catalog_gen.go -check
go test -count=1 ./...
go test -race -count=1 ./...
go vet ./...
go build .
```
All passed (test/build commands used `-p 2`). All six Makefile build-all
target
pairs also cross-compiled with CGO_ENABLED=0: darwin, linux and windows,
each on
amd64 and arm64. Cross-compilation is not a claim of execution on those
targets.
An independent process-level comparison ran the unchanged baseline and fixed
CLI against the same 14 synthetic loopback cases each. All 28 commands
succeeded;
all 14 stdout results were identical; only the four nonempty partial table
cases
on the fixed CLI emitted warnings. Request signing and structured payloads
were
also checked.
Independently reviewed, including a follow-up correction to fixture limit
consistency. Prepared with AI assistance. No live Java/Broker E2E, backend or
frontend suite was run for this Go-only change; remote CI is not claimed
here.
### Checklist
- [x] One coherent, issue-linked fix on rocketmq-studio
- [x] Regression tests observed failing before the production change
- [x] No new dependencies, generated catalog changes or unrelated refactoring
- [x] ASF header on the new test source; test names use the requested Test
suffix
- [x] Relevant local format/catalog/vet/test/race/build checks and
independent review
- [ ] Live backend/Broker E2E (not run)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]