Skip to content

Commit e608152

Browse files
committed
getNotificationSettingsWithRules added
1 parent 0ec8592 commit e608152

File tree

4 files changed

+273
-220
lines changed

4 files changed

+273
-220
lines changed

client/events/EventClient.go

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package client
1818

1919
import (
2020
"bytes"
21+
"context"
2122
"encoding/json"
2223
"errors"
2324
"fmt"
@@ -271,23 +272,28 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
271272
// destination Url for v2
272273
destinationUrl = impl.config.DestinationURL + "/v2"
273274
// Get NotificationSettings from event
274-
notificationSettings, err := impl.notificationSettingsRepository.FindNotificationSettingsByEvent(
275-
event.PipelineType,
276-
event.PipelineId,
275+
req := repository.GetRulesRequest{
276+
TeamId: event.TeamId,
277+
EnvId: event.EnvId,
278+
AppId: event.AppId,
279+
PipelineId: event.PipelineId,
280+
PipelineType: event.PipelineType,
281+
IsProdEnv: &event.IsProdEnv,
282+
ClusterId: event.ClusterId,
283+
EnvIdsForCiPipeline: event.EnvIdsForCiPipeline,
284+
}
285+
// Get NotificationSettings from event
286+
notificationSettings, err := impl.notificationSettingsRepository.FindNotificationSettingsWithRules(
287+
context.Background(),
277288
event.EventTypeId,
278-
event.AppId,
279-
event.EnvId,
280-
event.TeamId,
281-
event.ClusterId,
282-
event.IsProdEnv,
283-
event.EnvIdsForCiPipeline,
289+
req,
284290
)
285291
if err != nil {
286292
impl.logger.Errorw("error while fetching notification settings", "err", err)
287293
return false, err
288294
}
289295

290-
// convert notificationSetting to notificationSettingbean
296+
// convert notificationSetting to notificationSettingsBean
291297
notificationSettingsBean := make([]*repository.NotificationSettingsBean, 0)
292298
for _, item := range notificationSettings {
293299
config := make([]repository.ConfigEntry, 0)

env_gen.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)