butterfly-520-boy opened a new pull request, #4437: URL: https://github.com/apache/hertzbeat/pull/4437
## What's changed? When a monitor search and a label filter are supplied together, the current query returns monitors matching either filter. For example, searching for `web` with `env:prod` also returns test-environment web monitors and production database monitors. Combine the search predicate group and the label predicate group with AND so both filters must match. Preserve OR matching within each group and the existing app, status, ID, sorting and pagination behavior. Fixes #4430. ## Validation - Added five H2-backed regression tests that execute the service's specifications through a real JPA repository. - The original implementation fails four regression tests. - After the fix, `MonitorFilterTest`, `MonitorServiceTest` and `MonitorsControllerTest` pass: 55 tests, 0 failures, 0 errors. - Checkstyle: 0 violations. ```text ./mvnw -pl hertzbeat-manager -am -Dtest=MonitorFilterTest,MonitorServiceTest,MonitorsControllerTest -Dsurefire.failIfNoSpecifiedTests=false test ``` ## Checklist - [x] I have read the [Contributing Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide). - [x] I have written the necessary doc or comment. - [x] I have added the necessary tests and all cases have passed. ## Add or update API No API signature changes. Existing search and label parameters now intersect when both are provided. -- 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]
