feat(deploy): Telegram + SNS alert on canary rollback (L221 — 3/5)#285
Merged
Conversation
Independent-channel surveillance on the canary-rollback path that fired silently 10 consecutive times across 2 days in the #274 retrospective. Best-effort lib alerts.publish before exit 1; trailing || true never overrides the deploy's exit code. The 4 sub-Lambda deploys (spot-orphan-reaper / changelog-cloudwatch-mirror / eod-success-friday-shell-trigger / sf-telegram-notifier) don't have canary/rollback paths — bootstrap-style deploys without a gate — so no edit needed there. The changelog-incident-mirror already uses lib alerts (per the L143/L146 fleet pass). Co-Authored-By: Claude Opus 4.7 (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.
Summary
3/5 of the L221 fleet pass. The repo that originated the recurrence class. `infrastructure/deploy.sh` is the script whose silent canary rollback fired 10 consecutive times across 2 days in the #274 retrospective. This PR adds the surveillance line that would have caught it at hit #1.
Implementation
Single insert in the canary-failure rollback block (L185-200). `python3 -m alpha_engine_lib.alerts publish --severity error --message "Canary rolled back: ..."` before `exit 1`. Trailing `|| true` ensures the alert publish failure never overrides the deploy's intended exit code.
The message includes the function name, canary status, and the version transition (v→v-1) so the operator can match the alert to the rollback log.
Sub-Lambda audit (negative)
The 4 sub-Lambda deploys don't have canary/rollback paths and stay unchanged:
The 5th sub-Lambda `changelog-incident-mirror/deploy.sh` already uses `alpha_engine_lib.alerts` (L143/L146 prior fleet pass, alpha-engine-data #277).
Fleet pass scope
Test plan
🤖 Generated with Claude Code