dengliming opened a new pull request, #4404: URL: https://github.com/apache/hertzbeat/pull/4404
## What's changed? YAML monitor imports fail with SnakeYAML 2.2: files exported by HertzBeat contain rejected Java class tags, untagged entries remain maps instead of DTOs, and empty documents cause a null dereference. Parse YAML as safe mappings and explicitly convert entries to monitor DTOs. Accept only the three legacy monitor DTO tags, interpreting them as mappings rather than instantiating Java classes. New exports use plain mappings without Java class tags. Reject empty documents, empty lists, and invalid entry structures with explicit errors. Add regression coverage for plain YAML, new and legacy export/import round trips, parameter and encrypted credential preservation, invalid input, and rejection of unapproved global tags. ### Validation - `YamlImExportServiceTest`: 22 tests passed. - `JsonImExportServiceTest`: 10 tests passed. - Checkstyle and `git diff --check` passed. - Tested on JDK 25 with Mockito loaded as a startup agent; JaCoCo was disabled for this targeted run. ## Checklist - [x] I have read the repository [Contributing Guide](https://github.com/apache/hertzbeat/blob/master/CONTRIBUTING.md). - [x] I have written the necessary comments. - [x] I have added the necessary unit tests and all selected cases have passed. ## Add or update API Not applicable; no API changes. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
