发布

  • [OPIK-4931] [BE] Add project_id to datasets, prompts, and dashboards (#5664)

    frostbyte_neo 发布于 2026-03-16 16:23:26 +00:00

    • [OPIK-4931] [BE] Add project_id to datasets, prompts, and dashboards

    Add nullable project_id column with FK constraint to datasets, prompts,
    and dashboards tables. Wire project_id through all layers (DAO, Service,
    Resource) for create, findByName with fallback, and list/find filtering.
    Include integration tests for project-scoped CRUD and filtering.

    Resolves: OPIK-4931, OPIK-4934, OPIK-4935, OPIK-4936

    • Fix tests

    • Fix tests

    • Fix tests

    • [OPIK-4931] [BE] Centralize Dataset and Prompt test factory methods

    Extract buildDataset/buildDatasetList/buildPrompt into DatasetResourceClient
    and PromptResourceClient to eliminate duplicated manufacturePojo patterns
    across 19 test files.

    • Revision 2: Address PR review feedback
    • Merge duplicate DAO findByName methods using ST templates
    • Simplify service findByName with fallback logic
    • Remove FK constraints, add service-level project validation via ProjectService
    • Add composite indexes (workspace_id, project_id) on datasets, prompts, dashboards
    • Fix leftover 2-param findByName call in DatasetService.getOrCreate
    • Revision 3: Fix PODAM-generated projectId in assertion results tests

    Use buildDataset() helper which nulls out projectId to avoid
    409 Conflict from validateProjectIdExists on random UUIDs.

    • [OPIK-4931] [BE] Fix migration number collision (000056 -> 000057)

    000056 is already taken by drop_dashboard_name_uniqueness on main.

    下载附件