From dacb01596f56214695e5a489c218fdb3092659ab Mon Sep 17 00:00:00 2001 From: Ilya Bogin Date: Tue, 16 Jun 2026 10:30:55 +0300 Subject: [PATCH 1/2] ci: alert Slack when nightly e2e fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/e2e.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index bc46cdb..56ec07c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -132,3 +132,33 @@ jobs: args=(-v -ra --color=yes) [ -n "$MARKERS" ] && args+=(-m "$MARKERS") uv run --project tests/e2e pytest tests/e2e "${args[@]}" + + # Alert Slack when any e2e leg fails. Runs only on the nightly schedule — + # manual dispatch is interactive, so the operator already sees the result. + # Needs the SLACK_WEBHOOK_URL repo secret (a Slack Incoming Webhook URL; the + # target channel is fixed by the webhook). Self-skips if the secret is unset. + notify: + name: notify-slack-on-failure + needs: e2e + if: failure() && github.event_name == 'schedule' + runs-on: ubuntu-latest + steps: + - name: Post failure to Slack + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + REPO: ${{ github.repository }} + run: | + if [ -z "$SLACK_WEBHOOK_URL" ]; then + echo "::warning::SLACK_WEBHOOK_URL not set — skipping Slack alert" + exit 0 + fi + # Build the payload with jq so RUN_URL/REPO are JSON-escaped, never + # interpolated into the shell or the JSON string by hand. + payload="$(jq -n \ + --arg repo "$REPO" \ + --arg url "$RUN_URL" \ + '{text: ("🔴 Nightly e2e failed for *" + $repo + "*\n<" + $url + "|View run>")}')" + curl --proto '=https' --tlsv1.2 -sSf --retry 3 \ + -X POST -H 'Content-Type: application/json' \ + -d "$payload" "$SLACK_WEBHOOK_URL" From 44313601d28a1ad6213d85346e0dd3f1c0b354db Mon Sep 17 00:00:00 2001 From: Ilya Bogin Date: Tue, 16 Jun 2026 11:20:49 +0300 Subject: [PATCH 2/2] ci: alert Slack on cancelled e2e runs too, not just failures 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) --- .github/workflows/e2e.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 56ec07c..266ce55 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -133,14 +133,17 @@ jobs: [ -n "$MARKERS" ] && args+=(-m "$MARKERS") uv run --project tests/e2e pytest tests/e2e "${args[@]}" - # Alert Slack when any e2e leg fails. Runs only on the nightly schedule — - # manual dispatch is interactive, so the operator already sees the result. - # Needs the SLACK_WEBHOOK_URL repo secret (a Slack Incoming Webhook URL; the - # target channel is fixed by the webhook). Self-skips if the secret is unset. + # Alert Slack when any e2e leg does not succeed. Runs only on the nightly + # schedule — manual dispatch is interactive, so the operator already sees the + # result. `result != 'success'` covers both failures and cancellations (the + # 30-min job timeout cancels rather than fails), so timed-out nightly runs + # still alert. Needs the SLACK_WEBHOOK_URL repo secret (a Slack Incoming + # Webhook URL; the target channel is fixed by the webhook). Self-skips if the + # secret is unset. notify: name: notify-slack-on-failure needs: e2e - if: failure() && github.event_name == 'schedule' + if: ${{ always() && github.event_name == 'schedule' && needs.e2e.result != 'success' }} runs-on: ubuntu-latest steps: - name: Post failure to Slack