发布

  • [OPIK-4934] [BE] refactor: move project name resolution into service layer (#5727)

    frostbyte_neo 发布于 2026-03-19 14:34:16 +00:00

    • [OPIK-4934] [BE] refactor: move project name resolution into service layer

    Address andrescrz review feedback: resolveProjectIdByName logic belongs
    in the service, not the resource.

    • Add DatasetService.findByName(workspaceId, DatasetIdentifier, visibility)
      overload that resolves project name internally via ProjectService
    • Inject ProjectService into DatasetItemServiceImpl; move project
      name->id resolution inside getItems so the resource no longer needs it
    • Remove resolveProjectIdByName helper, ProjectService field and import
      from DatasetsResource
    • Fix DatasetsResourceIntegrationTest to match updated constructor
    • [OPIK-4934] [BE] refactor: address baz review — strict project validation and reactive resolution
    • DatasetService.findByName(identifier): throw NotFoundException when projectName is
      provided but no matching project exists, instead of silently falling back to a
      workspace-wide search
    • DatasetItemService.getItems: remove pre-reactive ProjectService call; delegate
      project resolution to DatasetService.findByName(DatasetIdentifier) inside
      Mono.fromCallable so blocking lookup runs on boundedElastic scheduler
    • Remove ProjectService injection from DatasetItemServiceImpl (no longer needed)
    • fix(tests): restore fallback and ignore ttft in trace assertions
    • DatasetService.findByName: revert orElseThrow to orElse(null) so that
      a non-existent project name falls back to searching without project
      scope, preserving the documented contract tested by
      getDatasetByIdentifier__whenNonExistingProjectName and
      streamDataItems__whenNonExistingProjectName
    • TraceAssertions: add ttft to IGNORED_FIELDS_TRACES to prevent flaky
      failures from Double precision loss when ClickHouse stores/returns the
      field (findWithImageTruncation parameterized tests were affected)
    • fix(tests): compare ttft with Double tolerance instead of ignoring

    Replace the blanket ttft ignore with a proper Double comparator.
    findWithImageTruncation now builds a RecursiveComparisonConfiguration
    with StatsUtils::compareDoubles (abs tolerance 1e-6) so the field
    value is still verified but floating-point ULP differences from
    ClickHouse storage are tolerated. Consistent with assertTraces()
    which already used this comparator for all Double fields.

    • Update GetTracesByProjectResourceTest.java
    下载附件