123123213weqw opened a new pull request, #4464:
URL: https://github.com/apache/rocketmq-dashboard/pull/4464
### Which Issue(s) This PR Fixes
- Fixes #4297
- Fixes #4295
### Brief Description
Three related defects on the alert surface, grouped into one change per the
"one coherent change" rule rather than three one-line pull requests:
1. **A padded stored instance id never matched its alert state** (#4297).
The scope instance id was compared with the stored value verbatim, so a rule
whose stored `instance_id` carries padding fires but reports no active state —
the two paths disagree. The stored value is now trimmed before the comparison,
in both `MybatisPlusAlertStateRepository` and `NativeAlertProcessor` so the
lookup and the firing path stay in step.
2. **Maintenance windows were listed with the raw UTC API string** (#4295)
instead of the times the operator entered, which is what made the list
unreadable. The boundaries are now rendered as instants.
3. **The notification template preview used a placeholder syntax the sender
does not accept.** A template that renders correctly when sent previewed as
broken, and the reverse. The preview now matches the syntax the delivery path
accepts.
All three are revived from branches whose pull requests were closed when
`rocketmq-studio` was folded into `master` and the base branch was deleted; the
code is otherwise unchanged from those branches, and each keeps its red/green
pair.
This touches `server/src/main/java/.../ops/alert/` and the alert pages under
`web/src`, not the alert *search* path, so it does not overlap the open
LIKE-escaping change (#4458).
### How Did You Test This Change?
```
cd server && mvn -B -ntp test
[INFO] Tests run: 2428, Failures: 0, Errors: 0, Skipped: 0
cd web && npm test
Test Files 122 passed (122)
Tests 1037 passed (1037)
cd web && npm run lint
✖ 10 problems (0 errors, 10 warnings) # all pre-existing warnings in
unrelated files
cd web && npm run build
✓ built in 17.26s
```
The 17 errors reported next to the backend run are the `@SpringBootTest`
classes that need a reachable MySQL 8; they fail identically on the untouched
baseline.
Test coverage: `MybatisPlusAlertStateRepositoryTest` gained an assertion for
the padded instance id (it fails against the untrimmed comparison),
`SystemAlertsPage.test.tsx` asserts the rendered maintenance-window boundary,
and `alertTemplatePreview.test.ts` covers the placeholder syntax.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`fix:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
— not applicable, no new UI text
- [x] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [x] New source files carry the ASF license header — no new source files
- [x] Documentation touched where behaviour changed — none of these
behaviours is documented
--
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]