Real-time Slack alerts on release publish - #173
Merged
Conversation
Fire a Slack notification inline from the publish CLI, the moment latest.json goes live, instead of polling for new releases. The alert goes to a per-country channel via an incoming webhook (SLACK_WEBHOOK_POPULACE_US / _UK) and is a no-op unless that env var is set. A failed post is logged, never raised, so a Slack hiccup can never fail an otherwise-successful publish. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PavelMakarchuk
added a commit
to PolicyEngine/calibration-diagnostics
that referenced
this pull request
Jun 23, 2026
Release alerts now fire in real time from the Populace publish pipeline (PolicyEngine/microcosm#173), the moment latest.json goes live. The polling cron was a fragile fallback that could double-post, so drop it: the cron route, its Slack/KV helpers, and the crons block in vercel.json. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Sends a Slack notification the moment a Populace release is published, instead of relying on a polling cron job.
The alert fires inline from
populace-publish-release(the publish CLI) right afterlatest.jsonis uploaded — so it's truly event-driven, real-time, and runs wherever the publish runs.How it works
populace.data.slack.notify_release(...)posts to a per-country Slack incoming webhook.populace-uk*→ UK, everything else → US.SLACK_WEBHOOK_POPULACE_USSLACK_WEBHOOK_POPULACE_UK::warning::) but never raised, so a Slack outage can't fail an otherwise-successful publish.urllib) — no new dependencies.Setup (to activate)
Create an incoming webhook for each channel (
#populace-us,#populace-uk) and setSLACK_WEBHOOK_POPULACE_US/SLACK_WEBHOOK_POPULACE_UKin whatever environment runspopulace-publish-release. Until then it's a silent no-op.Tests
tests/test_slack.py— country inference, no-op without webhook, posts to the country webhook, and never raises on post failure. All passing locally alongsidetest_release.py.🤖 Generated with Claude Code