8000 feat(notifications): add per-task incident policies by cuisongliu · Pull Request #2 · cuisongliu/macmini-task-monitor · GitHub
[go: up one dir, main page]

Skip to content

feat(notifications): add per-task incident policies - #2

Merged
cuisongliu merged 1 commit into
mainfrom
cuisongliu/feishu-notifications-integrate
Nov 13, 2026
Merged

cuisongliu merged 1 commit into
mainfrom
cuisongliu/feishu-notifications-integrate

Conversation

@cuisongliu
Copy link
Copy Markdown
Owner

Summary

  • Add reusable Feishu Webhook, Feishu application bot, and SMTP notification channels.
  • Add per-task notification rules with incident deduplication, cooldowns, reminders, recovery messages, and hourly limits.
  • Add a notification settings form, channel test actions, credential redaction, durable delivery state, and coverage for the new behavior.

Sequence Diagram

sequenceDiagram
    participant Runner
    participant Policy as Notification Policy
    participant DB as SQLite
    participant Channel as Feishu or SMTP
    Runner->>Policy: Report task result
    Policy->>DB: Read task state and delivery counters
    DB-->>Policy: Return incident state and limits
    alt Message allowed
        Policy->>DB: Reserve delivery slot and persist state
        Policy->>Channel: Send notification
        Channel-->>Policy: Return delivery result
        Policy->>DB: Persist sent or suppressed state
    else Duplicate or rate limited
        Policy->>DB: Persist suppressed count
    end
    Policy-->>Runner: Keep the original task exit code
Loading

Verification

  • python3 -m unittest discover -s tests -v (53 tests passed)
  • node --check web/app.js
  • node tests/frontend.cjs
  • git diff --check

Notes

  • Task notifications are disabled by default.
  • Notification failures do not change business task execution results.
  • Automated tests use temporary SQLite and mocked transports; no real notification was sent.

@cuisongliu
cuisongliu merged commit 4e2c947 into main Nov 13, 2026
@cuisongliu
cuisongliu deleted the cuisongliu/feishu-notifications-integrate branch November 13, 2026 07:02
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.

1 participant

0