feat(notifications): deliver the maintainer recap digest to Discord (#2245) - #4317
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4317 +/- ##
=======================================
Coverage ? 93.81%
=======================================
Files ? 398
Lines ? 36784
Branches ? 13439
=======================================
Hits ? 34508
Misses ? 1622
Partials ? 654
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 21:29:46 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…SONbored#2245) Add deliverRecapToDiscord(env, report): post a multi-repo maintainer RecapReport to the operator's global DISCORD_WEBHOOK_URL as an embed, reusing notify-discord.ts's isValidDiscordWebhook validation + best-effort postWebhook send pattern. A maintainer recap is ONE operator-level digest spanning many repos (report.repos), so — unlike the per-repo ReviewRecap sender sendReviewRecapToDiscord / notifyActionToDiscord, which route per-repo via resolveDiscordWebhook — there is no single repo to route by and it posts to the flat global webhook. Best-effort and observable, mirroring sendReviewRecapToDiscord: an unset/invalid webhook or a send failure is recorded to the audit ledger (maintainer_recap_notification.discord) and returned as { sent, reason } but never thrown, so a Discord outage never breaks the recap job. The RecapReport is already public-safe (the builder sanitizes every free-text field). Closes JSONbored#2245
140496f to
4d7102e
Compare
Adds
deliverRecapToDiscord(env, report)— the Discord channel of the #1963 maintainer recap digest (#2245), sibling of the Slack delivery.What it does
RecapReportto the operator's globalDISCORD_WEBHOOK_URLas an embed (window totals: reviewed / merged / closed / gate false-positives / overrides / reversals + the summary lines).notifyActionToDiscord's per-repo routing — it targets the single operator-level webhook, reusing the existingisValidDiscordWebhookvalidation + best-effortpostWebhooksend pattern already innotify-discord.ts.RecapReportis already public-safe (the builder sanitizes every free-text field), so no re-scrub is needed here.Tests
test/unit/notify-discord.test.ts: sends the embed when configured (asserts the payload + public-safe: no economic/identity term leaks), no-ops when the webhook is unset, no-ops when it fails validation (non-https), and never throws on a send rejection — all four branches covered.Closes #2245