Skip to content
Snippets Groups Projects
Verified Commit de9b5ff9 authored by Jordi Gómez's avatar Jordi Gómez
Browse files

chore(formatting): updating code formatting

parent 4c347135
No related branches found
No related tags found
1 merge request!221feat: adding email notification when certian revalidation threshold is met
Pipeline #70193 failed
/**
* Copyright (c) 2025 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
* This program and the accompanying materials are made available under the terms of the Eclipse
* Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
......@@ -18,7 +17,7 @@ public interface MailerService {
/**
* Notifies a configured recipient about an stuck revalidation request.
*
* @param tracking the GithubWebhookTracking object containing information about the request
* @param tracking the GithubWebhookTracking object containing information about the request
* @param threshold the used threshold for the revalidation alert
*/
void sendRevalidationAlert(GithubWebhookTracking tracking, Integer threshold);
......
/**
* Copyright (c) 2025 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
* This program and the accompanying materials are made available under the terms of the Eclipse
* Public License 2.0 which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Jordi Gómez <jordi.gomez@eclipse-foundation.org>
*
......@@ -51,16 +50,13 @@ public class DefaultMailerService implements MailerService {
messageBuilder.setSubject(subject);
messageBuilder.setText(revalidationAlertTemplate.data("attempts", threshold)
.data("requestId", tracking.getId())
.data("repository", tracking.getRepositoryFullName())
.data("requestId", tracking.getId()).data("repository", tracking.getRepositoryFullName())
.data("pullRequest", tracking.getPullRequestNumber())
.data("lastState", tracking.getLastKnownState())
.data("lastUpdated", tracking.getLastUpdated().toString())
.render());
.data("lastUpdated", tracking.getLastUpdated().toString()).render());
messageBuilder.addTo(revalidationAlertConfig.to().toArray(String[]::new));
revalidationAlertConfig.authorMessage().replyTo()
.ifPresent(messageBuilder::addReplyTo);
revalidationAlertConfig.authorMessage().replyTo().ifPresent(messageBuilder::addReplyTo);
revalidationAlertConfig.authorMessage().bcc()
.ifPresent(bcc -> messageBuilder.addBcc(bcc.toArray(String[]::new)));
......
......@@ -17,9 +17,8 @@ public interface EclipseMailerConfig {
public RevalidationAlert revalidationAlert();
/**
* This interface defines the contract for specifying recipients and message
* configuration when sending revalidation alerts within the ECA validation
* process.
* This interface defines the contract for specifying recipients and message configuration when
* sending revalidation alerts within the ECA validation process.
*/
public interface RevalidationAlert {
public List<String> to();
......@@ -32,4 +31,4 @@ public interface EclipseMailerConfig {
public Optional<List<String>> bcc();
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment