Frun1na opened a new pull request, #6133:
URL: https://github.com/apache/rocketmq-dashboard/pull/6133
### Which Issue(s) This PR Fixes
- Fixes #6132
### Brief Description
`AliyunConverters.toTopicVO` (`:119-131`) sets `writeQueues` and
`readQueues` to 0 because the
Aliyun `ListTopics`/`GetTopic` models carry no queue counts, and the zeros
travelled as measurements:
the detail drawer showed 0 for both, the CSV exports printed 0, the topic
comparison reported
`writeQueues: 8 -> 0` drift for every topic of a cloud instance, and the
rebuild/sync actions wrote
the placeholders back to the broker.
`TopicVO` now carries `queueCountsAvailable` (default `true`, `false` in the
Aliyun converter), the
same way `BrokerVO.runtimeStatsAvailable` and
`TopicConsumerVO.metricsAvailable` already mark values
a provider could not read:
- the topic detail drawer renders 写队列数 / 读队列数 as `-` when the flag is false;
- both topic CSV exports leave those cells empty instead of exporting the
placeholder;
- `compareTopicInventories` skips `writeQueues`/`readQueues` unless both
sides measured them, so a
cloud instance no longer produces false drift rows (and the Drift column
means something again);
- the rebuild/sync actions omit the two counts for such a topic instead of
sending `0`;
- the two AI tool contracts forward the flag, with
`tool-catalog/tools/topic.yaml` and
`catalog_gen.go` regenerated, and both topic response tables in
`docs/api-spec.md` document it.
User-visible change: on an Aliyun instance the topic detail shows `-` for
the queue counts, the CSV
exports leave those cells empty, and the topic comparison no longer reports
queue drift that the
vendor never measured. Tencent and Apache topics are unaffected — both
providers set real counts.
### How Did You Test This Change?
```
cd server && mvn -B -ntp test -DforkCount=1
-Dsurefire.failIfNoSpecifiedTests=false \
-Dtest='AliyunConvertersTest,ToolOutputSchemaContractTest,TopicDetailToolHandlerTest,TopicMutationPlanTest'
Tests run: 22, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS (checkstyle: 0 violations)
make -C rmqctl catalog-verify ✓
npx eslint <the seven changed web files> ✓
npx prettier --check <the same files> ✓
npx tsc -b ✓
npx vitest run src/utils/topicConfigComparison.test.ts --maxWorkers=1
--fileParallelism=false
Tests 12 passed (1.9s)
npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx
--maxWorkers=1 --fileParallelism=false
Tests 42 passed (58.9s)
```
The three new cases fail without the fix, one per surface (each product file
was reverted on its own
with the new cases kept):
```
$ mvn -B -ntp test -Dtest=AliyunConvertersTest # AliyunConverters
restored
Tests run: 11, Failures: 1, Errors: 0, Skipped: 0
toTopicVoShouldMarkTheQueueCountsItCannotReadUnavailableTest
$ npx vitest run src/utils/topicConfigComparison.test.ts #
topicConfigComparison.ts restored
Tests 1 failed | 11 passed (12)
does not report queue drift for a vendor that carries no queue counts
$ npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx #
topic.tsx restored
Tests 1 failed | 41 passed (42)
renders the queue counts a vendor cannot measure as unknown
```
### 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
- [x] 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]