Repository navigation
fix: honor latest on time-series listings without a time range; qualify the incident listing deletion scoping (backport 2.0 #36594) - #36872
Conversation
…fy the incident listing deletion scoping (backport 2.0 open-metadata#36594)
❌ 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 ✅ Approved🟡 Medium risk · Changes latest time-series and incident deletion filtering, so incorrect partitioning or scoping could omit or expose incident records in listings. Backports the time-series latest-without-range fix and incident listing test-case deletion scoping to the 2.0 branch, routing no-range latest listings and counts through partitioned queries and qualifying the incident listing deletion predicate. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Describe your changes:
Backport of #36594 onto the
2.0release branch, adapted to that branch's layout.Original PR summary: fixes the incident listing 500s (
testCaseEntityFQNunknown alias) and theWHERE deleted = FALSEfailures, which shared a root cause — a time-series listing withlatest=trueand nostartTs/endTsrouted to the plain revision listing, voidinglatestand running the base partitioned queries that bypass thetest_casejoin. On2.0the incident time-series DAO lives inCollectionDAO.TestCaseResolutionStatusTimeSeriesDAO(notTimeSeriesDAOs.java, which doesn't exist here), so the port places the changes there:EntityTimeSeriesDAO: no-range partitioned listing and count (one row perentityFQNHash), routed by latest-aware defaults (listWithOffset(filter, limit, offset, latest),listCount(filter, latest));latest=falsekeeps the existing plain paths, so DAOs that override them and their callers of the plain path are unchanged.EntityTimeSeriesRepository: the no-range branch of the total count passeslatestthrough, so the total counts partitions whenlatest=true(2.0's base calledlistCount(filter, startTs, endTs, latest)unbranched; the port reproduces the PR's branched shape).CollectionDAO.TestCaseResolutionStatusTimeSeriesDAO: overrides the no-rangelatestlisting/count to keep the origin join and the outer record-status filter (status/assignee rank on each incident's latest record), exactly as the ranged templates do minus theBETWEEN; every incident path (ranged latest and plain) now routes throughincidentCondition.incidentCondition: every incident listing carries its test-case deletion scoping as a qualified predicate —tc.deleted = FALSE/TRUEriding thetest_casejoin, which is added only when theoriginEntityFQNpredicate needs its alias; otherwise an indexedEXISTSontest_case, so no request pays a join no predicate needs and no clause dangles on a column the time-series table lacks.include=alladds neither.TestCaseResolutionStatusResource:includestays honored (defaultnon-deleted,deleted,allall work) — recorded indocs/decisions/2026-10-29-incident-listing-test-case-deletion-scoping-is-qualified.md.ListFilter: anullIncludeis normalized to an explicitALLin the constructor, andgetIncludeConditionis an exhaustive switch.TestCaseResolutionStatusRepository.addOriginEntityFQNJoin(unqualified join-by-include-or-originEntityFQN) is removed and its five call sites rewired — 2.0 callers all lived in the incident paths this PR rewrites.incidentAssignee/severity outer-filter params do not exist yet here, soLATEST_RECORD_PARAMSis("testCaseResolutionStatusType", "assignee"); the unit tests callincidentConditionthroughCollectionDAO.TestCaseResolutionStatusTimeSeriesDAOwithassignee.Type of change:
Tests:
Use cases covered
GET /v1/dataQuality/testCases/testCaseIncidentStatus) withlatest=trueand no time range: one record per incident, the chain's latest record, page total equal to the partition count — previously a 500 (testCaseEntityFQNalias) or a bogus column.New-only request does not match through an earlier record), for listing and count.latest=trueand no time range: latest not voided; total counts partitions, not revisions.includeon the incident listing is honored: soft-deleted test cases' incidents are hidden by default and listed underinclude=deleted/all.dateField+startTs/endTs, astateIdsubquery ontest_case_incident) rides the same condition path and is covered at DAO and REST level.Unit tests
EntityTimeSeriesRepositoryLatestListTest(5 tests — repo routing/count branching)TestCaseResolutionStatusTimeSeriesDaoLatestTest(4 tests — no-range join/outer-filter routing, qualified scope with join rider, EXISTS-by-include routing)TestCaseResolutionStatusRepositoryTest(addOriginEntityFQNJointests rewritten againstincidentCondition)ListFilterTest(2 tests — null include is an explicit ALL; no-arg default unchanged)Local runs on the backport commit (this PR's head):
openmetadata-serviceinstall build: green.EntityTimeSeriesRepositoryLatestListTest5,TestCaseResolutionStatusRepositoryTest14,ListFilterTest44,TestCaseResolutionStatusTimeSeriesDaoLatestTest4).Backend integration tests
openmetadata-integration-tests/(ported/extended from the original PR, adapted to 2.0's DAO API).TestCaseResolutionStatusTimeSeriesListingIT(5 tests: base time-series latest-without-range, incident latest join + outer filter, soft-deleted test cases excluded by default,originEntityFQNscoping through the join, shared ranged shape).🤖 Generated with Claude Code