Skip to content

Fire the release Slack alert from publish_release; warn when the webhook is unset - #407

Merged
PavelMakarchuk merged 1 commit into
mainfrom
slack-alert-from-publish
Jul 13, 2026
Merged

Fire the release Slack alert from publish_release; warn when the webhook is unset#407
PavelMakarchuk merged 1 commit into
mainfrom
slack-alert-from-publish

Conversation

@PavelMakarchuk

Copy link
Copy Markdown
Contributor

Problem

The Slack release alert was called from one place — the populace-publish-release CLI. Any promote that reached latest.json another way (a build script calling publish_release() directly, an experimental promote-to-latest) published silently. That's the same abnormal path that shipped recent buildi/buildj builds with no reform_validation.json — one root cause, and the missing Slack alert was the visible symptom.

Worse, when SLACK_WEBHOOK_POPULACE_* was unset, notify_release returned False silently, so a misconfigured environment looked identical to a healthy one.

Change

  • Couple the alert to the promotion. 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 --no-latest publish moves no pointer, so it isn't a new release) and a new notify flag (default True; False for tests / dry-runs / re-publishes).
  • Make a missing webhook loud. notify_release gains warn_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_release passes it.
  • Remove the now-redundant notify_release call from the publish CLI.

Tests

  • slack: warns when unset+requested, stays silent otherwise.
  • release: publish_release announces after the pointer with the right id/timestamp; notify=False skips 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_guard all 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_US is set wherever the publish runs (the build machine) — put it in tools/release.env or 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

…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>
@PavelMakarchuk
PavelMakarchuk merged commit 9d7f843 into main Jul 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant