Skip to content

feat(console): add plain-language alert catalogue, deduplicated notifications, and audited mutes (#103) - #310

Merged
jusso-dev merged 1 commit into
mainfrom
feat/console-alert-notifications
Nov 21, 2026
Merged

jusso-dev merged 1 commit into
mainfrom
feat/console-alert-notifications

Conversation

@jusso-dev

Copy link
Copy Markdown
Owner

Summary

Closes #103.

Completes plain-language alerts and notifications with deduplication, audited muting, and optional Teams webhook / SMTP email delivery:

  • Alert catalogue (AlertCatalogue.cs, AlertModels.cs):
    • Exposes GET /api/alerts/catalogue (View) mapping every health condition (offline, history-changed, not-sending, stale, queue-full, send-trouble, pending, suspended, set-aside, backlog, quiet-source, policy-not-applied, privacy-not-applied, job-failed, no-collectors, Sentinel proof states) and collector EventIds (1008, 1302, 1500, 1501, 1600, 1702, 2101) to plain wording, severity, and suggested fixes.
  • Audited alert muting (ManagementStore.Alerts.cs, AlertEndpoints.cs, HomeModels.cs, ManagementStore.Home.cs):
    • Adds alert_mutes table and GET /api/alerts/mutes (View), POST /api/alerts/mute (Operate, bounded 15m–30d duration + required reason), and POST /api/alerts/mutes/{id}/unmute (Operate).
    • Writes alert.muted / alert.unmuted audit rows in the same SQLite transaction and annotates active HomeAttention items with optional muted, muteId, mutedUntil, muteReason fields.
  • Deduplicated outbound notifications (AlertNotificationService.cs, Jobs/AlertNotificationJob.cs):
    • Adds recurring job alert-notifications (every 5 minutes) evaluating active fleet alerts, skipping audited mutes, deduplicating repeated notifications within BOWER_ALERT_DEDUP_MINUTES (default 60m, range 5–1440m), marking cleared conditions resolved so recurrences re-notify, and writing alert.notification-sent audit rows.
    • Supports Microsoft Teams webhooks (BOWER_ALERT_TEAMS_WEBHOOK_FILE, HTTPS required) and SMTP email (BOWER_ALERT_EMAIL_*, password from BOWER_ALERT_EMAIL_PASSWORD_FILE — zero new NuGet packages). Secrets are loaded strictly from files on disk and never stored in SQLite or returned via HTTP (GET /api/alerts/channels returns metadata-only flags).
    • Notification bodies carry plain wording, counts, suggested fixes, and a sign-in-protected console /alerts link — never raw event content.
  • Console Alerts UI (HomePage.tsx, types.ts, AlertsMute.test.tsx):
    • Adds Operator+ "Mute alert" (duration preset + audited reason) and "Unmute notifications" controls on /alerts plus muted status badges.
  • Security & Docs: Updates docs/security/threat-model.md.

Verification

  • dotnet build --configuration Release — 0 warnings, 0 errors
  • dotnet test (AlertNotificationTests, HomeStatusTests, ManagementApiTests) — 14 passed, 0 failed
  • dotnet format --verify-no-changes — passed
  • cd ui/Bower.Management.Web && npm run lint && npm test && npm run build — 17/17 test files (109/109 tests) passed, production bundle built cleanly
  • python3 -m unittest tools/docs/tests/test_build_tools.py — 7/7 passed

Security and compatibility impact

  • All new API routes, SQLite tables, and HomeAttention fields are strictly additive and Native AOT source-generated (ManagementJsonContext).
  • Zero new NuGet dependencies. Webhook URLs and SMTP passwords come strictly from server-side files; outbound notifications contain no event content and link to Entra-protected /alerts.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69966f58-4010-48d6-bb94-174d5d7e8bf4
Commits

Reviewing files that changed from the base of the PR and between a0b3fc1 and bc92c24.

Files selected for processing: 17

  • docs/security/threat-model.md
  • src/Bower.Management.Api/AlertCatalogue.cs
  • src/Bower.Management.Api/AlertEndpoints.cs
  • src/Bower.Management.Api/AlertModels.cs
  • src/Bower.Management.Api/AlertNotificationService.cs
  • src/Bower.Management.Api/HomeModels.cs
  • src/Bower.Management.Api/Jobs/AlertNotificationJob.cs
  • src/Bower.Management.Api/ManagementApplication.cs
  • src/Bower.Management.Api/ManagementJson.cs
  • src/Bower.Management.Api/ManagementStore.Alerts.cs
  • src/Bower.Management.Api/ManagementStore.Home.cs
  • src/Bower.Management.Api/ManagementStore.cs
  • tests/Bower.UnitTests/AlertNotificationTests.cs
  • tests/Bower.UnitTests/ManagementApiTests.cs
  • ui/Bower.Management.Web/src/pages/AlertsMute.test.tsx
  • ui/Bower.Management.Web/src/pages/HomePage.tsx
  • ui/Bower.Management.Web/src/types.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@jusso-dev
jusso-dev force-pushed the feat/console-alert-notifications branch from 6778c75 to bc92c24 Compare November 21, 2026 23:05
@jusso-dev
jusso-dev merged commit cb42861 into main Nov 21, 2026
25 checks passed
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.

Console: plain-language alerts and notifications with suggested fixes

1 participant