d790a9edfe
- Add internal/notify package: best-effort release notifications to Slack, Microsoft Teams, Google Chat, Telegram, and a generic JSON webhook; every target is independently opt-in and a failed notification never fails the release - Add notify config section (slack_webhook_url, teams_webhook_url, google_chat_webhook_url, telegram_bot_token/telegram_chat_id, webhook_url) with matching env var fallbacks; 100% coverage plus FuzzMessagePayloads - Wire notification sending into run() — fires after tag+push (including --no-release), skipped on --no-push/--no-commit since nothing was published yet - Document the notify section in README, Hugo docs, and .releaser.yml template; update CLAUDE.md architecture/fuzzing tables - Also commit the Apache License 2.0 docs-site footer link (docs/hugo.toml geekdocContentLicense), left uncommitted from a prior change Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
936 B
Go
29 lines
936 B
Go
package notify
|
|
|
|
import (
|
|
"encoding/json"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
// FuzzMessagePayloads verifies that building a notification payload never
|
|
// panics on arbitrary version/notes strings, no matter the target — release
|
|
// notes are generated from free-form commit messages and end up embedded in
|
|
// every payload below.
|
|
func FuzzMessagePayloads(f *testing.F) {
|
|
f.Add("v1.2.3", "release notes")
|
|
f.Add("", "")
|
|
f.Add("v1.0.0", "* markdown _weird_ [chars] `code` <html> & \"quotes\"")
|
|
f.Add("tag\nwith\nnewline", "notes\x00with\xffbinary")
|
|
f.Add("v1.0.0", strings.Repeat("x", 10000))
|
|
|
|
f.Fuzz(func(t *testing.T, version, notes string) {
|
|
msg := Message{Version: version, Notes: notes}
|
|
_, _ = json.Marshal(newSlackPayload(msg))
|
|
_, _ = json.Marshal(newGoogleChatPayload(msg))
|
|
_, _ = json.Marshal(newTeamsPayload(msg))
|
|
_, _ = json.Marshal(newTelegramPayload("chat-id", msg))
|
|
_, _ = json.Marshal(newWebhookPayload(msg))
|
|
})
|
|
}
|