发布

  • [issue-2099] [BE] Add experiment update API with status field (#3263)

    frostbyte_neo 发布于 2025-09-29 12:46:55 +00:00

    • [issue-2099] [BE] Implement experiment update API with status field

    • [issue-2099] [BE] Add comprehensive unit tests for experiment update functionality

    • Create ExperimentServiceTest with comprehensive test coverage for update method
    • Test all scenarios: success cases, individual field updates, empty updates, error conditions
    • Add updateExperiment method to ExperimentResourceClient for integration testing
    • Add UpdateExperiments nested test class to ExperimentsResourceTest (integration tests)
    • All unit tests passing, validating core business logic functionality
    • Tests cover edge cases: non-existent experiments, DAO failures, validation scenarios
    • Revision 2: Fix enum binding and add 404 check for experiment updates
    • Fix ExperimentDAO.update to use .getValue() instead of .toString() for ExperimentType and ExperimentStatus enums
    • Add existence check in ExperimentService.update to return 404 when updating non-existent experiments
    • Ensure proper database values are stored and correct HTTP status codes are returned
    • Revision 3: Fix remaining PR comments - ClickHouse performance and test assertion
    • Added status field to Experiment entity with JsonView annotations
    • Replaced ClickHouse UPDATE with read-merge-INSERT pattern for better performance
    • Updated ExperimentDAO.mapToDto to include status field mapping
    • Added status field to INSERT statement and parameter bindings
    • Added missing test assertion for status field in ExperimentsResourceTest
    • Fixed all compilation errors and type issues
    • Fix timestamp binding issue in experiment update - use epoch time for ClickHouse compatibility

    • Fix parameter binding issues in experiment update - use correct SQL statement and parameter types

    • Fix experiment update test by implementing proper ClickHouse update pattern

    • Refactor ExperimentDAO to use INSERT ... SELECT with conditional logic like TraceDAO
    • Use StringTemplate for dynamic SQL generation with if/else conditions
    • Fix parameter binding to include user_name parameter
    • Remove unnecessary ORDER BY and LIMIT clauses from UPDATE SQL
    • Fix test to use getExperiment instead of getAndAssert with null expected value

    This resolves the immediate consistency issue for ClickHouse ReplacingMergeTree updates,
    allowing tests to assert updated data immediately after update operations.

    • Address PR comments: add @NotNull annotation, fix migration version and ON CLUSTER

    • Fix high priority PR comments: remove @NotNull from status, fix timestamp precision, add missing status assertion

    • Fix medium priority PR comments: remove redundant getById call, remove defensive error handling, use CollectionUtils

    • Fix migration prefix conflict: rename 000037 to 000038 and update changeset format

    • issue-2099 fix PR comments

    • issue-2099 fix exception in find

    • issue-2099 fix tests

    • issue-2099 fix tests

    • issue-2099 increased migration prefix

    • issue-2099 no db default value

    • issue-2099 fix unit tests

    • issue-2099 increment db migration file name

    • issue-2099 fix missing enum entry

    • issue-2099 fix db migration file

    • Revert "issue-2099 fix missing enum entry"

    This reverts commit 1b392e68fc401c99e7fbaca62260a1d1e5de4b90.

    • issue-2099 parameterized test

    • issue-2099 fix unknown status

    下载附件