From 1e194eb04e8349ad3186073ad39723ecaab91774 Mon Sep 17 00:00:00 2001 From: Ohiduz Zaman Date: Thu, 8 May 2025 15:26:21 +0530 Subject: [PATCH 1/3] Proto changes for notification rule delete/update --- .../notification/config/service/v1/notification_rule.proto | 2 ++ .../config/service/v1/notification_rule_config_service.proto | 1 + 2 files changed, 3 insertions(+) diff --git a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto index c9b9ac3e..721a2807 100644 --- a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto +++ b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule.proto @@ -21,6 +21,8 @@ message NotificationRuleMutableData { NotificationIntegrationTarget integration_target = 7; bool disabled = 8; + + bool is_deleted = 9; // Soft delete flag } message NotificationIntegrationTarget { diff --git a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto index 6e5f2b75..a7509e0f 100644 --- a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto +++ b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto @@ -38,6 +38,7 @@ message GetAllNotificationRulesRequest { message NotificationRuleFilter { repeated string event_condition_type = 1; optional bool enabled = 2; + optional bool is_deleted = 3; } message GetAllNotificationRulesResponse { From 37456ccb58038c7cccd0a90afc770fa7a3ac7210 Mon Sep 17 00:00:00 2001 From: Ohiduz Zaman Date: Tue, 13 May 2025 14:11:15 +0530 Subject: [PATCH 2/3] filter fix --- .../config/service/v1/notification_rule_config_service.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto index a7509e0f..6e5f2b75 100644 --- a/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto +++ b/notification-rule-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_rule_config_service.proto @@ -38,7 +38,6 @@ message GetAllNotificationRulesRequest { message NotificationRuleFilter { repeated string event_condition_type = 1; optional bool enabled = 2; - optional bool is_deleted = 3; } message GetAllNotificationRulesResponse { From 2db070f79be3abf1e8061d1aab3a41742788987c Mon Sep 17 00:00:00 2001 From: Ohiduz Zaman Date: Tue, 13 May 2025 16:48:08 +0530 Subject: [PATCH 3/3] Fetch Rule implementation modification --- .../config/service/NotificationRuleConfigServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java b/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java index ff55d6c3..4ae5d13b 100644 --- a/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java +++ b/notification-rule-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationRuleConfigServiceImpl.java @@ -108,6 +108,9 @@ public void getAllNotificationRules( .addAllNotificationRules( notificationRuleStore.getAllObjects(requestContext, request.getFilter()).stream() .map(ConfigObject::getData) + .filter( + notificationRule -> + !notificationRule.getNotificationRuleMutableData().getIsDeleted()) .collect(Collectors.toUnmodifiableList())) .build()); responseObserver.onCompleted(); @@ -145,6 +148,7 @@ public void getNotificationRule( NotificationRule notificationRule = notificationRuleStore .getData(requestContext, request.getNotificationRuleId()) + .filter(rule -> !rule.getNotificationRuleMutableData().getIsDeleted()) .orElseThrow(Status.NOT_FOUND::asRuntimeException); responseObserver.onNext( GetNotificationRuleResponse.newBuilder().setNotificationRule(notificationRule).build());