发布

  • [OPIK-6620][BE] Implement support on the backend side of AND Logic Option to Alerts (#6804)

    frostbyte_neo 发布于 2026-05-21 14:50:05 +00:00

    • [OPIK-6620][BE] Add group_index support for alert trigger configs and grouping logic
    • Introduced group_index field in AlertTriggerConfig model and database schema for AND/OR grouping of trigger configs.
    • Implemented validateGroupIndices method to enforce constraints on group_index values and trigger config types.
    • Updated MetricsAlertJob to handle grouped evaluation of trigger configs, including AND-group checks.
    • Enhanced webhook payload structure with grouped condition details and backwards compatibility for scalar fields.
    • Added DAO and model-level support for reading and persisting group_index.
    • [OPIK-6620][BE] Add group_index column to alert_trigger_configs table for trigger configuration grouping
    • Introduced group_index as a nullable integer column to enable AND/OR grouping of trigger configurations.
    • Added rollback SQL to drop the group_index column.
    • [OPIK-6620][BE] Rename migration file to properly sequence group_index addition for alert_trigger_configs table

    • [OPIK-6620][BE] Add tests for group_index validation and grouped trigger config behavior

    • Introduced unit tests for group_index round-tripping, negative value validation, and scope restrictions.
    • Implemented grouped AND/OR evaluation tests for alert triggers, validating webhook behavior for group-based conditions.
    • Enhanced utility methods to simplify grouped alert trigger configuration setup.
    • [OPIK-6620][BE] Rename migration file for correct sequencing of group_index changes in alert_trigger_configs table

    • [OPIK-6620][BE] Add unit tests for MetricsAlertJob grouped trigger behavior

    • Introduced test cases for grouped AND-condition evaluation, ensuring correct webhook behavior under various conditions.
    • Validated scenarios including group crossing, failure, metric absence, and payload structure accuracy.
    • Enhanced test setup utilities to streamline grouped trigger configuration.
    • [OPIK-6620][BE] Add comment to group_index migration for clarification on grouped trigger behavior
    • Included an explanation of group_index usage for AND/OR configuration grouping in alert triggers.
    • [OPIK-6620][BE] Use flatMapSequential in MetricsAlertJob to ensure deterministic payload ordering
    • Replaced flatMap with flatMapSequential to preserve source order and ensure consistent selection of primary condition in payload scalars.
    • Added regression test to validate payload ordering when metric fetches complete out of order.
    下载附件