发布

  • [OPIK-4499] [BE] Allow null baseVersion in dataset item changes for new evaluation suites (#5302)

    frostbyte_neo 发布于 2026-02-18 19:47:23 +00:00

    • [OPIK-4499] [BE] Allow null baseVersion in dataset item changes for new evaluation suites

    Remove @NotNull from baseVersion in DatasetItemChanges to allow creating
    the first version of a new evaluation_suite dataset with evaluators and
    execution_policy before any items exist.

    • Guard null baseVersion with early return in applyDeltaChanges()
    • Validate that null baseVersion is only allowed when dataset has no versions
    • Add hasVersions() to DatasetVersionService
    • Add integration test for the null-baseVersion path

    Implements OPIK-4499

    Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

    • Revision 2: Use BadRequestException for null baseVersion validation

    Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

    • Revision 3: Consolidate duplicate null-baseVersion checks into single early return

    Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

    • Revision 4: Reject item changes when baseVersion is null

    Validate that addedItems, editedItems, and deletedIds are all empty
    when baseVersion is null. Prevents silent data loss if a client sends
    items on the metadata-only first-version path.

    Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

    • Revision 5: Require override=true when baseVersion is null

    Null baseVersion is only accepted with override=true query param,
    adding an explicit opt-in gate for first-version creation.

    Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


    Co-authored-by: Claude Opus 4.6 noreply@anthropic.com

    下载附件