From cd1be068ed9224d1a43a2dd8fc5e8faa1c71bcb8 Mon Sep 17 00:00:00 2001 From: weilaaa <35529370+weilaaa@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:24:26 +0800 Subject: [PATCH 1/2] release: veaiops v0.1.1 (#35) --- charts/veaiops/Chart.yaml | 4 ++-- charts/veaiops/values.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/veaiops/Chart.yaml b/charts/veaiops/Chart.yaml index 27d4bd8..8478507 100644 --- a/charts/veaiops/Chart.yaml +++ b/charts/veaiops/Chart.yaml @@ -29,13 +29,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.1.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.1.0" +appVersion: "0.1.1" dependencies: - name: common diff --git a/charts/veaiops/values.yaml b/charts/veaiops/values.yaml index 329264e..b320ab0 100644 --- a/charts/veaiops/values.yaml +++ b/charts/veaiops/values.yaml @@ -245,7 +245,7 @@ backend: image: registry: veaiops-registry-cn-beijing.cr.volces.com repository: veaiops/backend - tag: v0.1.0 + tag: v0.1.1 pullPolicy: Always ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -312,7 +312,7 @@ chatops: image: registry: veaiops-registry-cn-beijing.cr.volces.com repository: veaiops/chatops - tag: v0.1.0 + tag: v0.1.1 pullPolicy: Always ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -378,7 +378,7 @@ frontend: image: registry: veaiops-registry-cn-beijing.cr.volces.com repository: veaiops/frontend - tag: v0.1.0 + tag: v0.1.1 pullPolicy: Always ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -445,7 +445,7 @@ intelligentThreshold: image: registry: veaiops-registry-cn-beijing.cr.volces.com repository: veaiops/intelligent-threshold - tag: v0.1.0 + tag: v0.1.1 pullPolicy: Always ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. @@ -538,7 +538,7 @@ initial: image: registry: veaiops-registry-cn-beijing.cr.volces.com repository: veaiops/initial - tag: v0.1.0 + tag: v0.1.1 pullPolicy: Always ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. From 5f571b09eda7ba3eca7de1b2c4974ad9b41c6c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=BA=E5=86=9B?= Date: Wed, 26 Nov 2025 10:45:48 +0800 Subject: [PATCH 2/2] fix(event): Fix Duplicate event notification delivery (#34) Previously, if multiple subscription rules matched an event and pointed to the same notification target (e.g., the same webhook endpoint or chat ID), multiple identical notifications would be sent. This change modifies the `create_notice_details` service to track sent notifications using a set of unique tuples `(event_id, channel, target)`. This ensures that a notification is delivered only once per unique target, even if triggered by multiple subscriptions. Change-Id: Ibcba09bc62d43d64ddca4862abf44232b74d43bc --- veaiops/handler/services/event/subscribe.py | 58 ++++++++++++--------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/veaiops/handler/services/event/subscribe.py b/veaiops/handler/services/event/subscribe.py index f3e5c9b..c251c1d 100644 --- a/veaiops/handler/services/event/subscribe.py +++ b/veaiops/handler/services/event/subscribe.py @@ -93,40 +93,50 @@ async def create_notice_details(event: Event, subscribes: List[Subscribe]) -> Li """ logger.info(f"start create notice details. event_id={event.id} matched_subscribes={subscribes}") notice_details = [] + seen_notifications = set() for subscribe in subscribes: # 2.1 Webhook notification if subscribe.enable_webhook is True and subscribe.webhook_endpoint: - logger.info(f"create notice detail with webhook endpoint {subscribe.webhook_endpoint} meet") - notice_details.append( - EventNoticeDetail( - event_main_id=event.id, - notice_channel=ChannelType.Webhook, - target=subscribe.webhook_endpoint, - extra={"headers": subscribe.webhook_headers}, - status=EventStatus.INITIAL, + key = (event.id, ChannelType.Webhook, subscribe.webhook_endpoint) + if key not in seen_notifications: + logger.info(f"create notice detail with webhook endpoint {subscribe.webhook_endpoint} meet") + notice_details.append( + EventNoticeDetail( + event_main_id=event.id, + notice_channel=ChannelType.Webhook, + target=subscribe.webhook_endpoint, + extra={"headers": subscribe.webhook_headers}, + status=EventStatus.INITIAL, + ) ) - ) + seen_notifications.add(key) # 2.2 Channel notifications for strategy in subscribe.inform_strategy_ids: logger.info(f"create notice detail with channel strategy {strategy}") for chat_id in strategy.chat_ids: - logger.info( - f"create notice detail with channel strategy {strategy} channel{strategy.channel} chat_id {chat_id}" - ) - notice_details.append( - EventNoticeDetail( - event_main_id=event.id, - notice_channel=ChannelType(strategy.channel), - target=chat_id, - extra={ - "bot_id": strategy.bot_id, - "msg_id": event.raw_data.msg_id if isinstance(event.raw_data, AgentNotification) else "", - "chat_id": chat_id, - }, - status=EventStatus.INITIAL, + key = (event.id, ChannelType(strategy.channel), chat_id) + if key not in seen_notifications: + logger.info( + f"create notice detail with channel strategy {strategy} " + f"channel {strategy.channel} chat_id {chat_id}" ) - ) + notice_details.append( + EventNoticeDetail( + event_main_id=event.id, + notice_channel=ChannelType(strategy.channel), + target=chat_id, + extra={ + "bot_id": strategy.bot_id, + "msg_id": event.raw_data.msg_id + if isinstance(event.raw_data, AgentNotification) + else "", + "chat_id": chat_id, + }, + status=EventStatus.INITIAL, + ) + ) + seen_notifications.add(key) return notice_details