Skip to content

remove unused email notification from alert-handler#190

Closed
hippogr wants to merge 1 commit into
devfrom
ruigao/remove-nodemailer
Closed

remove unused email notification from alert-handler#190
hippogr wants to merge 1 commit into
devfrom
ruigao/remove-nodemailer

Conversation

@hippogr

@hippogr hippogr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Email notification is no longer used in production (not in actions-available). Removing nodemailer and all related code eliminates the S360 CVE for nodemailer without needing a major version upgrade of an unused dependency.

Removed:

  • nodemailer, email-templates, ejs dependencies
  • mail model/controller and 3 email routes
  • email EJS templates (deploy/alert-templates/)
  • SMTP env vars and template volume mount from deployment
  • email webhook URLs from alertmanager configmap
  • alert-templates configmap creation/deletion from start/stop scripts
  • nodemailer/mailparser resolutions from job-status-change-notification

Email notification is no longer used in production (not in actions-available).
Removing nodemailer and all related code eliminates the S360 CVE for nodemailer
without needing a major version upgrade of an unused dependency.

Removed:
- nodemailer, email-templates, ejs dependencies
- mail model/controller and 3 email routes
- email EJS templates (deploy/alert-templates/)
- SMTP env vars and template volume mount from deployment
- email webhook URLs from alertmanager configmap
- alert-templates configmap creation/deletion from start/stop scripts
- nodemailer/mailparser resolutions from job-status-change-notification

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 8, 2026 08:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the unused email-notification feature from the alert-manager “alert-handler” service to eliminate the nodemailer CVE surface area and simplify deployment/runtime configuration.

Changes:

  • Removed alert-handler email routes/controllers/models and their dependencies (nodemailer, email-templates, ejs).
  • Removed Kubernetes/deploy wiring for email templates (configmaps, volume mounts, SMTP env vars, alertmanager webhook URLs).
  • Cleaned up related lockfile/resolutions entries (including nodemailer/mailparser pins).

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/alert-manager/src/job-status-change-notification/package.json Drops unused nodemailer / mailparser resolution pins.
src/alert-manager/src/alert-handler/yarn.lock Removes lock entries for deleted email-related dependencies.
src/alert-manager/src/alert-handler/routes/actions.js Removes /send-email-* API routes from alert-handler.
src/alert-manager/src/alert-handler/package.json Removes direct email dependencies and related overrides/resolutions.
src/alert-manager/src/alert-handler/models/mail.js Deletes email transport/template rendering logic.
src/alert-manager/src/alert-handler/controllers/mail.js Deletes email endpoints implementation.
src/alert-manager/deploy/stop.sh Removes deletion of the alert-templates configmap.
src/alert-manager/deploy/start.sh.template Removes creation of the alert-templates configmap.
src/alert-manager/deploy/alert-templates/kill-low-efficiency-job-alert/subject.ejs Deletes email subject template.
src/alert-manager/deploy/alert-templates/kill-low-efficiency-job-alert/html.ejs Deletes email HTML template.
src/alert-manager/deploy/alert-templates/job-status-change/subject.ejs Deletes email subject template.
src/alert-manager/deploy/alert-templates/job-status-change/html.ejs Deletes email HTML template.
src/alert-manager/deploy/alert-templates/general-templates/subject.ejs Deletes email subject template.
src/alert-manager/deploy/alert-templates/general-templates/html.ejs Deletes email HTML template.
src/alert-manager/deploy/alert-templates/cluster-usage/subject.ejs Deletes email subject template.
src/alert-manager/deploy/alert-templates/cluster-usage/html.ejs Deletes email HTML template.
src/alert-manager/deploy/alert-templates/cluster-report-lucia/subject.ejs Deletes email subject template.
src/alert-manager/deploy/alert-templates/cluster-report-lucia/html.ejs Deletes email HTML template.
src/alert-manager/deploy/alert-templates/cert-expiration/subject.ejs Deletes email subject template.
src/alert-manager/deploy/alert-templates/cert-expiration/html.ejs Deletes email HTML template.
src/alert-manager/deploy/alert-templates/adjust-user-quota/subject.ejs Deletes email subject template.
src/alert-manager/deploy/alert-templates/adjust-user-quota/html.ejs Deletes email HTML template.
src/alert-manager/deploy/alert-manager-deployment.yaml.template Removes SMTP env vars and templates volume mount/volume from deployment.
src/alert-manager/deploy/alert-manager-configmap.yaml.template Removes alertmanager webhook configs that called the removed email routes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 20 to 24
pushd $(dirname "$0") > /dev/null

# create configmap for alert-templates
{% if cluster_cfg["alert-manager"]["alert-handler"]["configured"] -%}
{% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] -%}
kubectl create configmap alert-templates \
{% for template in cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["templates"] -%}
--from-file={{ template }}-html.ejs=alert-templates/{{ template }}/html.ejs \
--from-file={{ template }}-subject.ejs=alert-templates/{{ template }}/subject.ejs \
{% endfor -%}
--dry-run=client -o yaml | kubectl apply --overwrite=true -f - || exit $?
{% endif -%}
{% endif -%}

# create configmap for node-recycler
{% if cluster_cfg["alert-manager"]["node-recycler"]["configured"] -%}
{% if "icm" in cluster_cfg["alert-manager"]["node-recycler"] -%}
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