Skip to content

Add Test Email Function & Workflow Email Notifications after Python Unit Tests#29

Open
procome wants to merge 6 commits into
FullStackWithLawrence:mainfrom
procome:main
Open

Add Test Email Function & Workflow Email Notifications after Python Unit Tests#29
procome wants to merge 6 commits into
FullStackWithLawrence:mainfrom
procome:main

Conversation

@procome
Copy link
Copy Markdown

@procome procome commented Apr 23, 2026

Pull Request: Add Test Email Function & Workflow Email Notifications

Type of Change

What type of change does your code introduce?

  • [x] New feature
  • Bug fix
  • Documentation
  • Refactor
  • Chore

Changes

This Pull Request introduces automated email notifications for the GitHub project, ensuring test results are communicated after every workflow run.

Summary of changes

  • ✅ Added a test email utility function to validate email configuration and SMTP credentials.
  • ✅ Updated the GitHub Actions workflow for Python unit tests to send an email notification after execution.
  • ✅ Notifications are sent on both success and failure, including:
    • Workflow status (✅ success / ❌ failure)
    • Repository name
    • Branch name and commit SHA
  • ✅ Email configuration is managed securely using GitHub Secrets.
  • ✅ Notification logic is executed using a final workflow step (if: always()) to guarantee delivery regardless of test results.

Testing

The following testing has been completed:

  • ✅ Verified Python unit tests execute successfully in the GitHub Actions pipeline.
  • ✅ Confirmed email notifications are delivered for:
    • Successful test runs
    • Failed test runs
  • ✅ Validated the standalone test email function using a test SMTP configuration.
  • ✅ Manually triggered workflows to verify email content, formatting, and links.

Screenshots

If applicable, add screenshots to help explain your changes

  • ✅ Successful GitHub Actions run with received email notification
  • ❌ Failed GitHub Actions run with received email notification

Dependencies

  • Python standard library: smtplib, email.message
  • SMTP configuration stored in GitHub Secrets:
    • SMTP_HOST
    • SMTP_PORT
    • SMTP_USERNAME
    • SMTP_PASSWORD
    • NOTIFICATION_EMAIL_TO
    • NOTIFY_EMAIL_FROM

Breaking Changes

❌ No breaking changes.

  • Existing workflows and unit tests remain unchanged.
  • Email notifications are additive and optional, dependent on GitHub Secrets configuration.

procome and others added 6 commits April 22, 2026 20:57
Adds a GitHub Actions workflow to send test emails.
Updated notification steps to send emails on test results using action-send-mail.
…BUG mode

  Introduces SUPPRESS_FUNCTION_LOGS env flag that attaches a pattern-based
  filter to the log handler, suppressing verbose JSON dumps (requests,
  responses, mutated message lists) while keeping meaningful operational
  events. Filter is applied to the handler rather than the logger so it
  correctly intercepts records propagated from child loggers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants