Skip to content

Commit

Permalink
Remove old email and webhook implementations (RedHatInsights#2376)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenneg authored Dec 6, 2023
1 parent 642b10a commit 33f1c9f
Show file tree
Hide file tree
Showing 28 changed files with 140 additions and 2,080 deletions.
14 changes: 0 additions & 14 deletions .rhcicd/clowdapp-engine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ objects:
key: client-id
- name: PROCESSOR_EMAIL_BOP_ENV
value: ${BACKOFFICE_CLIENT_ENV}
- name: PROCESSOR_EMAIL_BOP_SKIP_USERS_RESOLUTION
value: ${PROCESSOR_EMAIL_BOP_SKIP_USERS_RESOLUTION}
- name: PROCESSOR_EMAIL_BOP_URL
value: ${BACKOFFICE_SCHEME}://${BACKOFFICE_HOST}:${BACKOFFICE_PORT}/v1/sendEmails
- name: PROCESSOR_EMAIL_NO_REPLY
Expand Down Expand Up @@ -242,10 +240,6 @@ objects:
value: ${NOTIFICATIONS_DRAWER_ENABLED}
- name: NOTIFICATIONS_USE_MBOP_FOR_FETCHING_USERS
value: ${NOTIFICATIONS_USE_MBOP_FOR_FETCHING_USERS}
- name: NOTIFICATIONS_WEBHOOK_CONNECTOR_ENABLED
value: ${NOTIFICATIONS_WEBHOOK_CONNECTOR_ENABLED}
- name: NOTIFICATIONS_EMAIL_CONNECTOR_ENABLED
value: ${NOTIFICATIONS_EMAIL_CONNECTOR_ENABLED}
- name: NOTIFICATIONS_DRAWER_CONNECTOR_ENABLED
value: ${NOTIFICATIONS_DRAWER_CONNECTOR_ENABLED}
- name: NOTIFICATIONS_ASYNC_AGGREGATION_ENABLED
Expand Down Expand Up @@ -331,9 +325,6 @@ parameters:
- name: NOTIFICATIONS_LOG_LEVEL
description: Log level for com.redhat.cloud.notifications
value: INFO
- name: PROCESSOR_EMAIL_BOP_SKIP_USERS_RESOLUTION
description: Should BOP skip transforming usernames from our payload into email addresses using the IT Users Service?
value: "false"
- name: QUARKUS_HIBERNATE_ORM_LOG_SQL
value: "false"
- name: QUARKUS_LOG_CLOUDWATCH_API_CALL_TIMEOUT
Expand Down Expand Up @@ -416,11 +407,6 @@ parameters:
value: "false"
- name: NOTIFICATIONS_USE_MBOP_FOR_FETCHING_USERS
value: "false"
- name: NOTIFICATIONS_WEBHOOK_CONNECTOR_ENABLED
value: "false"
- name: NOTIFICATIONS_EMAIL_CONNECTOR_ENABLED
description: Is the email connector enabled to process emails there instead of in the engine?
value: "false"
- name: NOTIFICATIONS_DRAWER_CONNECTOR_ENABLED
description: Is the drawer connector enabled to process them instead of in the engine?
value: "false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,12 @@ public class FeatureFlipper {
@ConfigProperty(name = "notifications.use-mbop-for-fetching-users", defaultValue = "false")
boolean useMBOPForFetchingUsers;

@ConfigProperty(name = "notifications.webhook-connector.enabled", defaultValue = "false")
boolean webhookConnectorEnabled;

@ConfigProperty(name = "notifications.email-connector.enabled", defaultValue = "false")
boolean emailConnectorEnabled;

@ConfigProperty(name = "notifications.drawer-connector.enabled", defaultValue = "false")
boolean drawerConnectorEnabled;

@ConfigProperty(name = "notifications.async-aggregation.enabled", defaultValue = "true")
boolean asyncAggregation;

@ConfigProperty(name = "processor.email.bop.skip-users-resolution", defaultValue = "false")
boolean skipBopUsersResolution;

@ConfigProperty(name = "processor.email.aggregation.use-recipients-resolver-clowdapp.enabled", defaultValue = "false")
boolean useRecipientsResolverClowdappForDailyDigestEnabled;

Expand All @@ -114,11 +105,8 @@ void logFeaturesStatusAtStartup(@Observes StartupEvent event) {
Log.infof("The integration with the export service is %s", exportServiceIntegrationEnabled ? "enabled" : "disabled");
Log.infof("Drawer feature is %s", drawerEnabled ? "enabled" : "disabled");
Log.infof("The use of BOP/MBOP for fetching users is %s", useMBOPForFetchingUsers ? "enabled" : "disabled");
Log.infof("The webhook connector is %s", webhookConnectorEnabled ? "enabled" : "disabled");
Log.infof("The email connector is %s", emailConnectorEnabled ? "enabled" : "disabled");
Log.infof("The drawer connector is %s", drawerConnectorEnabled ? "enabled" : "disabled");
Log.infof("The async aggregation is %s", asyncAggregation ? "enabled" : "disabled");
Log.infof("The BOP users resolution is %s", !skipBopUsersResolution ? "enabled" : "disabled");
Log.infof("The Recipients resolver usage for daily digest is %s", useRecipientsResolverClowdappForDailyDigestEnabled ? "enabled" : "disabled");
}

Expand Down Expand Up @@ -244,24 +232,6 @@ public void setUseMBOPForFetchingUsers(final boolean useMBOPForFetchingUsers) {
this.useMBOPForFetchingUsers = useMBOPForFetchingUsers;
}

public boolean isWebhookConnectorEnabled() {
return webhookConnectorEnabled;
}

public void setWebhookConnectorEnabled(boolean webhookConnectorEnabled) {
checkTestLaunchMode();
this.webhookConnectorEnabled = webhookConnectorEnabled;
}

public boolean isEmailConnectorEnabled() {
return this.emailConnectorEnabled;
}

public void setEmailConnectorEnabled(final boolean emailConnectorEnabled) {
checkTestLaunchMode();
this.emailConnectorEnabled = emailConnectorEnabled;
}

public boolean isDrawerConnectorEnabled() {
return drawerConnectorEnabled;
}
Expand All @@ -280,15 +250,6 @@ public void setAsyncAggregation(boolean asyncAggregation) {
this.asyncAggregation = asyncAggregation;
}

public boolean isSkipBopUsersResolution() {
return skipBopUsersResolution;
}

public void setSkipBopUsersResolution(boolean skipBopUsersResolution) {
checkTestLaunchMode();
this.skipBopUsersResolution = skipBopUsersResolution;
}

public boolean isUseRecipientsResolverClowdappForDailyDigestEnabled() {
return useRecipientsResolverClowdappForDailyDigestEnabled;
}
Expand Down
6 changes: 0 additions & 6 deletions engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@
<version>${apache.commons.csv.version}</version>
</dependency>

<!-- Quarkus BOM -->
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-mutiny-vertx-web-client</artifactId>
</dependency>

<!-- events-schemas -->
<dependency>
<groupId>com.redhat.cloud.event</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.redhat.cloud.notifications.events;

import com.redhat.cloud.notifications.db.repositories.EndpointRepository;
import com.redhat.cloud.notifications.db.repositories.NotificationHistoryRepository;
import com.redhat.cloud.notifications.models.Endpoint;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
Expand Down Expand Up @@ -31,9 +30,6 @@ public class EndpointErrorFromConnectorHelper {
@ConfigProperty(name = "processor.webhook.max-server-errors", defaultValue = "10")
int maxServerErrors;

@Inject
NotificationHistoryRepository notificationHistoryRepository;

private Counter disabledWebhooksServerErrorCount;
private Counter disabledWebhooksClientErrorCount;
public static final String CLIENT_TAG_VALUE = "client";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.redhat.cloud.notifications.events;

import com.redhat.cloud.notifications.DelayedThrower;
import com.redhat.cloud.notifications.config.FeatureFlipper;
import com.redhat.cloud.notifications.db.repositories.EndpointRepository;
import com.redhat.cloud.notifications.ingress.Action;
import com.redhat.cloud.notifications.models.Endpoint;
Expand Down Expand Up @@ -56,9 +55,6 @@ public class EndpointProcessor {
@Inject
EmailSubscriptionTypeProcessor emailProcessor;

@Inject
FeatureFlipper featureFlipper;

@Inject
SlackProcessor slackProcessor;

Expand Down Expand Up @@ -130,11 +126,7 @@ public void process(Event event) {
if (isAggregatorEvent(event)) {
emailProcessor.processAggregation(event);
} else {
if (this.featureFlipper.isEmailConnectorEnabled()) {
emailConnectorProcessor.process(event, endpointsByTypeEntry.getValue());
} else {
emailProcessor.process(event, endpointsByTypeEntry.getValue());
}
emailConnectorProcessor.process(event, endpointsByTypeEntry.getValue());
}
break;
case WEBHOOK:
Expand Down

This file was deleted.

Loading

0 comments on commit 33f1c9f

Please sign in to comment.