feat(channels): include event verb in ntfy title + smtp subject
CI / Build (windows/amd64) (pull_request) Successful in 30s
CI / Build (linux/amd64) (pull_request) Successful in 23s
CI / Build (linux/arm64) (pull_request) Successful in 22s
CI / Lint (pull_request) Successful in 1m19s
CI / Test (linux/amd64) (pull_request) Successful in 1m42s
CI / Build (windows/amd64) (pull_request) Successful in 30s
CI / Build (linux/amd64) (pull_request) Successful in 23s
CI / Build (linux/arm64) (pull_request) Successful in 22s
CI / Lint (pull_request) Successful in 1m19s
CI / Test (linux/amd64) (pull_request) Successful in 1m42s
Raise / ack / resolve all rendered with the same title and body on ntfy and SMTP, so a recovery looked identical to the original alert. Webhook was already fine because the JSON envelope carries 'event'. ntfy: Title '[raised · warning] dev backup_failed' (was '[warning] …') Tags 'raised,warning,backup_failed' (was 'warning,backup_failed') Body 'Resolved · <message>' / 'Acknowledged · <message>' on those events SMTP: Subject '[restic-manager] [raised · warning] dev: backup_failed' Plus: cmd/_fake_alert now accepts the ref as a positional argument (go run ./cmd/_fake_alert steve-001) instead of silently ignoring unknown positional args. Refuses ambiguous '-ref X positional Y'.
This commit is contained in:
@@ -60,13 +60,13 @@ func TestNtfySendsHeadersAndBody(t *testing.T) {
|
||||
t.Fatalf("want 200, got %d", code)
|
||||
}
|
||||
|
||||
if want := "[critical] alfa-01 check_failed"; gotTitle != want {
|
||||
if want := "[raised · critical] alfa-01 check_failed"; gotTitle != want {
|
||||
t.Errorf("Title: got %q want %q", gotTitle, want)
|
||||
}
|
||||
if gotPri != "5" {
|
||||
t.Errorf("Priority: got %q want \"5\"", gotPri)
|
||||
}
|
||||
if want := "critical,check_failed"; gotTags != want {
|
||||
if want := "raised,critical,check_failed"; gotTags != want {
|
||||
t.Errorf("Tags: got %q want %q", gotTags, want)
|
||||
}
|
||||
if gotClick != "https://rm.example/a" {
|
||||
|
||||
Reference in New Issue
Block a user