发布

  • [OPIK-4934] [BE] feat: add project_name filter to dataset retrieve and stream endpoints (#5713)

    frostbyte_neo 发布于 2026-03-18 14:06:14 +00:00

    • [OPIK-4934] [BE] feat: add project_name filter to dataset retrieve and stream endpoints

    • [OPIK-4934] [BE] test: fix compilation and add project_name filter tests

    • Fix positional DatasetIdentifier/DatasetItemStreamRequest constructors
      to use builder pattern after new fields were added
    • Add ProjectService mock to DatasetsResourceIntegrationTest constructor
    • Add 4 new integration tests covering project_name filter behavior:
      • getDatasetByIdentifier with valid project_name returns scoped dataset
      • getDatasetByIdentifier with non-existing project_name falls back gracefully
      • streamDatasetItems with valid project_name returns scoped items
      • streamDatasetItems with non-existing project_name falls back gracefully
    • [OPIK-4934] [BE] fix: address PR review comments
    • Rename resolveProjectName to resolveProjectIdByName for clarity
    • Only set resolved projectId when non-null to avoid clobbering an
      existing projectId on the request
    • Log only datasetName and projectId instead of full request object
      to avoid exposing user-supplied filter strings in logs
    • [OPIK-4934] [BE] refactor: add findProjectIdByName helper to ProjectService

    Extract the repeated projectService.findByNames(...).stream().findFirst().map(Project::id)
    pattern into a shared Optional findProjectIdByName(workspaceId, projectName) method
    on ProjectService. DatasetsResource.resolveProjectIdByName() now delegates to it.

    • [OPIK-4934] [BE] fix: address PR review comments
    • Add @JsonIgnore to projectId in DatasetItemStreamRequest to prevent
      client deserialization of server-internal field
    • Guard resolveProjectIdByName in streamDatasetItems so client-supplied
      projectId is never clobbered by name resolution
    • Introduce DatasetCriteria overload on DatasetService.findByName for
      consistency with the find() API
    • Use DatasetCriteria in DatasetsResource.getDatasetByIdentifier
    • Add getDatasetByIdentifier/callGetDatasetByIdentifier to
      DatasetResourceClient test helper; refactor inline REST calls to use it
    • Use builder pattern for DatasetIdentifier in tests
    • Add streaming test covering project_id filter
    • fix(stream): use client projectId directly when present instead of null

    Use request.projectId() as-is when the client supplies it, falling back
    to resolveProjectIdByName only when projectId is absent. The previous
    form set resolvedProjectId to null on the else-branch, which happened to
    work because resolvedRequest fell back to the original request (which
    already carried projectId), but was misleading and fragile.

    下载附件