Frun1na opened a new pull request, #6508:
URL: https://github.com/apache/rocketmq-dashboard/pull/6508
### Which Issue(s) This PR Fixes
- Fixes #6504
### Brief Description
The message trace diagnostics panel lists at most eight findings and did not
say that it truncates them,
although the health score and the panel status are computed from every
finding
(`web/src/utils/messageTraceDiagnostics.ts`). A trace with more than eight
findings therefore showed a
penalised score whose remaining findings were invisible
(`web/src/pages/instance/message.tsx:194`).
#4900 made the panel's badge follow the critical findings instead of the
wire status; the health score beside
it is still computed from every finding (`calculateScore`), so the ones the
tag row drops have to be disclosed.
The tag row now ends with a `+N` tag for the findings it does not show — the
same disclosure the topic page's
route diagnostics already use (`renderRouteIssueTags` in
`web/src/pages/instance/topic.tsx:894`).
User-visible change: when a trace has more than eight findings, the panel
states how many it does not list.
No user-facing copy is added.
Not addressed here: `recommendationCodes.slice(0, 4)` in the same panel caps
a secondary list of the same
kind; a bare `+N` line reads poorly there, so it is left for a follow-up if
the maintainers want it.
### How Did You Test This Change?
```
$ cd web && npx eslint
src/pages/instance/__tests__/MessagePageAsyncState.test.tsx
src/pages/instance/message.tsx
# clean
$ cd web && npx prettier --check
src/pages/instance/__tests__/MessagePageAsyncState.test.tsx
src/pages/instance/message.tsx
# clean
$ cd web && npx vitest run
src/pages/instance/__tests__/MessagePageAsyncState.test.tsx --maxWorkers=1
--fileParallelism=false
✓ src/pages/instance/__tests__/MessagePageAsyncState.test.tsx (24 tests)
20.92s
✓ says how many trace findings the diagnostics panel does not tag
Test Files 1 passed (1)
Tests 24 passed (24)
$ cd web && npx vitest run src/pages/instance/__tests__/MessagePage.test.tsx
--maxWorkers=1 --fileParallelism=false
Test Files 1 passed (1)
Tests 26 passed (26)
$ cd web && npx tsc -b
# clean
```
The new test fails without the fix (this is the mutation check: the two
lines that add the `+N` tag are
reverted, the test is kept):
```
$ cd web && npx vitest run
src/pages/instance/__tests__/MessagePageAsyncState.test.tsx --maxWorkers=1
--fileParallelism=false
FAIL src/pages/instance/__tests__/MessagePageAsyncState.test.tsx >
MessagePage async request ownership > says how many trace findings the
diagnostics panel does not tag
TestingLibraryElementError: Unable to find an element with the text: +1.
Test Files 1 failed (1)
Tests 1 failed | 23 passed (24)
```
The test builds a trace with nine failing stages at one instant plus one
successful delivery, which produces
exactly nine findings, so the eight tags leave one out. The assertion is
scoped to the diagnostics alert and
matches the rendered `+1` tag, which only exists after the change.
### 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]