Repository navigation
MINOR - feat(dq): accept multiple testCaseStatus values on testCases/search/list (2.0 backport) - #31831
Conversation
…search/list (#31498) `GET /v1/dataQuality/testCases/search/list` bound `testCaseStatus` to a single String and built a single Elasticsearch `term` clause, so filtering on more than one status was impossible. The parameter is now a `List<String>` that accepts repeated params and/or comma separated values, is validated case-insensitively against the `TestCaseStatus` enum, and is turned into a `terms` clause so the statuses match as an OR. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Sriharsha Chintalapani <[email protected]> (cherry picked from commit 5722dfe)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedClean 2.0 backport of #31498 that updates SearchListFilter to accept multiple comma-separated testCaseStatus values using terms queries, fixing nightly E2E test failures. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| private static String validateTestCaseStatuses(List<String> statuses) { | ||
| String joinedStatuses = null; | ||
| if (!nullOrEmpty(statuses)) { | ||
| List<String> validStatuses = | ||
| statuses.stream() | ||
| .flatMap(status -> Arrays.stream(status.split(","))) | ||
| .map(String::trim) | ||
| .filter(status -> !status.isEmpty()) | ||
| .map(TestCaseResource::toTestCaseStatus) | ||
| .map(TestCaseStatus::value) | ||
| .distinct() | ||
| .toList(); | ||
| joinedStatuses = validStatuses.isEmpty() ? null : String.join(",", validStatuses); | ||
| } | ||
| return joinedStatuses; | ||
| } |
There was a problem hiding this comment.
The new status-normalization code and related filter and test helpers omit final from parameters and non-reassigned local variables. This conflicts with the repository's immutability convention and makes accidental reassignment easier during later maintenance; the same pattern also occurs in SearchListFilter.java and TestCaseResourceIT.java.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| return str.replace("\"", "\\\""); | ||
| } | ||
|
|
||
| /** Comma separated statuses are matched as an OR, a single status still matches exactly. */ |
There was a problem hiding this comment.
Redundant private-method comments
This comment restates the splitting and OR behavior directly expressed by the following method, adding maintenance overhead without documenting a non-obvious constraint. The new private-method comments in TestCaseResource.java similarly narrate behavior already clear from the method names and implementations.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
2.0 backport of #31498 (
5722dfe1), cherry-picked with-x. Clean pick, no conflicts.Why this is needed on 2.0
The UI half of the multi-select test case status filter — #31662 — was backported to
2.0(34ffe490) but this backend half was not.SearchListFilter.javaon 2.0 has not been touched since July, so it still builds a single-value clause:When the UI sends
testCaseStatus=Success,Failed, that term query matches the literal string"Success,Failed", ES returns zero hits, and the test case list renders empty.This is currently the only failing test in the 2.0 AUT nightly, on every lane:
Failing runs (all on build
2.0-202608200745, failed on the run and both retries — deterministic, not flake):Line 1295 is precisely the assertion #31662 added: select
Success(list correctly empties), then addFailed, and expect the failed test cases back viatestCaseStatus=Success,Failed.Verification
2.0tip (eb149723), 4 files, +226/−11.getTestCaseCondition()callsgetTestCaseStatusCondition(status), which splits on comma and emits{"terms": {"testCaseResult.testCaseStatus": ["Success", "Failed"]}}— the OR semantics the UI expects.ArraySchema,java.util.Arrays,java.util.List,TestCaseStatus, and the staticCommonUtil.nullOrEmptyare all imported in the file, andSearchListFilterTestexists on this branch.SearchListFilterTest) and integration test (TestCaseResourceIT) that came with the pick, plus the 2.0 AUT nightly, are the real verification.🤖 Generated with Claude Code
Greptile Summary
The PR backports multi-value test-case status filtering to the search/list endpoint.
Confidence Score: 4/5
The PR appears safe to merge functionally, with only non-blocking Java immutability and comment-policy cleanup requested.
The endpoint validates and canonicalizes status values before constructing the intended terms query, and the accepted concerns are limited to repository style requirements in the newly added Java code.
Files Needing Attention: openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/TestCaseResource.java, openmetadata-service/src/main/java/org/openmetadata/service/search/SearchListFilter.java, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TestCaseResourceIT.java
Important Files Changed
Sequence Diagram
Reviews (1): Last reviewed commit: "MINOR - feat(dq): accept multiple testCa..." | Re-trigger Greptile
Context used (4)