Frun1na opened a new pull request, #6106:
URL: https://github.com/apache/rocketmq-dashboard/pull/6106
### Which Issue(s) This PR Fixes
- Fixes #6105
### Brief Description
`rmq.group.detail` published `delaySeconds` at its zero default when the
provider could not measure a
delay: the provider leaves the number at `0` and records the reason in
`ConsumerGroupVO.consumptionTimestampAvailable`
(`RocketMQMetadataProvider.java:420-434`; the Tencent
and Aliyun providers never set either field, so cloud groups always carry
the default pair), and
`GroupDetailOutput` dropped the flag and mapped the number verbatim
(`contract/group/GroupDetailOutput.java:50`), so the model read "the group
is caught up" from data the
same response marks unmeasurable. The console side of the same root cause is
#5919/#5920 and is not
touched here. `delaySeconds` is now an `Integer` that is `null` - and
therefore omitted, since the
record uses `@JsonInclude(NON_NULL)` - when `consumptionTimestampAvailable`
is `false`; a measured
delay is unchanged. `tool-catalog/tools/group.yaml` drops `delaySeconds`
from the output's required
list and documents the absent case, and
`rmqctl/internal/catalog/catalog_gen.go` is regenerated from
the shard. User-visible change: the tool output no longer reports a zero
second delay for a group
whose delay cannot be measured. Sibling unknown states of the same record
keep their existing shapes
(`onlineInstances = -1`, `Progress.totalLag = -1`, `retryMaxTimes` omitted),
which is the pattern
#5091 and #5449 established for the lag and the metric availability.
### How Did You Test This Change?
```
$ mvn -B -ntp test -DforkCount=1 -Dtest=ConsumerGroupReadToolHandlersTest
[INFO] --- checkstyle:3.6.0:check (validate) @ rocketmq-studio ---
[INFO] You have 0 Checkstyle violations.
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
1.086 s -- in
org.apache.rocketmq.studio.ops.ai.tool.handler.group.ConsumerGroupReadToolHandlersTest
[INFO] BUILD SUCCESS
$ mvn -B -ntp test -DforkCount=1 -Dtest=ToolOutputSchemaContractTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.822
s -- in
org.apache.rocketmq.studio.ops.ai.tool.service.ToolOutputSchemaContractTest
$ make -C rmqctl catalog-verify # after `make -C rmqctl catalog-generate`
go run ./internal/catalog/generate -input-dir
../server/src/main/resources/tool-catalog/tools -output
internal/catalog/catalog_gen.go -check
(no output: the committed catalog matches the shard)
```
The new test fails without the fix (the product change was reverted, the
test was kept):
```
$ mvn -B -ntp test -DforkCount=1 -Dtest=ConsumerGroupReadToolHandlersTest
[ERROR] Tests run: 10, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
1.091 s <<< FAILURE! -- in
org.apache.rocketmq.studio.ops.ai.tool.handler.group.ConsumerGroupReadToolHandlersTest
...detailOmitsTheDelayWhenNoConsumedMessageTimestampIsAvailableTest -- Time
elapsed: 0.019 s <<< FAILURE!
org.opentest4j.AssertionFailedError:
Expecting value to be false but was true
```
`detailOmitsTheDelayWhenNoConsumedMessageTimestampIsAvailableTest` stubs
`consumptionTimestampAvailable
= false` with `delaySeconds = 0` and asserts the serialized tool output has
no `delaySeconds` field
(the assertion is the `detail.has("delaySeconds")` of the failure above);
`detailKeepsTheDelayWhenTheConsumedMessageTimestampIsAvailableTest` pins
that a measured delay (42)
still serializes, so the change is not an unconditional null.
CLUSTER: not applicable — reproduced with a stubbed `MetadataService` in a
unit test.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [ ] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
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]