feat: notification jobs and emails for workflows#327
Conversation
feat: new task assigned Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Pull request overview
This pull request implements a comprehensive notification system for workflows, adding email notifications for task assignments, due-soon reminders, daily digests, and execution failures. The changes integrate a new notification enqueuer pattern into the workflow execution engine and introduce several new River worker types to handle asynchronous email delivery.
Changes:
- Adds four new notification worker types (task-assigned, due-soon, task-digest, execution-failed) with corresponding email templates
- Introduces NotificationEnqueuer interface for decoupling notification jobs from the workflow engine
- Updates workflow configuration to support scheduling notification jobs
- Implements user repository for notification recipient lookup
- Adds CreatedByID/UpdatedByID tracking to workflow instances
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| workflow.yaml | Adds configuration flags for enabling due-soon and task-digest notifications with cron schedules |
| internal/config/workflow.go | Defines new configuration fields for notification features with defaults |
| internal/config/workflow_test.go | Tests for new notification configuration fields |
| internal/workflow/executor.go | Integrates NotificationEnqueuer interface and enqueues task-assigned notifications during workflow initialization and step unblocking |
| internal/workflow/overdue.go | Adds notification enqueuing when workflow executions fail during overdue checks |
| internal/workflow/manager.go | Enqueues failure notifications when workflow execution job enqueuing fails |
| internal/workflow/assignment.go | Enqueues task-assigned notifications after step reassignment, adds logger parameter to constructor |
| internal/workflow/assignment_test.go | Updates tests to pass logger to NewAssignmentService |
| internal/workflow/executor_integration_test.go | Updates tests to pass logger to NewAssignmentService |
| internal/service/worker/service.go | Implements notification enqueuer methods, wires up new workers, adds periodic job configuration |
| internal/service/worker/jobs.go | Defines job args for notification types, adds notification worker implementations |
| internal/service/worker/user_repository.go | Implements user lookup for notification recipients |
| internal/service/worker/due_soon_checker.go | Periodic worker that finds tasks due soon and enqueues reminder emails |
| internal/service/worker/workflow_task_digest_checker.go | Periodic worker that enqueues digest jobs for subscribed users |
| internal/service/worker/workflow_task_digest_worker.go | Sends per-user digest of pending/overdue tasks |
| internal/service/worker/workflow_execution_failed_worker.go | Sends failure notification to workflow instance creator |
| internal/service/worker/*_test.go | Comprehensive test coverage for new workers |
| internal/service/email/templates/templates/*.html | HTML email templates for notifications |
| internal/service/email/templates/templates/*.txt | Plain text email templates for notifications |
| internal/service/email/templates/service_test.go | Tests for new email templates |
| internal/api/handler/workflows/workflow_instance.go | Captures CreatedByID and UpdatedByID from actor claims |
| internal/api/handler/workflows/*_integration_test.go | Updates tests to pass logger to NewAssignmentService |
| internal/api/handler/api.go | Updates handler initialization to pass logger to NewAssignmentService |
| Makefile | Changes "reviewable" target from swagger generation to linting and integration tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 68 out of 68 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fix: tests Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 74 out of 74 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fix: email templates for my tasks Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 74 out of 74 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 74 out of 74 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/service/worker/workflow_execution_failed_worker_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 74 out of 74 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.