ci: alert Slack when nightly e2e fails - #44
Conversation
Add a notify job (needs: e2e, if: failure() && schedule) that posts to a Slack Incoming Webhook (SLACK_WEBHOOK_URL secret) with the run link. Only fires on the nightly schedule — manual dispatch is interactive. Self-skips if the secret is unset; payload built with jq to JSON-escape values. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Review by Qodo
1.
|
PR Summary by QodoCI: Notify Slack on nightly E2E workflow failures WalkthroughsDescription• Add a Slack notification job when the scheduled nightly E2E matrix fails. • Gate alerts to cron runs only, avoiding noise on manual workflow_dispatch runs. • Post a run link via Incoming Webhook, safely JSON-encoding payload with jq. Diagramgraph TD
A["GitHub Actions: E2E workflow"] --> B["e2e job (matrix)"] -->|"needs; only if failure() & schedule"| C["notify job"] --> D{{"Slack webhook"}}
High-Level AssessmentThe following are alternative approaches to this PR: 1. Use slackapi/slack-github-action
2. Create a GitHub Issue / use GitHub Notifications instead of Slack
Recommendation: The current approach (a small notify job using curl + jq with a webhook secret) is a good fit: minimal dependencies, runs only on scheduled failures, and avoids brittle manual JSON string interpolation. Consider adopting slackapi/slack-github-action only if you expect richer message formatting or more complex routing later. File ChangesOther (1)
|
failure() excludes cancellations, so a nightly run that hits the 30-min job timeout (cancelled, not failed) would skip the Slack alert. Gate the notify job on `needs.e2e.result != 'success'` under always() instead, so timeouts/cancellations also fire the alert. Surfaced by Qodo review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Что
Добавляет job
notifyв.github/workflows/e2e.yml, который пишет в Slack при падении ночного e2e-прогона.Как работает
needs: e2e— ждёт всю матрицу (Linux/macOS/Windows;fail-fast: false).if: failure() && github.event_name == 'schedule'— алерт только на ночном cron, не на ручномworkflow_dispatch(там оператор и так видит результат).SLACK_WEBHOOK_URL(канал фиксируется самим webhook). Сообщение: статус + ссылка на конкретный run.jq -n --arg, значения JSON-экранируются.Setup
Секрет
SLACK_WEBHOOK_URLуже добавлен в репозиторий. Webhook проверен (Slack ответилok).🤖 Generated with Claude Code