Skip to content

Feat/UI notification improvements#3936

Open
thefu21 wants to merge 8 commits into
semaphoreui:developfrom
thefu21:feat/ui-notification-improvements
Open

Feat/UI notification improvements#3936
thefu21 wants to merge 8 commits into
semaphoreui:developfrom
thefu21:feat/ui-notification-improvements

Conversation

@thefu21

@thefu21 thefu21 commented Jun 10, 2026

Copy link
Copy Markdown

Description

This PR introduces a dedicated Notification Management system within the Project Settings UI and backend API. Currently, notification configurations in Semaphore are rigid and historically constrained. This change implements a clean, multi-service architecture per project, initially focusing on Email alerts. It provides an easily extendable foundation for adding more notification providers in future standalone updates.

What was done:

  • Database & Migrations (db/):
    • Added database schema version 2.18.8 containing tables for custom project__notification profiles and their respective connections to template alerts (project__template_notification).
    • Defined structural models and interface patterns for NotificationManager methods (Create, Get, Update, Delete, and GetRefs).
  • Web-Backend (API / Services):
    • Created NotificationMiddleware for parameter extraction and contextual validation.
    • Added structured CRUD controllers for handling notification objects via the API.
    • Integrated notification events (Create, Update, Delete) into the project's internal EventLog with type db.EventNotification.
    • Hooked sendTemplateNotifications() into the core task runner logging loop (TaskRunner_logging.go) to dynamically trigger active alerting when tasks succeed, fail, or stop.
    • Implemented secure SMTP configurations leveraging the credential storage (AccessKey manager) to pull encrypted username/password values seamlessly.
  • Routing & Interfaces:
    • Configured sub-routing boundaries within router.go to securely parse and update user notification policies per individual project scope.
immagine immagine

Future Extensibility

Note for Reviewers: This feature is designed with modularity in mind.

To add any alternative messaging service downstream (e.g., Slack, Discord, or Webhooks), developers only need to:

  1. Append the configuration payload mappings and its corresponding icon identifier into the frontend state components.
  2. Add an explicit routing branch inside the backend task runner service (alert.go) to redirect the structured json configs payload toward the targeted third-party APIs.

Impact

Improves user experience significantly by making alerting granularly adjustable across distinct automated playbooks.

Related / Fixes

Addresses parts of the long-standing community request regarding modular alerting structures.
Fixes #3387

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.

Feature: Improvements to the Notification System

1 participant