feat(notify): add notification plugin system #204

Merged
fuzzy merged 2 commits from feat/add-notification-plugins into main 2026-07-06 18:20:33 +00:00
Owner

What

Add notification plugin system:

  • Notifier interface for sending notification messages (#164)
  • SlackWebhook — posts formatted messages to Slack incoming webhooks (#162)
  • WebhookNotifier — sends JSON POST to any webhook URL (#162)
  • ExternalPlugin — runs external binaries with JSON stdin (#163)
  • Example plugin script in deploy/plugins/ (#164)

Why

Enables alerting on webhook events via Slack, custom webhooks, or arbitrary external scripts. Extensible via the Notifier interface.

Testing

  • Unit tests pass — 3 tests: webhook, Slack, external plugin
  • Integration tests pass — N/A
  • Manual testing performed — go test ./... and pre-commit pass
  • New tests added for new functionality — notify_test.go

Breaking Changes

None.

Notes

  • Plugin binaries receive JSON on stdin: {"title":"...","body":"..."}
  • Exit 0 = success, non-zero = failure
  • Example plugin shows basic stdin parsing pattern

Closes #165
Closes #162
Closes #163
Closes #164

## What Add notification plugin system: - `Notifier` interface for sending notification messages (#164) - `SlackWebhook` — posts formatted messages to Slack incoming webhooks (#162) - `WebhookNotifier` — sends JSON POST to any webhook URL (#162) - `ExternalPlugin` — runs external binaries with JSON stdin (#163) - Example plugin script in `deploy/plugins/` (#164) ## Why Enables alerting on webhook events via Slack, custom webhooks, or arbitrary external scripts. Extensible via the Notifier interface. ## Testing - [x] Unit tests pass — 3 tests: webhook, Slack, external plugin - [ ] Integration tests pass — N/A - [x] Manual testing performed — `go test ./...` and pre-commit pass - [x] New tests added for new functionality — `notify_test.go` ## Breaking Changes None. ## Notes - Plugin binaries receive JSON on stdin: `{"title":"...","body":"..."}` - Exit 0 = success, non-zero = failure - Example plugin shows basic stdin parsing pattern Closes #165 Closes #162 Closes #163 Closes #164
- Notifier interface for sending notification messages
- Built-in SlackWebhook notifier via Slack incoming webhook
- Built-in WebhookNotifier for generic JSON POST
- ExternalPlugin for running notification scripts/binary
- Example plugin script (deploy/plugins/example-notifier.sh)

Closes #162
Closes #163
Closes #164
docs: mark Implement notification plugins tasks as complete
All checks were successful
CI / Test (pull_request) Successful in 2m5s
CI / Lint (golangci-lint) (pull_request) Successful in 2m6s
CI / Pre-commit Hooks (pull_request) Successful in 8m34s
CI / Test (push) Successful in 1m52s
CI / Lint (golangci-lint) (push) Successful in 2m2s
CI / Pre-commit Hooks (push) Successful in 3m5s
6752bde319
Closes #165
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-06 18:12:45 +00:00
the.auditor left a comment

Review

Clean notification plugin system. All 3 tests pass with race detector, lint and vet clean.

Interface: Notifier.Send(Message) — clean, minimal contract.

Implementations:

  • SlackWebhook — POSTs Slack-formatted text (*title*\nbody), 10s HTTP timeout
  • WebhookNotifier — POSTs raw Message JSON to any URL, 10s timeout
  • ExternalPlugin — runs external binary with JSON stdin, stdout/stderr passthrough, exit code checked

Tests: httptest server for Slack/Webhook, temp script for ExternalPlugin. All verify message delivery.

Example plugin: deploy/plugins/example-notifier.sh — shell script showing stdin JSON parsing pattern.

No blocking issues.

APPROVED

## Review Clean notification plugin system. All 3 tests pass with race detector, lint and vet clean. **Interface**: `Notifier.Send(Message)` — clean, minimal contract. **Implementations**: - **SlackWebhook** — POSTs Slack-formatted text (`*title*\nbody`), 10s HTTP timeout - **WebhookNotifier** — POSTs raw `Message` JSON to any URL, 10s timeout - **ExternalPlugin** — runs external binary with JSON stdin, stdout/stderr passthrough, exit code checked **Tests**: httptest server for Slack/Webhook, temp script for ExternalPlugin. All verify message delivery. **Example plugin**: `deploy/plugins/example-notifier.sh` — shell script showing stdin JSON parsing pattern. **No blocking issues.** **APPROVED**
fuzzy merged commit 6752bde319 into main 2026-07-06 18:20:33 +00:00
fuzzy deleted branch feat/add-notification-plugins 2026-07-06 18:20:33 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/ttheart!204
No description provided.