Add injectable SES email service and integration coverage for moderator/subscriber send paths#508
Add injectable SES email service and integration coverage for moderator/subscriber send paths#508Copilot wants to merge 8 commits into
Conversation
Agent-Logs-Url: https://github.com/orcasound/orcahello/sessions/fafd0672-3419-4702-a453-540e52bf8764 Co-authored-by: dthaler <6547784+dthaler@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds an injectable email-sending abstraction to the NotificationSystem Azure Functions so SES email delivery can be mocked in tests, and introduces new integration tests covering the moderator and subscriber email send flows.
Changes:
- Introduce
IEmailServiceand an SES-backed implementationAwsEmailService. - Refactor
SendModeratorEmailandSendSubscriberEmailto acceptIEmailServiceand expose testable processing methods. - Add integration tests that validate email requests via a mocked
IEmailService.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| NotificationSystem/NotificationSystem/Utilities/IEmailService.cs | Adds an email service interface to decouple functions from SES client usage. |
| NotificationSystem/NotificationSystem/Utilities/AwsEmailService.cs | Implements the interface using AmazonSimpleEmailServiceClient. |
| NotificationSystem/NotificationSystem/SendSubscriberEmail.cs | Injects IEmailService and extracts message processing into ProcessMessagesAsync. |
| NotificationSystem/NotificationSystem/SendModeratorEmail.cs | Injects IEmailService, adds ProcessDocumentsAsync, and introduces a pre-check for unreviewed docs. |
| NotificationSystem/NotificationSystem/Program.cs | Wires up DI registration for IEmailService -> AwsEmailService. |
| NotificationSystem/NotificationSystem.Tests.Integration/SendSubscriberEmailIntegrationTests.cs | Adds mocked-email integration coverage for subscriber send behavior. |
| NotificationSystem/NotificationSystem.Tests.Integration/SendModeratorEmailIntegrationTests.cs | Adds mocked-email integration coverage for moderator send/skip behavior. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/orcasound/orcahello/sessions/95da9d43-19f0-40e3-a798-075c7b50ba26 Co-authored-by: dthaler <6547784+dthaler@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/orcasound/orcahello/sessions/ba6a80a7-b9bc-4b60-b5e7-f549314964b9 Co-authored-by: dthaler <6547784+dthaler@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/orcasound/orcahello/sessions/5c46132f-19ff-44c1-93c3-ae19f938ab93 Co-authored-by: dthaler <6547784+dthaler@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
NotificationSystem/NotificationSystem.Tests.Integration/SendModeratorEmailIntegrationTests.cs:78
- Same as above: this test mutates the global "SenderEmail" environment variable without resetting it afterward, which can leak state into other tests. Please restore the previous value in a finally block (or otherwise isolate the environment) to avoid cross-test interference.
Environment.SetEnvironmentVariable("SenderEmail", "sender@example.com");
var emailServiceMock = new Mock<IEmailService>();
emailServiceMock.Setup(x => x.SendEmailAsync(It.IsAny<SendEmailRequest>()))
.Returns(Task.CompletedTask);
Agent-Logs-Url: https://github.com/orcasound/orcahello/sessions/5458a156-4e20-484a-8eec-7d2e59066b1d Co-authored-by: dthaler <6547784+dthaler@users.noreply.github.com>
Agent-Logs-Url: https://github.com/orcasound/orcahello/sessions/27e8f8ec-6912-43a8-8765-5e8eb20c9550 Co-authored-by: dthaler <6547784+dthaler@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
ProcessDocumentsAsyncreturningTask<bool>when it always returnstrueProcessDocumentsAsyncto returnTaskinSendModeratorEmail.cs