发布

  • [OPIK-5599] [BE] Fix experiment items not displayed after evaluation suite deletion (#6053)

    frostbyte_neo 发布于 2026-04-02 13:11:55 +00:00

    • [OPIK-5599] [BE] Fix experiment items not displayed after evaluation suite deletion

    When an evaluation suite (dataset) was deleted, subsequent requests for
    dataset items with experiment items returned 404 because DatasetItemService
    unconditionally called datasetService.findById(), which throws when the
    dataset no longer exists.

    Changes:

    • DatasetService: add verifyVisibilityIfExists() — only throws 404 when the
      dataset exists but fails the visibility check; silently succeeds when deleted
    • DatasetItemService.getItems(): replace the blocking findById() guard with a
      reactive Mono.fromCallable wrapping verifyVisibilityIfExists(), allowing
      requests to proceed after deletion
    • DatasetItemService.getItemsWithExperimentItems(): when getFallbackVersionId()
      returns empty (all versions deleted), fall back to the legacy dao.getItems()
      so experiment items are still returned from ClickHouse
    • DatasetsResourceTest: add regression test covering the deleted-suite scenario
    • Revision 2: Fix data field assertion in deleted evaluation suite test

    • Revision 2: Address PR review comments

    • DatasetExpansionService: use AsyncUtils.setRequestContext to ensure VISIBILITY is set in Reactor context
    • DatasetService.verifyVisibilityIfExists: add debug log documenting the silent-pass when dataset not found
    • DatasetsResourceTest: fix pre-existing typos; use assertPageAndContent to also assert traceId on returned experiment items
    • Revision 3: Document silent-pass intent in verifyVisibilityIfExists

    • [OPIK-5599] [BE] Fix epoch timestamps from deleted dataset items mapping to null

    When dataset items are queried via LEFT JOIN after the dataset is deleted,
    ClickHouse returns the epoch (1970-01-01T00:00:00Z) for DateTime fields where
    no row matched. Map epoch instants to null in DatasetItemResultMapper so
    callers receive null instead of the sentinel epoch value.

    Update assertPageAndContent to handle null timestamps in expected items,
    branching between asserting null vs asserting isAfter.

    • Revision 2: Apply nullIfEpoch in DatasetItemVersionDAO

    Make nullIfEpoch package-private in DatasetItemResultMapper and use it
    in DatasetItemVersionDAO, which has the same LEFT JOIN queries against
    deleted dataset tables that can return epoch timestamps.

    下载附件