Skip to content

Feat/risk notification config support#377

Merged
reecebedding merged 6 commits into
mainfrom
feat/risk-notification-config-support
Apr 13, 2026
Merged

Feat/risk notification config support#377
reecebedding merged 6 commits into
mainfrom
feat/risk-notification-config-support

Conversation

@reecebedding
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 13, 2026 12:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds risk notification configuration support by migrating away from the legacy risk_notifications_subscribed boolean into the unified notification subscriptions model, and extends risk notifications/digests to support Slack delivery alongside email.

Changes:

  • Replace legacy risk subscription boolean with risk_notifications notification type + per-user delivery channels (email/slack), including migration/backfill.
  • Add Slack delivery paths + Slack message formatters for risk lifecycle notifications and the risk open digest.
  • Add a riskdigest CLI command to run the risk digest worker directly, and update tests/docs to match the new subscription model.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/service/worker/user_repository.go Stops returning legacy risk subscription boolean; relies on notification subscriptions + Slack link.
internal/service/worker/risk_workers.go Sends risk lifecycle notifications via user-selected channels (email/Slack); adds Slack formatting.
internal/service/worker/risk_workers_test.go Updates fixtures to seed notification subscriptions; adds Slack channel test coverage.
internal/service/worker/risk_digest_worker.go Risk digest worker now supports email + Slack deliveries and exposes a reusable “plan” builder.
internal/service/worker/risk_digest_worker_test.go Updates mocked users to use notification subscriptions; adds Slack digest test.
internal/service/worker/risk_digest_worker_integration_test.go Seeds subscription rows instead of legacy booleans; updates worker construction.
internal/service/worker/poam_workers_integration_test.go Seeds shared notification subscriptions; mostly formatting/indentation fixes in tests.
internal/service/worker/poam_digest_worker.go POAM digest now checks subscription via notification channels (email) instead of legacy boolean.
internal/service/worker/jobs.go Removes RiskNotificationsSubscribed from NotificationUser; wires Slack service into risk workers.
internal/service/slack/formatters/workflow_task_digest.go Limits number of overdue tasks shown in Slack and adds “more” notice/link.
internal/service/slack/formatters/workflow_task_digest_test.go Adds tests for overdue-task limiting behavior and “more” notice/link.
internal/service/slack/formatters/risk_notifications.go New Slack message formatters for risk lifecycle notifications and risk digest.
internal/service/slack/formatters/risk_notifications_test.go Unit tests for new risk Slack formatters.
internal/service/relational/ccf_internal.go Removes legacy RiskNotificationsSubscribed field from User model.
internal/service/notification/constants.go Adds risk_notifications notification type + wire mapping (riskNotifications).
internal/service/notification/constants_test.go Tests normalization/wire mapping for risk notifications type.
internal/service/migrator.go Adds migration to backfill legacy risk subscription into subscription rows and drop the column.
internal/service/migrator_test.go Verifies legacy risk subscription backfill + idempotency.
internal/api/handler/users.go Removes legacy boolean from subscriptions API; documents riskNotifications as supported type.
internal/api/handler/users_integration_test.go Updates API tests to validate risk notification channels via the notifications map.
docs/swagger.yaml Removes legacy boolean field from schema; updates descriptions for supported notification types.
docs/swagger.json Same as YAML: removes legacy boolean and updates descriptions.
cmd/root.go Registers new riskdigest command.
cmd/riskdigest.go Adds riskdigest test command to run digest worker directly (email + Slack initialized).
cmd/riskdigest_direct.go Implements direct-run digest execution and aggregates per-recipient errors.

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

Comment thread internal/service/worker/risk_workers.go
Comment thread internal/service/worker/risk_digest_worker.go Outdated
Comment thread internal/service/slack/formatters/workflow_task_digest.go Outdated
Comment thread cmd/riskdigest.go Outdated
Copilot AI review requested due to automatic review settings April 13, 2026 13:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.


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

Comment thread internal/service/worker/risk_workers.go
Comment thread internal/service/worker/risk_digest_worker.go
Comment thread internal/service/worker/risk_workers.go
Comment thread internal/service/worker/risk_digest_worker.go
Comment thread internal/service/worker/jobs.go
Copilot AI review requested due to automatic review settings April 13, 2026 14:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.


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

Comment thread cmd/riskdigest_direct.go
Comment thread internal/service/worker/risk_workers.go
Comment thread internal/service/worker/risk_digest_worker.go
Comment thread internal/service/worker/risk_workers.go
@reecebedding reecebedding merged commit ac9531f into main Apr 13, 2026
8 checks passed
@reecebedding reecebedding deleted the feat/risk-notification-config-support branch April 13, 2026 14:34
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