tju-yxq opened a new pull request, #3050: URL: https://github.com/apache/rocketmq-dashboard/pull/3050
## What is the purpose of the change Native alert rule metrics are compared with raw strings in some paths and trimmed strings in others. A metric copied with surrounding whitespace could bypass native policy validation, then be filtered out by the test service's exact sample match, while notification formatting and semantic fingerprints used the non-canonical value. ## What changed - trim the metric when converting `AlertRuleRequestDTO` to the rule VO so create, update, and test requests enter validation with a canonical key - normalize metric, instance ID, and operator in `NativeAlertRuleTestService` before policy validation and sample filtering; this also handles rules copied from older stored data - trim imported metric keys before transfer-import catalog validation - add regressions for DTO normalization and end-to-end native rule testing with padded metric, instance, and operator values ## Verification - before the fix, the DTO regression returned `" consumer.lag.total "`, and the native test regression returned zero samples - focused tests: `AlertRuleRequestDTOTest,NativeAlertRuleTestServiceTest,AlertRuleTransferServiceTest,NativeAlertRulePolicyTest,NativeAlertMetricCatalogServiceTest,AlertRuleEvaluatorTest` (30 tests) passed - Checkstyle: 0 violations - full server suite: `mvn -DskipTests=false test` (1,962 tests, 0 failures, 0 errors) Closes #3049 -- 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]
