Fire the release Slack alert from publish_release; warn when the webhook is unset - #407
Merged
Merged
Conversation
…webhook is unset The release alert only fired from the populace-publish-release CLI, so any promote path that reached latest.json another way (a build script calling publish_release directly, an experimental promote) published silently — the same gap that shipped recent builds with no reform_validation.json. And when the webhook env var was unset, notify_release returned silently, so a misconfiguration was invisible. - Move the notify_release call into publish_release(), right after latest.json is committed, so every publish path announces the release. Gated on update_latest (a non-default publish moves no pointer, so it is not a new release) and a new notify flag (default True; off for tests/dry-runs). - notify_release gains warn_if_unset: when the SLACK_WEBHOOK_POPULACE_* env var is missing, log a ::warning:: instead of returning silently, so a release that publishes without an alert is visible in the log. publish_release passes it. - Drop the now-redundant notify_release call from the publish CLI. - Tests: warn/silent behavior in slack; publish_release announces after the pointer and honors notify=False; autouse fixture keeps publish tests from posting to a real webhook if one is set in the environment. Co-Authored-By: Claude Opus 4.8 <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.
Problem
The Slack release alert was called from one place — the
populace-publish-releaseCLI. Any promote that reachedlatest.jsonanother way (a build script callingpublish_release()directly, an experimental promote-to-latest) published silently. That's the same abnormal path that shipped recentbuildi/buildjbuilds with noreform_validation.json— one root cause, and the missing Slack alert was the visible symptom.Worse, when
SLACK_WEBHOOK_POPULACE_*was unset,notify_releasereturnedFalsesilently, so a misconfigured environment looked identical to a healthy one.Change
notify_releasecall intopublish_release(), right afterlatest.jsonis committed, so every publish path announces the release. Gated onupdate_latest(a--no-latestpublish moves no pointer, so it isn't a new release) and a newnotifyflag (defaultTrue;Falsefor tests / dry-runs / re-publishes).notify_releasegainswarn_if_unset: when the env var is missing it logs a::warning::instead of returning silently, so a release that publishes without an alert shows up in the log.publish_releasepasses it.notify_releasecall from the publish CLI.Tests
publish_releaseannounces after the pointer with the right id/timestamp;notify=Falseskips it; autouse fixture keeps publish tests from posting to a real webhook if one is set in the env.test_slack/test_release/test_publish_guardall green; ruff clean. (The one failing test in the suite,test_loader::test_live_load…, is a pre-existing live test failing on a local pe-us version mismatch — unrelated.)Note
This makes silent skips impossible, but the alert still only sends when
SLACK_WEBHOOK_POPULACE_USis set wherever the publish runs (the build machine) — put it intools/release.envor export it. With this change, if it's missing you'll now see a warning in the publish log instead of silence.🤖 Generated with Claude Code